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
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videolistautoplay/src/main/ets/view/XComponentVideo.ets
arkts
init
初始化AVPlayer
async init(): Promise<void> { await this.release(); // 创建avPlayer实例对象 this.avPlayer = await media.createAVPlayer(); this.isCreate = true // 创建状态机变化回调函数 await this.setSourceInfo(); // 视频信息上报函数 await this.setStateChangeCallback(); // 状态机上报回调函数 this.avPlayer.url = this.videoSrc; // 播放hls网络直播码流 }
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#Right AST#generic_type#Right 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#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . release AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right // 创建avPlayer实例对象 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avPlayer AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left media AST#expression#Right AST#await_expression#Right AST#expression#Right . createAVPlayer AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isCreate AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right // 创建状态机变化回调函数 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . setSourceInfo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right // 视频信息上报函数 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . setStateChangeCallback AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right // 状态机上报回调函数 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avPlayer AST#member_expression#Right AST#expression#Right . url AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . videoSrc AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right // 播放hls网络直播码流 } AST#builder_function_body#Right AST#method_declaration#Right
async init(): Promise<void> { await this.release(); this.avPlayer = await media.createAVPlayer(); this.isCreate = true await this.setSourceInfo(); await this.setStateChangeCallback(); this.avPlayer.url = this.videoSrc; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videolistautoplay/src/main/ets/view/XComponentVideo.ets#L88-L97
730405d29fe3a96828297461d2e97896d86941d2
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/ToastUtil.ets
arkts
showToast
弹出文本消息提示框,默认时长为2s,距离底部默认为20vp @param msg 提示消息 @param options: {duration:'',bottom:'',showMode:0} 提示参数duration为显示时长,bottom为距离底部位置,showMode设置弹窗是否显示在应用之上0内,1上
static showToast(msg: ResourceStr, options?: toastOptions): void { if (!options) { options = new toastOptions(); } promptAction.showToast({ message: msg, duration: options.duration ? options.duration : Const.ANIMATION_DURATION, bottom: options.bottom ? options.bottom : '20vp', showMode: options.showMode ? options.showMode : 0, alignment: options.alignment ? options.alignment : Alignment.Center }) }
AST#method_declaration#Left static showToast AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left toastOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left options AST#expression#Right AST#unary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left options = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left toastOptions AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left message AST#property_name#Right : AST#expression#Left msg AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left duration AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . duration AST#member_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . duration AST#member_expression#Right AST#expression#Right : AST#expression#Left Const AST#expression#Right AST#conditional_expression#Right AST#expression#Right . ANIMATION_DURATION AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . bottom AST#member_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . bottom AST#member_expression#Right AST#expression#Right : AST#expression#Left '20vp' AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left showMode AST#property_name#Right : AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . showMode AST#member_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . showMode AST#member_expression#Right AST#expression#Right : AST#expression#Left 0 AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left alignment AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . alignment AST#member_expression#Right AST#expression#Right ? AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . alignment AST#member_expression#Right AST#expression#Right : AST#expression#Left Alignment AST#expression#Right AST#conditional_expression#Right AST#expression#Right . Center AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
static showToast(msg: ResourceStr, options?: toastOptions): void { if (!options) { options = new toastOptions(); } promptAction.showToast({ message: msg, duration: options.duration ? options.duration : Const.ANIMATION_DURATION, bottom: options.bottom ? options.bottom : '20vp', showMode: options.showMode ? options.showMode : 0, alignment: options.alignment ? options.alignment : Alignment.Center }) }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/ToastUtil.ets#L32-L43
640b5d7d06a8929d2fbcea6409dc1787426db18d
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_imageText/ace_ets_module_imageText_api11/entry/src/main/ets/MainAbility/pages/TextInput/TextinputIndex.ets
arkts
asNumber
import testsuite from '../../test/List.test'
function asNumber(value: number | string | Resource) { return value as number; }
AST#function_declaration#Left function asNumber AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#as_expression#Left AST#expression#Left value AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right
function asNumber(value: number | string | Resource) { return value as number; }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_imageText/ace_ets_module_imageText_api11/entry/src/main/ets/MainAbility/pages/TextInput/TextinputIndex.ets#L21-L23
d38b167941d2fd8710868988c82b9e55a7ad10ff
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/Healthy_life/entry/src/main/ets/viewmodel/GlobalInfo.ets
arkts
GlobalInfo @param firstDate @param lastDate @param checkInDays @param achievements
export default class GlobalInfo { firstDate: string; lastDate: string; checkInDays: number; achievements: string; constructor(firstDate: string, lastDate: string, checkInDays: number, achievements: string) { this.firstDate = firstDate; this.lastDate = lastDate; this.checkInDays = checkInDays; this.achievements = achievements; } }
AST#export_declaration#Left export default AST#class_declaration#Left class GlobalInfo AST#class_body#Left { AST#property_declaration#Left firstDate : 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 lastDate : 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 checkInDays : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left achievements : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left firstDate : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left lastDate : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left checkInDays : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left achievements : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . firstDate AST#member_expression#Right = AST#expression#Left firstDate AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . lastDate AST#member_expression#Right = AST#expression#Left lastDate AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . checkInDays AST#member_expression#Right = AST#expression#Left checkInDays AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . achievements AST#member_expression#Right = AST#expression#Left achievements AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export default class GlobalInfo { firstDate: string; lastDate: string; checkInDays: number; achievements: string; constructor(firstDate: string, lastDate: string, checkInDays: number, achievements: string) { this.firstDate = firstDate; this.lastDate = lastDate; this.checkInDays = checkInDays; this.achievements = achievements; } }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Healthy_life/entry/src/main/ets/viewmodel/GlobalInfo.ets#L24-L36
2b049d88c9e8c7a9507f38864aed8fcda3c182ee
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/DynamicImport/harlibrary/src/main/ets/utils/Calc.ets
arkts
[Start dynamic_call_add]
export class Calc { public static staticAdd(a: number, b: number): number { let c = a + b; console.info('DynamicImport I am harlibrary in staticAdd, %d + %d = %d', a, b, c); return c; } public instanceAdd(a: number, b: number): number { let c = a + b; console.info('DynamicImport I am harlibrary in instanceAdd, %d + %d = %d', a, b, c); return c; } }
AST#export_declaration#Left export AST#class_declaration#Left class Calc AST#class_body#Left { AST#method_declaration#Left public static staticAdd AST#parameter_list#Left ( AST#parameter#Left a : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left b : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left c = AST#expression#Left AST#binary_expression#Left AST#expression#Left a AST#expression#Right + AST#expression#Left b AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'DynamicImport I am harlibrary in staticAdd, %d + %d = %d' AST#expression#Right , AST#expression#Left a AST#expression#Right , AST#expression#Left b AST#expression#Right , AST#expression#Left c AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left c AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left public instanceAdd AST#parameter_list#Left ( AST#parameter#Left a : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left b : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left c = AST#expression#Left AST#binary_expression#Left AST#expression#Left a AST#expression#Right + AST#expression#Left b AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'DynamicImport I am harlibrary in instanceAdd, %d + %d = %d' AST#expression#Right , AST#expression#Left a AST#expression#Right , AST#expression#Left b AST#expression#Right , AST#expression#Left c AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left c AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class Calc { public static staticAdd(a: number, b: number): number { let c = a + b; console.info('DynamicImport I am harlibrary in staticAdd, %d + %d = %d', a, b, c); return c; } public instanceAdd(a: number, b: number): number { let c = a + b; console.info('DynamicImport I am harlibrary in instanceAdd, %d + %d = %d', a, b, c); return c; } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/DynamicImport/harlibrary/src/main/ets/utils/Calc.ets#L17-L29
75c6a5788c9974cd184235b10aa332572cadf9de
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/function_call/library_function/string_lib_func_011_T.ets
arkts
Introduction 库函数-string_substring
export function string_lib_func_011_T(taint_src : string) { let t = taint_src.substring(1,3); taint.Sink(t); }
AST#export_declaration#Left export AST#function_declaration#Left function string_lib_func_011_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left t = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left taint_src AST#expression#Right . substring AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 1 AST#expression#Right , AST#expression#Left 3 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left taint AST#expression#Right . Sink AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left t AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
export function string_lib_func_011_T(taint_src : string) { let t = taint_src.substring(1,3); taint.Sink(t); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/library_function/string_lib_func_011_T.ets#L7-L10
ec6cb1f66b50dc40ed093663bcc6ba536d85caae
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets
arkts
getTextStyle
Returns the color of the value-text that is drawn next to the LimitLine. @return
public getTextStyle(): Style { return this.mTextStyle; }
AST#method_declaration#Left public getTextStyle AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Style 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_expression#Left AST#expression#Left this AST#expression#Right . mTextStyle AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public getTextStyle(): Style { return this.mTextStyle; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets#L159-L161
6073b0a52c518423434a1ef4f87086acab326398
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/arkui/component/builder.d.ets
arkts
Defines the PageMapBuilder Type. @typedef { @Builder ((name: string, param: Object | null | undefined) => void) } PageMapBuilder @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @form @atomicservice @since 20
export type PageMapBuilder = @Builder ((name: string, param: Object | null | undefined) => void) /** * Defining wrapBuilder function. * @param { function } builder * @returns { WrappedBuilder<T> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */
AST#export_declaration#Left export AST#type_declaration#Left type PageMapBuilder = AST#ERROR#Left @ Builder AST#ERROR#Right AST#type_annotation#Left AST#primary_type#Left AST#parenthesized_type#Left ( AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left param : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Object AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right ) AST#parenthesized_type#Right AST#primary_type#Right AST#type_annotation#Right /** * Defining wrapBuilder function. * @param { function } builder * @returns { WrappedBuilder<T> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ AST#type_declaration#Right AST#export_declaration#Right
export type PageMapBuilder = @Builder ((name: string, param: Object | null | undefined) => void)
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/component/builder.d.ets#L81-L89
a53edc9364ddf08ce5fd70da6219b4a91439f2eb
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videocreategif/src/main/ets/view/VideoCreateGif.ets
arkts
VideoCreateGifComponent
功能描述: 本示例介绍了如何截取视频的一段内容制作gif图片,使用FFmpeg命令对视频进行截取gif图 推荐场景: 长视频播放场景 核心组件: 1. SelectGifTimeFrameView 实现步骤: 1. 打开视频播放页面,根据视频是本地视频还是线上视频选择设置avPlayer的url。如果是线上视频,使用边缓存边播放的方式,需要记录缓存文件的本地路径。 2. 根据视频播放页面上"gif"按钮的时间点,按一定规则确定截取的时间范围,进入选取生成gif时间片段页面,通过MP4Parser获取每秒的视频帧图片,展示在时间轴上。 3. 时间轴选择框框取截取的范围。 4. 点击"下一步"按钮,会出现gif生成页面,根据起始时间和截取长度通过MP4Parser的ffmpegCmd方法生成gif图片。
@Component export struct VideoCreateGifComponent { private bannerInfoArray: BannerInfo[] = [{ image: $r("app.media.video_create_gif_preview1"), title: "鹅鹅鹅" }, { image: $r("app.media.video_create_gif_preview2"), title: "曲项向天歌" }, { image: $r("app.media.video_create_gif_preview3"), title: "白毛浮绿水" }, { image: $r("app.media.video_create_gif_preview4"), title: "红掌拨清波" }]; private videoInfoArray: VideoInfo[] = [{ image: $r("app.media.video_create_gif_preview6"), title: "本地视频截取gif", description: "视频文件已在沙箱" }, { image: $r("app.media.video_create_gif_preview5"), title: "在线视频截取gif", description: "视频边下载边播" }, { image: $r("app.media.video_create_gif_preview1"), title: "李白", description: "床前明月光" }, { image: $r("app.media.video_create_gif_preview2"), title: "杜甫", description: "好雨知时节" }, { image: $r("app.media.video_create_gif_preview3"), title: "白居易", description: "离离原上草" }, { image: $r("app.media.video_create_gif_preview4"), title: "王维", description: "空山新雨后" }, { image: $r("app.media.video_create_gif_preview1"), title: "孟浩然", description: "春眠不觉晓" }, { image: $r("app.media.video_create_gif_preview2"), title: "柳宗元", description: "千山鸟飞绝" }, { image: $r("app.media.video_create_gif_preview3"), title: "韩愈", description: "古之学者必有师" }, { image: $r("app.media.video_create_gif_preview4"), title: "苏轼", description: "水光潋滟晴方好" }]; @Provide('navPathStack') navPathStack: NavPathStack = new NavPathStack(); @Builder buildMap(name: string, params?: ESObject) { NavDestination() { if (name === "VideoPlayPage") { VideoPlayPage() } } .hideTitleBar(true) } build() { Navigation(this.navPathStack) { Scroll() { Column() { Swiper() { ForEach(this.bannerInfoArray, (value: BannerInfo) => { this.createSwiperItem(value) }, (value: BannerInfo) => value.title) } .loop(true) .indicator( Indicator.dot() .right($r('app.integer.video_create_gif_video_home_left_and_right_padding')) .itemWidth($r('app.integer.video_create_gif_banner_indicator_dot_width')) .itemHeight($r('app.integer.video_create_gif_banner_indicator_dot_width')) .selectedItemWidth($r('app.integer.video_create_gif_banner_indicator_dot_width')) .selectedItemHeight($r('app.integer.video_create_gif_banner_indicator_dot_width')) .color(Color.Gray) .selectedColor(Color.White) ) .width($r('app.string.video_create_gif_full_width')) .height($r('app.integer.video_create_gif_banner_height')) Text($r('app.string.video_create_gif_hot_teleplay')) .fontSize($r('app.integer.video_create_gif_big_font_size')) .fontColor(Color.Black) .fontWeight(500) .margin({ left: $r('app.integer.video_create_gif_video_home_left_and_right_padding'), top: $r('app.integer.video_create_gif_video_home_hot_teleplay_top_margin'), bottom: $r('app.integer.video_create_gif_video_home_hot_teleplay_bottom_margin') }) Grid() { ForEach(this.videoInfoArray, (item: VideoInfo, index: number) => { GridItem() { this.createVideoItem(item, index) } }, (item: VideoInfo) => item.title) } .columnsGap(6) .rowsGap(8) .columnsTemplate('1fr 1fr') .width($r('app.string.video_create_gif_full_width')) .padding({ left: $r('app.integer.video_create_gif_video_home_left_and_right_padding'), right: $r('app.integer.video_create_gif_video_home_left_and_right_padding') }) .alignItems(GridItemAlignment.STRETCH) .scrollBar(BarState.Off) } .width($r('app.string.video_create_gif_full_width')) .alignItems(HorizontalAlign.Start) }.height($r('app.string.video_create_gif_full_width')) .width($r('app.string.video_create_gif_full_width')) .edgeEffect(EdgeEffect.Spring) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) }.navDestination(this.buildMap) .hideBackButton(true) .hideTitleBar(true) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) .mode(NavigationMode.Stack) } /** * 创建banner单项布局 * @param bannerInfo */ @Builder createSwiperItem(bannerInfo: BannerInfo) { Column() { Text(bannerInfo.title) .fontSize($r('app.integer.video_create_gif_big_font_size')) .fontColor(Color.White) } .width($r('app.string.video_create_gif_full_width')) .height($r('app.string.video_create_gif_full_width')) .padding({ left: $r('app.integer.video_create_gif_video_home_left_and_right_padding'), bottom: $r('app.integer.video_create_gif_banner_title_bottom_padding') }) .justifyContent(FlexAlign.End) .alignItems(HorizontalAlign.Start) .backgroundImage(bannerInfo.image) .backgroundImageSize(ImageSize.Cover) .onClick(() => { promptAction.showToast({ message: $r('app.string.video_create_gif_toast_tips') }); }) } /** * 创建视频单项布局 * @param videoInfo * @param index */ @Builder createVideoItem(videoInfo: VideoInfo, index: number) { Column() { Image(videoInfo.image) .objectFit(ImageFit.Fill) .width($r('app.string.video_create_gif_full_width')) .height($r('app.integer.video_create_gif_video_home_item_height')) .borderRadius($r('app.integer.video_create_gif_video_home_item_border_radius')) Text(videoInfo.title) .fontSize($r('app.integer.video_create_gif_big_font_size')) .fontColor(Color.Black) .maxLines(1) .margin({ top: $r('app.integer.video_create_gif_video_home_item_title_top_margin') }) Text(videoInfo.description) .fontSize($r('app.integer.video_create_gif_small_font_size')) .fontColor(Color.Gray) .maxLines(1) .margin({ top: $r('app.integer.video_create_gif_video_home_item_description_top_margin') }) } .width($r('app.string.video_create_gif_full_width')) .alignItems(HorizontalAlign.Start) .id(index === 0 ? "first_video" : (index === 1 ? "second_video" : "other_video")) .onClick(() => { if (index === 0) { // 名称为本地视频截取gif this.copyFile2Sandbox('flower.mp4'); this.navPathStack.pushPath({ name: "VideoPlayPage", param: getContext(this).filesDir + "/flower.mp4" }); } else if (index === 1) { // 名称为在线视频截取gif this.navPathStack.pushPath({ name: "VideoPlayPage", param: "https://assets.mixkit.co/videos/4075/4075-720.mp4" }); } else { promptAction.showToast({ message: $r('app.string.video_create_gif_toast_tips') }); } }) } /** * 将rawfile中的文件拷贝到沙箱中 * @param filename */ copyFile2Sandbox(filename: string) { const targetPath: string = getContext().filesDir + "/" + filename; if (fs.accessSync(targetPath)) { return; } const data: resourceManager.RawFileDescriptor = getContext(this).resourceManager.getRawFdSync(filename); const destFile: fs.File = fs.openSync(targetPath, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); let buffSize: number = 4096; const buffer: ArrayBuffer = new ArrayBuffer(Math.min(buffSize, data.length)); let off: number = 0; let len: number = 0; let readLen: number = 0; while (len = fs.readSync(data.fd, buffer, { offset: data.offset + off, length: buffSize })) { readLen += len; fs.writeSync(destFile.fd, buffer, { offset: off, length: len }); off = off + len; if ((data.length - readLen) < buffSize) { buffSize = data.length - readLen; } } getContext(this).resourceManager.closeRawFdSync(filename); fs.close(destFile.fd); } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct VideoCreateGifComponent AST#component_body#Left { AST#property_declaration#Left private bannerInfoArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left BannerInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview1" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "鹅鹅鹅" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview2" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "曲项向天歌" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview3" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "白毛浮绿水" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview4" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "红掌拨清波" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left private videoInfoArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left VideoInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview6" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "本地视频截取gif" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "视频文件已在沙箱" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview5" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "在线视频截取gif" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "视频边下载边播" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview1" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "李白" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "床前明月光" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview2" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "杜甫" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "好雨知时节" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview3" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "白居易" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "离离原上草" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview4" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "王维" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "空山新雨后" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview1" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "孟浩然" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "春眠不觉晓" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview2" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "柳宗元" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "千山鸟飞绝" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview3" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "韩愈" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "古之学者必有师" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left image AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.video_create_gif_preview4" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left "苏轼" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left "水光潋滟晴方好" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Provide ( AST#expression#Left 'navPathStack' AST#expression#Right ) AST#decorator#Right navPathStack : AST#type_annotation#Left AST#primary_type#Left NavPathStack AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left NavPathStack AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildMap AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left params ? : AST#type_annotation#Left AST#primary_type#Left ESObject AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left NavDestination ( ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left name AST#expression#Right === AST#expression#Left "VideoPlayPage" AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left VideoPlayPage ( ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . hideTitleBar ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right 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 . navPathStack AST#member_expression#Right AST#expression#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Scroll ( ) AST#container_content_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 Swiper ( ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#for_each_statement#Left ForEach ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . bannerInfoArray AST#member_expression#Right AST#expression#Right , AST#ui_builder_arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left BannerInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#ui_arrow_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 . createSwiperItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#ui_arrow_function_body#Right AST#ui_builder_arrow_function#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left BannerInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#member_expression#Left AST#expression#Left value AST#expression#Right . title AST#member_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#for_each_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . loop ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . indicator ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Indicator AST#expression#Right . dot AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . right AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_left_and_right_padding' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . itemWidth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_banner_indicator_dot_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . itemHeight AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_banner_indicator_dot_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . selectedItemWidth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_banner_indicator_dot_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . selectedItemHeight AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_banner_indicator_dot_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . color AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Gray AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . selectedColor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_banner_height' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_hot_teleplay' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_big_font_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Black AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left 500 AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left left AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_left_and_right_padding' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_hot_teleplay_top_margin' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_hot_teleplay_bottom_margin' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Grid ( ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#for_each_statement#Left ForEach ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . videoInfoArray AST#member_expression#Right AST#expression#Right , AST#ui_builder_arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left VideoInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , 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#ui_arrow_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left GridItem ( ) AST#container_content_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 . createVideoItem AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left item AST#expression#Right , AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_arrow_function_body#Right AST#ui_builder_arrow_function#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left VideoInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#member_expression#Left AST#expression#Left item AST#expression#Right . title AST#member_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#for_each_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . columnsGap ( AST#expression#Left 6 AST#expression#Right ) AST#modifier_chain_expression#Left . rowsGap ( AST#expression#Left 8 AST#expression#Right ) AST#modifier_chain_expression#Left . columnsTemplate ( AST#expression#Left '1fr 1fr' AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left left AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_left_and_right_padding' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left right AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_left_and_right_padding' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . alignItems ( AST#expression#Left AST#member_expression#Left AST#expression#Left GridItemAlignment AST#expression#Right . STRETCH AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . scrollBar ( AST#expression#Left AST#member_expression#Left AST#expression#Left BarState AST#expression#Right . Off AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . alignItems ( AST#expression#Left AST#member_expression#Left AST#expression#Left HorizontalAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . edgeEffect ( AST#expression#Left AST#member_expression#Left AST#expression#Left EdgeEffect AST#expression#Right . Spring AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . expandSafeArea ( AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left SafeAreaType AST#expression#Right . SYSTEM AST#member_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left SafeAreaEdge AST#expression#Right . BOTTOM AST#member_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . navDestination ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . buildMap AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . hideBackButton ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . hideTitleBar ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . expandSafeArea ( AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left SafeAreaType AST#expression#Right . SYSTEM AST#member_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right , AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#member_expression#Left AST#expression#Left SafeAreaEdge AST#expression#Right . BOTTOM AST#member_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . mode ( AST#expression#Left AST#member_expression#Left AST#expression#Left NavigationMode AST#expression#Right . Stack AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#build_body#Right AST#build_method#Right /** * 创建banner单项布局 * @param bannerInfo */ AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right createSwiperItem AST#parameter_list#Left ( AST#parameter#Left bannerInfo : AST#type_annotation#Left AST#primary_type#Left BannerInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_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#member_expression#Left AST#expression#Left bannerInfo AST#expression#Right . title AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_big_font_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . White AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left left AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_left_and_right_padding' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_banner_title_bottom_padding' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . justifyContent ( AST#expression#Left AST#member_expression#Left AST#expression#Left FlexAlign AST#expression#Right . End AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . alignItems ( AST#expression#Left AST#member_expression#Left AST#expression#Left HorizontalAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundImage ( AST#expression#Left AST#member_expression#Left AST#expression#Left bannerInfo AST#expression#Right . image AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundImageSize ( AST#expression#Left AST#member_expression#Left AST#expression#Left ImageSize AST#expression#Right . Cover AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left message AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_toast_tips' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 创建视频单项布局 * @param videoInfo * @param index */ AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right createVideoItem AST#parameter_list#Left ( AST#parameter#Left videoInfo : AST#type_annotation#Left AST#primary_type#Left VideoInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , 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#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left AST#member_expression#Left AST#expression#Left videoInfo AST#expression#Right . image AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . objectFit ( AST#expression#Left AST#member_expression#Left AST#expression#Left ImageFit AST#expression#Right . Fill AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_item_height' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_item_border_radius' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expression#Left AST#expression#Left videoInfo AST#expression#Right . title AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_big_font_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Black AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . maxLines ( AST#expression#Left 1 AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_item_title_top_margin' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expression#Left AST#expression#Left videoInfo AST#expression#Right . description AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_small_font_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left Color AST#expression#Right . Gray AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . maxLines ( AST#expression#Left 1 AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.video_create_gif_video_home_item_description_top_margin' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_full_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . alignItems ( AST#expression#Left AST#member_expression#Left AST#expression#Left HorizontalAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . id ( AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left "first_video" AST#expression#Right : AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left "second_video" AST#expression#Right : AST#expression#Left "other_video" AST#expression#Right AST#conditional_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left 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 index AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { // 名称为本地视频截取gif AST#statement#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 . copyFile2Sandbox AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'flower.mp4' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . navPathStack AST#member_expression#Right AST#expression#Right . pushPath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left "VideoPlayPage" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left param AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left getContext AST#expression#Right AST#argument_list#Left ( AST#expression#Left this AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . filesDir AST#member_expression#Right AST#expression#Right + AST#expression#Left "/flower.mp4" AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { // 名称为在线视频截取gif AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . navPathStack AST#member_expression#Right AST#expression#Right . pushPath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left "VideoPlayPage" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left param AST#property_name#Right : AST#expression#Left "https://assets.mixkit.co/videos/4075/4075-720.mp4" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left message AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.video_create_gif_toast_tips' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right /** * 将rawfile中的文件拷贝到沙箱中 * @param filename */ AST#method_declaration#Left copyFile2Sandbox AST#parameter_list#Left ( AST#parameter#Left filename : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left targetPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left getContext AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . filesDir AST#member_expression#Right AST#expression#Right + AST#expression#Left "/" AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left filename AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . accessSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left targetPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left resourceManager . RawFileDescriptor AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left getContext AST#expression#Right AST#argument_list#Left ( AST#expression#Left this AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . resourceManager AST#member_expression#Right AST#expression#Right . getRawFdSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left filename AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left destFile : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left fs . File AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . openSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left targetPath AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . CREATE AST#member_expression#Right AST#expression#Right | AST#expression#Left fs AST#expression#Right AST#binary_expression#Right AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . READ_WRITE AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left buffSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 4096 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left buffer : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ArrayBuffer AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Math AST#expression#Right . min AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left buffSize AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . length AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left off : 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#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left len : 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#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left readLen : 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#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#while_statement#Left while ( AST#expression#Left AST#assignment_expression#Left len = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . readSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . fd AST#member_expression#Right AST#expression#Right , AST#expression#Left buffer AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left offset AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . offset AST#member_expression#Right AST#expression#Right + AST#expression#Left off AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left length AST#property_name#Right : AST#expression#Left buffSize AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left readLen += AST#expression#Left len AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . writeSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left destFile AST#expression#Right . fd AST#member_expression#Right AST#expression#Right , AST#expression#Left buffer AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left offset AST#property_name#Right : AST#expression#Left off AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left length AST#property_name#Right : AST#expression#Left len AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left off = AST#expression#Left AST#binary_expression#Left AST#expression#Left off AST#expression#Right + AST#expression#Left len AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left readLen AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right < AST#expression#Left buffSize AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left buffSize = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left readLen AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#while_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left getContext AST#expression#Right AST#argument_list#Left ( AST#expression#Left this AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . resourceManager AST#member_expression#Right AST#expression#Right . closeRawFdSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left filename AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . close AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left destFile AST#expression#Right . fd AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#component_body#Right AST#decorated_export_declaration#Right
@Component export struct VideoCreateGifComponent { private bannerInfoArray: BannerInfo[] = [{ image: $r("app.media.video_create_gif_preview1"), title: "鹅鹅鹅" }, { image: $r("app.media.video_create_gif_preview2"), title: "曲项向天歌" }, { image: $r("app.media.video_create_gif_preview3"), title: "白毛浮绿水" }, { image: $r("app.media.video_create_gif_preview4"), title: "红掌拨清波" }]; private videoInfoArray: VideoInfo[] = [{ image: $r("app.media.video_create_gif_preview6"), title: "本地视频截取gif", description: "视频文件已在沙箱" }, { image: $r("app.media.video_create_gif_preview5"), title: "在线视频截取gif", description: "视频边下载边播" }, { image: $r("app.media.video_create_gif_preview1"), title: "李白", description: "床前明月光" }, { image: $r("app.media.video_create_gif_preview2"), title: "杜甫", description: "好雨知时节" }, { image: $r("app.media.video_create_gif_preview3"), title: "白居易", description: "离离原上草" }, { image: $r("app.media.video_create_gif_preview4"), title: "王维", description: "空山新雨后" }, { image: $r("app.media.video_create_gif_preview1"), title: "孟浩然", description: "春眠不觉晓" }, { image: $r("app.media.video_create_gif_preview2"), title: "柳宗元", description: "千山鸟飞绝" }, { image: $r("app.media.video_create_gif_preview3"), title: "韩愈", description: "古之学者必有师" }, { image: $r("app.media.video_create_gif_preview4"), title: "苏轼", description: "水光潋滟晴方好" }]; @Provide('navPathStack') navPathStack: NavPathStack = new NavPathStack(); @Builder buildMap(name: string, params?: ESObject) { NavDestination() { if (name === "VideoPlayPage") { VideoPlayPage() } } .hideTitleBar(true) } build() { Navigation(this.navPathStack) { Scroll() { Column() { Swiper() { ForEach(this.bannerInfoArray, (value: BannerInfo) => { this.createSwiperItem(value) }, (value: BannerInfo) => value.title) } .loop(true) .indicator( Indicator.dot() .right($r('app.integer.video_create_gif_video_home_left_and_right_padding')) .itemWidth($r('app.integer.video_create_gif_banner_indicator_dot_width')) .itemHeight($r('app.integer.video_create_gif_banner_indicator_dot_width')) .selectedItemWidth($r('app.integer.video_create_gif_banner_indicator_dot_width')) .selectedItemHeight($r('app.integer.video_create_gif_banner_indicator_dot_width')) .color(Color.Gray) .selectedColor(Color.White) ) .width($r('app.string.video_create_gif_full_width')) .height($r('app.integer.video_create_gif_banner_height')) Text($r('app.string.video_create_gif_hot_teleplay')) .fontSize($r('app.integer.video_create_gif_big_font_size')) .fontColor(Color.Black) .fontWeight(500) .margin({ left: $r('app.integer.video_create_gif_video_home_left_and_right_padding'), top: $r('app.integer.video_create_gif_video_home_hot_teleplay_top_margin'), bottom: $r('app.integer.video_create_gif_video_home_hot_teleplay_bottom_margin') }) Grid() { ForEach(this.videoInfoArray, (item: VideoInfo, index: number) => { GridItem() { this.createVideoItem(item, index) } }, (item: VideoInfo) => item.title) } .columnsGap(6) .rowsGap(8) .columnsTemplate('1fr 1fr') .width($r('app.string.video_create_gif_full_width')) .padding({ left: $r('app.integer.video_create_gif_video_home_left_and_right_padding'), right: $r('app.integer.video_create_gif_video_home_left_and_right_padding') }) .alignItems(GridItemAlignment.STRETCH) .scrollBar(BarState.Off) } .width($r('app.string.video_create_gif_full_width')) .alignItems(HorizontalAlign.Start) }.height($r('app.string.video_create_gif_full_width')) .width($r('app.string.video_create_gif_full_width')) .edgeEffect(EdgeEffect.Spring) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) }.navDestination(this.buildMap) .hideBackButton(true) .hideTitleBar(true) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) .mode(NavigationMode.Stack) } @Builder createSwiperItem(bannerInfo: BannerInfo) { Column() { Text(bannerInfo.title) .fontSize($r('app.integer.video_create_gif_big_font_size')) .fontColor(Color.White) } .width($r('app.string.video_create_gif_full_width')) .height($r('app.string.video_create_gif_full_width')) .padding({ left: $r('app.integer.video_create_gif_video_home_left_and_right_padding'), bottom: $r('app.integer.video_create_gif_banner_title_bottom_padding') }) .justifyContent(FlexAlign.End) .alignItems(HorizontalAlign.Start) .backgroundImage(bannerInfo.image) .backgroundImageSize(ImageSize.Cover) .onClick(() => { promptAction.showToast({ message: $r('app.string.video_create_gif_toast_tips') }); }) } @Builder createVideoItem(videoInfo: VideoInfo, index: number) { Column() { Image(videoInfo.image) .objectFit(ImageFit.Fill) .width($r('app.string.video_create_gif_full_width')) .height($r('app.integer.video_create_gif_video_home_item_height')) .borderRadius($r('app.integer.video_create_gif_video_home_item_border_radius')) Text(videoInfo.title) .fontSize($r('app.integer.video_create_gif_big_font_size')) .fontColor(Color.Black) .maxLines(1) .margin({ top: $r('app.integer.video_create_gif_video_home_item_title_top_margin') }) Text(videoInfo.description) .fontSize($r('app.integer.video_create_gif_small_font_size')) .fontColor(Color.Gray) .maxLines(1) .margin({ top: $r('app.integer.video_create_gif_video_home_item_description_top_margin') }) } .width($r('app.string.video_create_gif_full_width')) .alignItems(HorizontalAlign.Start) .id(index === 0 ? "first_video" : (index === 1 ? "second_video" : "other_video")) .onClick(() => { if (index === 0) { this.copyFile2Sandbox('flower.mp4'); this.navPathStack.pushPath({ name: "VideoPlayPage", param: getContext(this).filesDir + "/flower.mp4" }); } else if (index === 1) { this.navPathStack.pushPath({ name: "VideoPlayPage", param: "https://assets.mixkit.co/videos/4075/4075-720.mp4" }); } else { promptAction.showToast({ message: $r('app.string.video_create_gif_toast_tips') }); } }) } copyFile2Sandbox(filename: string) { const targetPath: string = getContext().filesDir + "/" + filename; if (fs.accessSync(targetPath)) { return; } const data: resourceManager.RawFileDescriptor = getContext(this).resourceManager.getRawFdSync(filename); const destFile: fs.File = fs.openSync(targetPath, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); let buffSize: number = 4096; const buffer: ArrayBuffer = new ArrayBuffer(Math.min(buffSize, data.length)); let off: number = 0; let len: number = 0; let readLen: number = 0; while (len = fs.readSync(data.fd, buffer, { offset: data.offset + off, length: buffSize })) { readLen += len; fs.writeSync(destFile.fd, buffer, { offset: off, length: len }); off = off + len; if ((data.length - readLen) < buffSize) { buffSize = data.length - readLen; } } getContext(this).resourceManager.closeRawFdSync(filename); fs.close(destFile.fd); } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videocreategif/src/main/ets/view/VideoCreateGif.ets#L37-L242
5d6a8f05b6389bc1c3a713f1dde5c01498f2c0e5
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
setUsePercentValues
If this is enabled, values inside the PieChart are drawn in percent and not with their original value. Values provided for the IValueFormatter to format are then provided in percent. @param enabled
public setUsePercentValues(enabled: boolean): void { this.mUsePercentValues = enabled; }
AST#method_declaration#Left public setUsePercentValues AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mUsePercentValues AST#member_expression#Right = AST#expression#Left enabled AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public setUsePercentValues(enabled: boolean): void { this.mUsePercentValues = enabled; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L772-L774
25e01a6a2cad414dbedc7084f0bc695b1bce8999
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/CoreFile/UserFile/DevelopingFileManagerApplication/entry/src/main/ets/filemanager/pages/FileManagerApplication.ets
arkts
creatFile
[End file_info_dir] [Start create_file_promise]
async creatFile(): Promise<void> { try { // fileAccessHelperAllServer 参考 fileAccess.createFileAccessHelper 示例代码获取 fileUri = await fileAccessHelperAllServer.createFile(sourceUri, displayName); if (!fileUri) { Logger.error('createFile return undefined object'); } Logger.info('createFile sucess, fileUri: ' + JSON.stringify(fileUri)); this.uriMessage = 'CreateDocumentUriSuccess'; } catch (err) { let error: BusinessError = err as BusinessError; Logger.error('createFile failed, errCode:' + error.code + ', errMessage:' + error.message); } ; }
AST#method_declaration#Left async creatFile 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#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { // fileAccessHelperAllServer 参考 fileAccess.createFileAccessHelper 示例代码获取 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left fileUri = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left fileAccessHelperAllServer AST#expression#Right AST#await_expression#Right AST#expression#Right . createFile AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left sourceUri AST#expression#Right , AST#expression#Left displayName AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left fileUri AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'createFile return undefined object' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 'createFile sucess, fileUri: ' AST#expression#Right + AST#expression#Left JSON AST#expression#Right AST#binary_expression#Right AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left fileUri AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . uriMessage AST#member_expression#Right = AST#expression#Left 'CreateDocumentUriSuccess' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( err ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left error : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#as_expression#Left AST#expression#Left err AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 'createFile failed, errCode:' AST#expression#Right + AST#expression#Left error AST#expression#Right AST#binary_expression#Right AST#expression#Right . code AST#member_expression#Right AST#expression#Right + AST#expression#Left ', errMessage:' AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left error AST#expression#Right AST#binary_expression#Right AST#expression#Right . message AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right AST#ERROR#Left ; AST#ERROR#Right } AST#block_statement#Right AST#method_declaration#Right
async creatFile(): Promise<void> { try { fileUri = await fileAccessHelperAllServer.createFile(sourceUri, displayName); if (!fileUri) { Logger.error('createFile return undefined object'); } Logger.info('createFile sucess, fileUri: ' + JSON.stringify(fileUri)); this.uriMessage = 'CreateDocumentUriSuccess'; } catch (err) { let error: BusinessError = err as BusinessError; Logger.error('createFile failed, errCode:' + error.code + ', errMessage:' + error.message); } ; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/CoreFile/UserFile/DevelopingFileManagerApplication/entry/src/main/ets/filemanager/pages/FileManagerApplication.ets#L158-L172
35a3acde8f10f6e1a5d307a3d6bb7d516826a3a9
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets
arkts
getPlans
/从DB加载所有的plans / 从DB加载所有的plans
public static async getPlans(): Promise<Plan[] | null> { const dbPlans: DBPlan[] | null = await PlanDbAccess.shared.getPlans(); if (!dbPlans) return null; // 使用 Promise.all 并行处理异步函数 const plans: Plan[] = await Promise.all( dbPlans.map(async (dbPlan: DBPlan): Promise<Plan> => { const dbPlanHelper: DBPlanHelper = new DBPlanHelper(dbPlan); // 预先获取所有异步数据 const pieces: Piece[] = await dbPlanHelper.getPieces(); const boxes : Box[] = await dbPlanHelper.getBoxes(); const learns: Learn[] = await dbPlanHelper.getLearns(); const plan: Plan = new Plan( dbPlan.planId, dbPlan.planName, dbPlan.startDate, dbPlan.distances!.split(",").map((s: string) => parseInt(s)), dbPlan.process ?? 0, dbPlan.bookId, dbPlan.countPerDay!, pieces, boxes, learns ); return plan; }) ); return plans; }
AST#method_declaration#Left public static async getPlans 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 AST#array_type#Left Plan [ ] AST#array_type#Right AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left dbPlans : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#array_type#Left DBPlan [ ] AST#array_type#Right AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left PlanDbAccess AST#expression#Right AST#await_expression#Right AST#expression#Right . shared AST#member_expression#Right AST#expression#Right . getPlans AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left dbPlans AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right // 使用 Promise.all 并行处理异步函数 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left plans : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Plan [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left Promise AST#expression#Right AST#await_expression#Right AST#expression#Right . all AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dbPlans AST#expression#Right . map AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left async AST#parameter_list#Left ( AST#parameter#Left dbPlan : AST#type_annotation#Left AST#primary_type#Left DBPlan AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left Plan AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left dbPlanHelper : AST#type_annotation#Left AST#primary_type#Left DBPlanHelper AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left DBPlanHelper AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left dbPlan AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 预先获取所有异步数据 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left pieces : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Piece [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left dbPlanHelper AST#expression#Right AST#await_expression#Right AST#expression#Right . getPieces AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left boxes : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Box [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left dbPlanHelper AST#expression#Right AST#await_expression#Right AST#expression#Right . getBoxes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left learns : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Learn [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left dbPlanHelper AST#expression#Right AST#await_expression#Right AST#expression#Right . getLearns AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left plan : AST#type_annotation#Left AST#primary_type#Left Plan AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Plan AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left dbPlan AST#expression#Right . planId AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left dbPlan AST#expression#Right . planName AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left dbPlan AST#expression#Right . startDate AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dbPlan AST#expression#Right . distances AST#member_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right . split AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "," AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . map AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left s : 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#expression#Left AST#call_expression#Left AST#expression#Left parseInt AST#expression#Right AST#argument_list#Left ( AST#expression#Left s AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dbPlan AST#expression#Right . process AST#member_expression#Right AST#expression#Right ?? AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left dbPlan AST#expression#Right . bookId AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dbPlan AST#expression#Right . countPerDay AST#member_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right , AST#expression#Left pieces AST#expression#Right , AST#expression#Left boxes AST#expression#Right , AST#expression#Left learns AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left plan AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left plans AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public static async getPlans(): Promise<Plan[] | null> { const dbPlans: DBPlan[] | null = await PlanDbAccess.shared.getPlans(); if (!dbPlans) return null; const plans: Plan[] = await Promise.all( dbPlans.map(async (dbPlan: DBPlan): Promise<Plan> => { const dbPlanHelper: DBPlanHelper = new DBPlanHelper(dbPlan); const pieces: Piece[] = await dbPlanHelper.getPieces(); const boxes : Box[] = await dbPlanHelper.getBoxes(); const learns: Learn[] = await dbPlanHelper.getLearns(); const plan: Plan = new Plan( dbPlan.planId, dbPlan.planName, dbPlan.startDate, dbPlan.distances!.split(",").map((s: string) => parseInt(s)), dbPlan.process ?? 0, dbPlan.bookId, dbPlan.countPerDay!, pieces, boxes, learns ); return plan; }) ); return plans; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets#L133-L165
382ede14162e21816ec6f6e10c419899fe55efc6
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
arkts
determineMaxScaleFactor
Calc max scale factor.
private determineMaxScaleFactor(): void { if (this.input == undefined) { return; } let scaleFactorW = this.input.width / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); let scaleFactorH = this.input.height / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); this.cropShow.setMaxScaleFactor(scaleFactorW, scaleFactorH); }
AST#method_declaration#Left private determineMaxScaleFactor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . input AST#member_expression#Right AST#expression#Right == AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left scaleFactorW = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . input AST#member_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right / AST#expression#Left px2vp AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CommonConstants AST#expression#Right . DEFAULT_MIN_SIDE_LENGTH_EDIT AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left scaleFactorH = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . input AST#member_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right / AST#expression#Left px2vp AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left CommonConstants AST#expression#Right . DEFAULT_MIN_SIDE_LENGTH_EDIT AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cropShow AST#member_expression#Right AST#expression#Right . setMaxScaleFactor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left scaleFactorW AST#expression#Right , AST#expression#Left scaleFactorH AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private determineMaxScaleFactor(): void { if (this.input == undefined) { return; } let scaleFactorW = this.input.width / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); let scaleFactorH = this.input.height / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); this.cropShow.setMaxScaleFactor(scaleFactorW, scaleFactorH); }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets#L395-L402
3ce907ef076984a92f2a9c90fbb1dfbfae6f655f
gitee
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/pages/complex_share.ets
arkts
handleAutoExtract
处理提取信息
private async handleAutoExtract() { // 1. 增加检查:如果输入为空,或正在处理,直接返回 if (this.isProcessing || !this.inputText.trim()) { console.log("跳过提取:状态为处理中或输入为空"); return; } // 2. 设置处理状态,清空旧结果 this.isProcessing = true; this.extractedApps = []; try { console.log("开始自动提取,文本长度:", this.inputText.length); // 3. 调用自然语言提取器 const apps = await NaturalLanguageExtractor.extractAppInfoFromText(this.inputText); this.extractedApps = apps; console.log("自动提取完成,找到应用数:", apps.length); // 4. 自动填充到表单 if (this.extractedApps.length > 0) { vibrator.isSupportEffect( "haptic.effect.hard", (err: BusinessError, state: boolean) => { if (err) { console.error( `Failed to query effect. Code: ${err.code}, message: ${err.message}`, ); return; } console.info("Succeed in querying effect"); if (state) { try { vibrator.startVibration( { type: "preset", effectId: "haptic.effect.hard", count: 5, intensity: 100, }, { usage: "touch" }, (error: BusinessError) => { if (error) { console.error( `Failed to start vibration. Code: ${error.code}, message: ${error.message}`, ); } else { console.info("Succeed in starting vibration"); } }, ); } catch (tryError) { console.error( `An unexpected error occurred in try block: ${tryError}`, ); } } }, ); this.autoFillForm(); } } catch (error) { console.error("自动提取失败:", error); // 可以在这里添加用户提示,例如: // prompt.showToast({ message: '智能提取失败,请手动填写', duration: 2000 }); } finally { // 5. 确保无论成功失败,都重置处理状态 this.isProcessing = false; } }
AST#method_declaration#Left private async handleAutoExtract AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 1. 增加检查:如果输入为空,或正在处理,直接返回 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isProcessing AST#member_expression#Right AST#expression#Right || AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . inputText AST#member_expression#Right AST#expression#Right . trim AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "跳过提取:状态为处理中或输入为空" AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 2. 设置处理状态,清空旧结果 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isProcessing AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . extractedApps AST#member_expression#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "开始自动提取,文本长度:" AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . inputText AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 3. 调用自然语言提取器 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left apps = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left NaturalLanguageExtractor AST#expression#Right AST#await_expression#Right AST#expression#Right . extractAppInfoFromText AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . inputText AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . extractedApps AST#member_expression#Right = AST#expression#Left apps AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . log AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "自动提取完成,找到应用数:" AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left apps AST#expression#Right . length AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 4. 自动填充到表单 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#member_expression#Left AST#expression#Left this AST#expression#Right . extractedApps AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left vibrator AST#expression#Right . isSupportEffect AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "haptic.effect.hard" AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left err : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left state : 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#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left err AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` Failed to query effect. Code: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left err AST#expression#Right . code AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right , message: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left err AST#expression#Right . message AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right AST#ERROR#Left , AST#ERROR#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "Succeed in querying effect" AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left state AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left vibrator AST#expression#Right . startVibration AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left type AST#property_name#Right : AST#expression#Left "preset" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left effectId AST#property_name#Right : AST#expression#Left "haptic.effect.hard" AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left count AST#property_name#Right : AST#expression#Left 5 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left intensity AST#property_name#Right : AST#expression#Left 100 AST#expression#Right AST#property_assignment#Right , } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left usage AST#property_name#Right : AST#expression#Left "touch" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left error : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left error AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` Failed to start vibration. Code: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left error AST#expression#Right . code AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right , message: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left error AST#expression#Right . message AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right AST#ERROR#Left , AST#ERROR#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "Succeed in starting vibration" AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right , AST#expression#Left AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( tryError ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` An unexpected error occurred in try block: AST#template_substitution#Left $ { AST#expression#Left tryError AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right AST#ERROR#Left , AST#ERROR#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right , AST#expression#Left AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#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 . autoFillForm AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "自动提取失败:" AST#expression#Right , AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 可以在这里添加用户提示,例如: // prompt.showToast({ message: '智能提取失败,请手动填写', duration: 2000 }); } AST#block_statement#Right AST#catch_clause#Right AST#finally_clause#Left finally AST#block_statement#Left { // 5. 确保无论成功失败,都重置处理状态 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isProcessing AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#finally_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private async handleAutoExtract() { if (this.isProcessing || !this.inputText.trim()) { console.log("跳过提取:状态为处理中或输入为空"); return; } this.isProcessing = true; this.extractedApps = []; try { console.log("开始自动提取,文本长度:", this.inputText.length); const apps = await NaturalLanguageExtractor.extractAppInfoFromText(this.inputText); this.extractedApps = apps; console.log("自动提取完成,找到应用数:", apps.length); if (this.extractedApps.length > 0) { vibrator.isSupportEffect( "haptic.effect.hard", (err: BusinessError, state: boolean) => { if (err) { console.error( `Failed to query effect. Code: ${err.code}, message: ${err.message}`, ); return; } console.info("Succeed in querying effect"); if (state) { try { vibrator.startVibration( { type: "preset", effectId: "haptic.effect.hard", count: 5, intensity: 100, }, { usage: "touch" }, (error: BusinessError) => { if (error) { console.error( `Failed to start vibration. Code: ${error.code}, message: ${error.message}`, ); } else { console.info("Succeed in starting vibration"); } }, ); } catch (tryError) { console.error( `An unexpected error occurred in try block: ${tryError}`, ); } } }, ); this.autoFillForm(); } } catch (error) { console.error("自动提取失败:", error); } finally { this.isProcessing = false; } }
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/pages/complex_share.ets#L432-L500
f28e91f89b9f6de60692f82689fd8b4ed13a05f7
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_tabs.ets
arkts
save_web_state_to_sandbox
Saves my web state to the storage.
save_web_state_to_sandbox(dir: string) { try { if (this.web_state_array) { let file_name = dir + "/continue_tabs_web_state_array_" + this.index.toString(); sandbox_save(file_name, this.web_state_array.buffer); return true; } } catch (e) { console.error('[tab_info_packed][save_web_state] Error: ' + e); } return false; }
AST#method_declaration#Left save_web_state_to_sandbox AST#parameter_list#Left ( AST#parameter#Left dir : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . web_state_array AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left file_name = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left dir AST#expression#Right + AST#expression#Left "/continue_tabs_web_state_array_" AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . index AST#member_expression#Right AST#expression#Right . toString AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left sandbox_save AST#expression#Right AST#argument_list#Left ( AST#expression#Left file_name AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . web_state_array AST#member_expression#Right AST#expression#Right . buffer AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( e ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left '[tab_info_packed][save_web_state] Error: ' AST#expression#Right + AST#expression#Left e AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
save_web_state_to_sandbox(dir: string) { try { if (this.web_state_array) { let file_name = dir + "/continue_tabs_web_state_array_" + this.index.toString(); sandbox_save(file_name, this.web_state_array.buffer); return true; } } catch (e) { console.error('[tab_info_packed][save_web_state] Error: ' + e); } return false; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L1019-L1030
a975afb773754ed44ad1edfac7a649d5ee279439
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/profiler/base/BaseProfilerUtils.ets
arkts
lastIndex
返回字符结尾符坐标 @param str
function lastIndex(str) { var index = -1; for (var i = 0; i < str.length; i++) { var temp = str.charCodeAt(i).toString(16); if (temp == 'a') { return i; } } return index; }
AST#function_declaration#Left function lastIndex AST#parameter_list#Left ( AST#parameter#Left str AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left var AST#variable_declarator#Left index = AST#expression#Left AST#unary_expression#Left - AST#expression#Left 1 AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left var AST#variable_declarator#Left i = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left str AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left var AST#variable_declarator#Left temp = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left str AST#expression#Right . charCodeAt AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left i AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . toString AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 16 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left temp AST#expression#Right == AST#expression#Left 'a' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left i AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left index AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right
function lastIndex(str) { var index = -1; for (var i = 0; i < str.length; i++) { var temp = str.charCodeAt(i).toString(16); if (temp == 'a') { return i; } } return index; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/profiler/base/BaseProfilerUtils.ets#L110-L119
339ddccca3e462ca8cdb2c674efa7e0d9bcd73aa
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/encryption/AESSync.ets
arkts
decodeCBC192
解密-CBC模式-192位 @param str 加密的字符串 @param aesKey AES密钥 @param iv iv偏移量字符串 @param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式 @param dataCoding 入参字符串编码方式(hex/base64) - 不传默认为base64 @returns
static decodeCBC192(str: string, aesKey: string, iv: string, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding = 'base64'): string { return CryptoSyncUtil.decodeCBC(str, aesKey, iv, 'AES192', 'AES192|CBC|PKCS7', 192, keyCoding, dataCoding); }
AST#method_declaration#Left static decodeCBC192 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left aesKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left iv : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left keyCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dataCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expression#Right AST#parameter#Right ) 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#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CryptoSyncUtil AST#expression#Right . decodeCBC AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right , AST#expression#Left aesKey AST#expression#Right , AST#expression#Left iv AST#expression#Right , AST#expression#Left 'AES192' AST#expression#Right , AST#expression#Left 'AES192|CBC|PKCS7' AST#expression#Right , AST#expression#Left 192 AST#expression#Right , AST#expression#Left keyCoding AST#expression#Right , AST#expression#Left dataCoding AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static decodeCBC192(str: string, aesKey: string, iv: string, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding = 'base64'): string { return CryptoSyncUtil.decodeCBC(str, aesKey, iv, 'AES192', 'AES192|CBC|PKCS7', 192, keyCoding, dataCoding); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/AESSync.ets#L258-L261
f3ed62a1a3489c361f7695770b3fa1b50ab727e1
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ar/ARCardService.ets
arkts
addVoiceMessage
添加语音留言
async addVoiceMessage(cardId: string, voiceMessagePath: string): Promise<void> { try { const cardData = await this.loadARCard(cardId); if (!cardData) { throw new Error('AR card not found'); } cardData.voiceMessage = voiceMessagePath; await this.saveCardData(cardData); // 更新缓存 this.activeCards.set(cardId, cardData); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Voice message added to AR card: ${cardId}`); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to add voice message: ${error}`); throw error; } }
AST#method_declaration#Left async addVoiceMessage AST#parameter_list#Left ( AST#parameter#Left cardId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left voiceMessagePath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left 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#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left cardData = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . loadARCard AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left cardId AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left cardData AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'AR card not found' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left cardData AST#expression#Right . voiceMessage AST#member_expression#Right = AST#expression#Left voiceMessagePath AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . saveCardData AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left cardData AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 更新缓存 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . activeCards AST#member_expression#Right AST#expression#Right . set AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left cardId AST#expression#Right , AST#expression#Left cardData AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Voice message added to AR card: AST#template_substitution#Left $ { AST#expression#Left cardId AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to add voice message: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#throw_statement#Left throw AST#expression#Left error AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async addVoiceMessage(cardId: string, voiceMessagePath: string): Promise<void> { try { const cardData = await this.loadARCard(cardId); if (!cardData) { throw new Error('AR card not found'); } cardData.voiceMessage = voiceMessagePath; await this.saveCardData(cardData); this.activeCards.set(cardId, cardData); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Voice message added to AR card: ${cardId}`); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to add voice message: ${error}`); throw error; } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L543-L563
498f5b786b48b4a53a85d704caf6246e46560687
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
video net address
export const ZERO_STR: string = '0';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left ZERO_STR : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '0' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const ZERO_STR: string = '0';
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets#L44-L44
ca0a3c223cd352cc9a6b4730d97934a43a5ae411
gitee
iichen-bycode/ArkTsWanandroid.git
ad128756a6c703d9a72cf7f6da128c27fc63bd00
entry/src/main/ets/http/api.ets
arkts
title
新增收藏 @param date @returns
export function addCollect(params: { title:string,author:string,link:string }
AST#export_declaration#Left export AST#ERROR#Left function addCollect ( params : AST#ERROR#Right { title AST#ERROR#Left : string AST#ERROR#Right , author AST#ERROR#Left : string AST#ERROR#Right , link AST#ERROR#Left : string AST#ERROR#Right } AST#export_declaration#Right
export function addCollect(params: { title:string,author:string,link:string }
https://github.com/iichen-bycode/ArkTsWanandroid.git/blob/ad128756a6c703d9a72cf7f6da128c27fc63bd00/entry/src/main/ets/http/api.ets#L325-L327
47123a51d79f062e872a5af7dfd7c09a4c5735a9
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.ChipGroup.d.ets
arkts
Defines chip group space. @interface ChipGroupSpaceOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 12
export interface ChipGroupSpaceOptions { /** * Space between items. * * @type { ?(string | number) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ itemSpace?: string | number; /** * Start space. * * @type { ?Length } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ startSpace?: Length; /** * End space. * * @type { ?Length } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ endSpace?: Length; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ChipGroupSpaceOptions AST#object_type#Left { /** * Space between items. * * @type { ?(string | number) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ AST#type_member#Left itemSpace ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#type_member#Right ; /** * Start space. * * @type { ?Length } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ AST#type_member#Left startSpace ? : AST#type_annotation#Left AST#primary_type#Left Length AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; /** * End space. * * @type { ?Length } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ AST#type_member#Left endSpace ? : AST#type_annotation#Left AST#primary_type#Left Length AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface ChipGroupSpaceOptions { itemSpace?: string | number; startSpace?: Length; endSpace?: Length; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ChipGroup.d.ets#L351-L385
8f02ba2051286b5effc0c24f59ae101f1584bd9f
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/navigation/WebNav.ets
arkts
WebNav
@file 网页页面导航入口 @returns {void} 无返回值 @author Joker.X
@Builder export function WebNav(): void { WebPage(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function WebNav 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_component_statement#Left WebPage ( ) ; AST#ui_custom_component_statement#Right } AST#builder_function_body#Right AST#decorated_export_declaration#Right
@Builder export function WebNav(): void { WebPage(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/navigation/WebNav.ets#L8-L11
c55cd77aafbd29fe45950e45480095c2e357b16b
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/accessibility/AccessibilityService.ets
arkts
字体大小级别
export enum FontSizeLevel { SMALL = 'small', NORMAL = 'normal', LARGE = 'large', EXTRA_LARGE = 'extra_large', HUGE = 'huge' }
AST#export_declaration#Left export AST#enum_declaration#Left enum FontSizeLevel AST#enum_body#Left { AST#enum_member#Left SMALL = AST#expression#Left 'small' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left NORMAL = AST#expression#Left 'normal' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left LARGE = AST#expression#Left 'large' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left EXTRA_LARGE = AST#expression#Left 'extra_large' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left HUGE = AST#expression#Left 'huge' AST#expression#Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export enum FontSizeLevel { SMALL = 'small', NORMAL = 'normal', LARGE = 'large', EXTRA_LARGE = 'extra_large', HUGE = 'huge' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/accessibility/AccessibilityService.ets#L28-L34
46fb63b7ae855d4519730ba31ce10f3180a2c46f
github
xixi-cquer/BiJiDaiBan.git
206dc33a837acbe6fc837feff848427e83946534
entry/src/main/ets/viewmodel/AccountData.ets
arkts
Copyright (c) 2023 Huawei Device Co., Ltd. Licensed under the Apache License,Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
export default class AccountData { id: number = -1; title: string =''; txt: string = ''; url: string =''; }
AST#export_declaration#Left export default AST#class_declaration#Left class AccountData AST#class_body#Left { 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 AST#unary_expression#Left - AST#expression#Left 1 AST#expression#Right AST#unary_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left txt : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export default class AccountData { id: number = -1; title: string =''; txt: string = ''; url: string =''; }
https://github.com/xixi-cquer/BiJiDaiBan.git/blob/206dc33a837acbe6fc837feff848427e83946534/entry/src/main/ets/viewmodel/AccountData.ets#L16-L21
64cf463e01ca2091f5ee872bc4774411f3497959
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/accuracy/path_sensitive/loop_stmt/for_body_001_T.ets
arkts
Introduction 循环结构-body语句
export function for_body_001_T(taint_src : string) { let res = "" for (let i = 0; i < 2; i++) { res = taint_src } taint.Sink(res) }
AST#export_declaration#Left export AST#function_declaration#Left function for_body_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left res = AST#expression#Left "" AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left res = AST#expression#Left taint_src AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left taint AST#expression#Right . Sink AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left res AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
export function for_body_001_T(taint_src : string) { let res = "" for (let i = 0; i < 2; i++) { res = taint_src } taint.Sink(res) }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/path_sensitive/loop_stmt/for_body_001_T.ets#L7-L13
46ec495d49d1dc97f1105fa565faabd88030c4d5
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/SM4.ets
arkts
encryptGCM
加密(GCM模式),异步 @param data 加密或者解密的数据。data不能为null。 @param symKey 指定加密或解密的密钥。 @param gcmParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。 @param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(SM4_128|GCM|PKCS7、SM4_128|GCM|PKCS5、等) @returns
static async encryptGCM(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7'): Promise<cryptoFramework.DataBlob> { let cipher = cryptoFramework.createCipher(transformation); await cipher.init(cryptoFramework.CryptoMode.ENCRYPT_MODE, symKey, gcmParams); let encryptUpdate = await cipher.update(data); //GCM模式加密doFinal时传入空,获得tag数据,并更新至gcmParams对象中。 gcmParams.authTag = await cipher.doFinal(null); return encryptUpdate; }
AST#method_declaration#Left static async encryptGCM AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . SymKey AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left gcmParams : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . GcmParamsSpec AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left transformation : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'SM4_128|GCM|PKCS7' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left cipher = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left cryptoFramework AST#expression#Right . createCipher AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left transformation AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left cipher AST#expression#Right AST#await_expression#Right AST#expression#Right . init AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left cryptoFramework AST#expression#Right . CryptoMode AST#member_expression#Right AST#expression#Right . ENCRYPT_MODE AST#member_expression#Right AST#expression#Right , AST#expression#Left symKey AST#expression#Right , AST#expression#Left gcmParams AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left encryptUpdate = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left cipher AST#expression#Right AST#await_expression#Right AST#expression#Right . update AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left data AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //GCM模式加密doFinal时传入空,获得tag数据,并更新至gcmParams对象中。 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left gcmParams AST#expression#Right . authTag AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left cipher AST#expression#Right AST#await_expression#Right AST#expression#Right . doFinal AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left encryptUpdate AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static async encryptGCM(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7'): Promise<cryptoFramework.DataBlob> { let cipher = cryptoFramework.createCipher(transformation); await cipher.init(cryptoFramework.CryptoMode.ENCRYPT_MODE, symKey, gcmParams); let encryptUpdate = await cipher.update(data); gcmParams.authTag = await cipher.doFinal(null); return encryptUpdate; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SM4.ets#L36-L44
4860b6bec53580be93f78bb8f9894c6156c970ed
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/swipersmoothvariation/Index.ets
arkts
SwiperSmoothVariationComponent
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, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
export { SwiperSmoothVariationComponent } from './src/main/ets/pages/MainPage';
AST#export_declaration#Left export { SwiperSmoothVariationComponent } from './src/main/ets/pages/MainPage' ; AST#export_declaration#Right
export { SwiperSmoothVariationComponent } from './src/main/ets/pages/MainPage';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/swipersmoothvariation/Index.ets#L16-L16
f1040a2f2fc2b72b17cb35df28399371ff34d568
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/LazyIDataSource/BasicDataSource.ets
arkts
deleteData
删除指定index的数据
public deleteData(index: number): void { if (index < 0 || index >= this.originDataArray.length) { throw new Error("Index out of bounds"); } this.originDataArray.splice(index, 1); this.notifyDataDelete(index); }
AST#method_declaration#Left public deleteData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right < AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right >= AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "Index out of bounds" AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . splice AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right , AST#expression#Left 1 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#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 . notifyDataDelete AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public deleteData(index: number): void { if (index < 0 || index >= this.originDataArray.length) { throw new Error("Index out of bounds"); } this.originDataArray.splice(index, 1); this.notifyDataDelete(index); }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/LazyIDataSource/BasicDataSource.ets#L53-L59
5662dc8cca98366fe8cb909bc52e789503a011f5
github
buqiuz/Account.git
b843a38c24a833a9a4386f63cffec5fa5dadc674
oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/renderer/RadarChartRenderer.ets
arkts
drawDataSet
Draws the RadarDataSet @param c @param dataSet @param mostEntries the entry count of the dataset with the most entries
protected drawDataSet(c: CanvasRenderingContext2D, dataSet: IRadarDataSet, mostEntries: number): void { if (!this.mAnimator) { return; } let phaseX: number = this.mAnimator.getPhaseX(); let phaseY: number = this.mAnimator.getPhaseY(); let sliceangle: number = this.mChart.getSliceAngle(); // calculate the factor that is needed for transforming the value to // pixels let factor: number = this.mChart.getFactor() * 0.85; let center: MPPointF | null = this.mChart.getCenterOffsets(); let pOut: MPPointF = MPPointF.getInstance(0, 0); let surface: Path2D = this.mDrawDataSetSurfacePathBuffer; surface = new Path2D(); let hasMovedToPoint: boolean = false; for (let j = 0; j < dataSet.getEntryCount(); j++) { this.mRenderPaint.setColor(dataSet.getColor(j)); let e: RadarEntry = dataSet.getEntryForIndex(j); if (center) { pOut = Utils.getPosition( center, (e.getY() - this.mChart.getYChartMin()) * factor * phaseY, sliceangle * j * phaseX + this.mChart.getRotationAngle(), pOut); } if (Number.isNaN(pOut.x)) continue; if (!hasMovedToPoint) { surface.moveTo(pOut.x, pOut.y); hasMovedToPoint = true; } else surface.lineTo(pOut.x, pOut.y); } if (dataSet.getEntryCount() > mostEntries && center) { // if this is not the largest set, draw a line to the center before closing surface.lineTo(center.x, center.y); } surface.closePath(); // surface.close(); if (dataSet.isDrawFilledEnabled()) { this.drawFilledPathWithAlpha(c, surface, dataSet.getFillColor(), dataSet.getFillAlpha()); } this.mRenderPaint.setStrokeWidth(dataSet.getLineWidth()); this.mRenderPaint.setStyle(Style.STROKE); // draw the line (only if filled is disabled or alpha is below 255) if (!dataSet.isDrawFilledEnabled() || dataSet.getFillAlpha() < 255) { Utils.resetContext2DWithoutFont(c, this.mRenderPaint); c.beginPath(); c.stroke(surface); c.closePath(); } if (center) { MPPointF.recycleInstance(center); } MPPointF.recycleInstance(pOut); }
AST#method_declaration#Left protected drawDataSet AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dataSet : AST#type_annotation#Left AST#primary_type#Left IRadarDataSet AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left mostEntries : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right . mAnimator AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left phaseX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mAnimator AST#member_expression#Right AST#expression#Right . getPhaseX AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left phaseY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mAnimator AST#member_expression#Right AST#expression#Right . getPhaseY AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sliceangle : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getSliceAngle AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // calculate the factor that is needed for transforming the value to // pixels AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left factor : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getFactor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right * AST#expression#Left 0.85 AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left center : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left MPPointF AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getCenterOffsets AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left pOut : AST#type_annotation#Left AST#primary_type#Left MPPointF AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left MPPointF AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0 AST#expression#Right , AST#expression#Left 0 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left surface : AST#type_annotation#Left AST#primary_type#Left Path2D AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mDrawDataSetSurfacePathBuffer AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left surface = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Path2D AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left hasMovedToPoint : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left j = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left j AST#expression#Right < AST#expression#Left dataSet AST#expression#Right AST#binary_expression#Right AST#expression#Right . getEntryCount AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left j AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mRenderPaint AST#member_expression#Right AST#expression#Right . setColor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataSet AST#expression#Right . getColor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left j AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left e : AST#type_annotation#Left AST#primary_type#Left RadarEntry AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataSet AST#expression#Right . getEntryForIndex AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left j AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left center AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left pOut = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Utils AST#expression#Right . getPosition AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left center AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left e AST#expression#Right . getY AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right - AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getYChartMin AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right * AST#expression#Left factor AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left phaseY AST#expression#Right AST#binary_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sliceangle AST#expression#Right * AST#expression#Left j AST#expression#Right AST#binary_expression#Right AST#expression#Right * AST#expression#Left phaseX AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . mChart AST#member_expression#Right AST#expression#Right . getRotationAngle AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left pOut AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Number AST#expression#Right . isNaN AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left pOut AST#expression#Right . x AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#statement#Left AST#continue_statement#Left continue ; AST#continue_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left hasMovedToPoint AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left surface AST#expression#Right . moveTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left pOut AST#expression#Right . x AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left pOut AST#expression#Right . y AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left hasMovedToPoint = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left surface AST#expression#Right . lineTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left pOut AST#expression#Right . x AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left pOut AST#expression#Right . y AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataSet AST#expression#Right . getEntryCount AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right > AST#expression#Left mostEntries AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left center AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { // if this is not the largest set, draw a line to the center before closing AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left surface AST#expression#Right . lineTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . x AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left center AST#expression#Right . y AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left surface AST#expression#Right . closePath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // surface.close(); AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataSet AST#expression#Right . isDrawFilledEnabled AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#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 . drawFilledPathWithAlpha AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left c AST#expression#Right , AST#expression#Left surface AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataSet AST#expression#Right . getFillColor AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataSet AST#expression#Right . getFillAlpha AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mRenderPaint AST#member_expression#Right AST#expression#Right . setStrokeWidth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left dataSet AST#expression#Right . getLineWidth AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mRenderPaint AST#member_expression#Right AST#expression#Right . setStyle AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left Style AST#expression#Right . STROKE AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // draw the line (only if filled is disabled or alpha is below 255) AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left dataSet AST#expression#Right AST#unary_expression#Right AST#expression#Right . isDrawFilledEnabled AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left dataSet AST#expression#Right AST#binary_expression#Right AST#expression#Right . getFillAlpha AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right < AST#expression#Left 255 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Utils AST#expression#Right . resetContext2DWithoutFont AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left c AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mRenderPaint AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left c AST#expression#Right . beginPath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left c AST#expression#Right . stroke AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left surface AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left c AST#expression#Right . closePath AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left center AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left MPPointF AST#expression#Right . recycleInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left center AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left MPPointF AST#expression#Right . recycleInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left pOut AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
protected drawDataSet(c: CanvasRenderingContext2D, dataSet: IRadarDataSet, mostEntries: number): void { if (!this.mAnimator) { return; } let phaseX: number = this.mAnimator.getPhaseX(); let phaseY: number = this.mAnimator.getPhaseY(); let sliceangle: number = this.mChart.getSliceAngle(); let factor: number = this.mChart.getFactor() * 0.85; let center: MPPointF | null = this.mChart.getCenterOffsets(); let pOut: MPPointF = MPPointF.getInstance(0, 0); let surface: Path2D = this.mDrawDataSetSurfacePathBuffer; surface = new Path2D(); let hasMovedToPoint: boolean = false; for (let j = 0; j < dataSet.getEntryCount(); j++) { this.mRenderPaint.setColor(dataSet.getColor(j)); let e: RadarEntry = dataSet.getEntryForIndex(j); if (center) { pOut = Utils.getPosition( center, (e.getY() - this.mChart.getYChartMin()) * factor * phaseY, sliceangle * j * phaseX + this.mChart.getRotationAngle(), pOut); } if (Number.isNaN(pOut.x)) continue; if (!hasMovedToPoint) { surface.moveTo(pOut.x, pOut.y); hasMovedToPoint = true; } else surface.lineTo(pOut.x, pOut.y); } if (dataSet.getEntryCount() > mostEntries && center) { surface.lineTo(center.x, center.y); } surface.closePath(); if (dataSet.isDrawFilledEnabled()) { this.drawFilledPathWithAlpha(c, surface, dataSet.getFillColor(), dataSet.getFillAlpha()); } this.mRenderPaint.setStrokeWidth(dataSet.getLineWidth()); this.mRenderPaint.setStyle(Style.STROKE); if (!dataSet.isDrawFilledEnabled() || dataSet.getFillAlpha() < 255) { Utils.resetContext2DWithoutFont(c, this.mRenderPaint); c.beginPath(); c.stroke(surface); c.closePath(); } if (center) { MPPointF.recycleInstance(center); } MPPointF.recycleInstance(pOut); }
https://github.com/buqiuz/Account.git/blob/b843a38c24a833a9a4386f63cffec5fa5dadc674/oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/renderer/RadarChartRenderer.ets#L93-L164
ce9821a3d57b92b7f304aacb8b8c5041ed0a469f
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/constants/LayoutPercent.ets
arkts
15% 百分比
export const P15: string = "15%";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left P15 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "15%" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const P15: string = "15%";
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/constants/LayoutPercent.ets#L24-L24
2f3a88552d77b5be813c5619619f06a512991b42
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/FileManagement/MediaCollections/entry/src/main/ets/model/JsonListData.ets
arkts
样例数据
export interface samplesData { name: string, uri: string, drm_scheme: string, drm_license_url: string, }
AST#export_declaration#Left export AST#interface_declaration#Left interface samplesData AST#object_type#Left { AST#type_member#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , AST#type_member#Left uri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , AST#type_member#Left drm_scheme : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , AST#type_member#Left drm_license_url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface samplesData { name: string, uri: string, drm_scheme: string, drm_license_url: string, }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/FileManagement/MediaCollections/entry/src/main/ets/model/JsonListData.ets#L19-L24
d9f3ec049707184e91808dfed28616aac562227f
gitee
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/NormalQuestionPage.ets
arkts
renderDropdown
渲染单个下拉框组件
@Builder renderDropdown(title: string, options: Array<string>, index: number) { Column({ space: 3 }) { Row() { Text(title) .fontSize(16) .padding(12) //.width('100%') .height(40) //.backgroundColor('#F5F5F5') .borderRadius(8); Image(this.expandedIndex === index ? $r('app.media.arrow_up') : $r('app.media.arrow_down')) .width(16) .height(16) //.margin({ right: 12 }); } .justifyContent(FlexAlign.SpaceBetween) .backgroundColor('#FEFEFE') .height(60) .width('100%') .onClick(() => { // 点击切换展开/收起状态 animateTo({ duration: 200, // 动画持续时间 }, () => { if (this.expandedIndex === index) { this.expandedIndex = -1; // 收起自己 } else { this.expandedIndex = index; // 展开自己,其他自动关闭 } }); }); // 显示选项列表 if (this.expandedIndex === index) { List() { ForEach(options, (option: string) => { ListItem() { Text(option) .fontSize(16) .padding(12) .width('100%') .onClick(() => { // 可以在这里设置选中值等操作 console.info(`选择了:${option}`); this.expandedIndex = -1; // 选择后关闭 }); }; }); } .width('100%') .height(120) .backgroundColor('#EEF7FE') .borderRadius(8) .margin({ top: 4 }) .shadow({ radius: 4 }); } } .width('100%'); }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right renderDropdown AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , 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#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 3 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left title AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left 12 AST#expression#Right ) //.width('100%') AST#modifier_chain_expression#Left . height ( AST#expression#Left 40 AST#expression#Right ) //.backgroundColor('#F5F5F5') AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 8 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left AST#conditional_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . expandedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.arrow_up' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.arrow_down' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#conditional_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right //.margin({ right: 12 }); } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . justifyContent ( AST#expression#Left AST#member_expression#Left AST#expression#Left FlexAlign AST#expression#Right . SpaceBetween AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#FEFEFE' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 60 AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { // 点击切换展开/收起状态 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left animateTo AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left duration AST#property_name#Right : AST#expression#Left 200 AST#expression#Right AST#property_assignment#Right , // 动画持续时间 } AST#object_literal#Right AST#expression#Right , AST#expression#Left AST#arrow_function#Left 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 . expandedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . expandedIndex AST#member_expression#Right = AST#expression#Left AST#unary_expression#Left - AST#expression#Left 1 AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 收起自己 } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . expandedIndex AST#member_expression#Right = AST#expression#Left index AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 展开自己,其他自动关闭 } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#expression_statement#Left AST#expression#Left AST#expression#Right ; AST#expression_statement#Right // 显示选项列表 AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . expandedIndex AST#member_expression#Right AST#expression#Right === AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left List ( ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#for_each_statement#Left ForEach ( AST#expression#Left options AST#expression#Right , AST#ui_builder_arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left option : 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#ui_arrow_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ListItem ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left option AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { // 可以在这里设置选中值等操作 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` 选择了: AST#template_substitution#Left $ { AST#expression#Left option AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . expandedIndex AST#member_expression#Right = AST#expression#Left AST#unary_expression#Left - AST#expression#Left 1 AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 选择后关闭 } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#ui_arrow_function_body#Right AST#ui_builder_arrow_function#Right ) AST#for_each_statement#Right AST#ui_control_flow#Right AST#ERROR#Left ; AST#ERROR#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 120 AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#EEF7FE' AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 8 AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left 4 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . shadow ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left radius AST#property_name#Right : AST#expression#Left 4 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ; AST#ERROR#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder renderDropdown(title: string, options: Array<string>, index: number) { Column({ space: 3 }) { Row() { Text(title) .fontSize(16) .padding(12) .height(40) .borderRadius(8); Image(this.expandedIndex === index ? $r('app.media.arrow_up') : $r('app.media.arrow_down')) .width(16) .height(16) } .justifyContent(FlexAlign.SpaceBetween) .backgroundColor('#FEFEFE') .height(60) .width('100%') .onClick(() => { animateTo({ duration: 200, }, () => { if (this.expandedIndex === index) { this.expandedIndex = -1; } else { this.expandedIndex = index; } }); }); if (this.expandedIndex === index) { List() { ForEach(options, (option: string) => { ListItem() { Text(option) .fontSize(16) .padding(12) .width('100%') .onClick(() => { console.info(`选择了:${option}`); this.expandedIndex = -1; }); }; }); } .width('100%') .height(120) .backgroundColor('#EEF7FE') .borderRadius(8) .margin({ top: 4 }) .shadow({ radius: 4 }); } } .width('100%'); }
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/NormalQuestionPage.ets#L73-L133
ff29cc04476036564550369890bd2cbc5d6ae5cb
github
L1rics06/arkTS-.git
991fd131bfdb11e2933152133c97453d86092ac0
entry/src/main/ets/pages/NetworkUtil.ets
arkts
头像上传返回数据
export interface AvatarResponse { compressUrl: string; url: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface AvatarResponse AST#object_type#Left { AST#type_member#Left compressUrl : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface AvatarResponse { compressUrl: string; url: string; }
https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L78-L81
b0db7cefb591cc14e50e92078d9efe0b5e074a76
github
chongzi/Lucky-ArkTs.git
84fc104d4a68def780a483e2543ebf9f53e793fd
entry/src/main/ets/model/InterviewRecordModel.ets
arkts
getOfferStatusText
获取Offer状态显示文本
getOfferStatusText(): string { switch (this.offerStatus) { case OfferStatus.NO_OFFER: return '无offer'; case OfferStatus.PENDING: return 'offer待定'; case OfferStatus.RECEIVED: return '已收到offer'; case OfferStatus.ACCEPTED: return '已接受offer'; case OfferStatus.REJECTED: return '已拒绝offer'; default: return '未知'; } }
AST#method_declaration#Left getOfferStatusText 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#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left switch ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . offerStatus AST#member_expression#Right AST#expression#Right ) AST#container_content_body#Left { AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left OfferStatus AST#expression#Right . NO_OFFER AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '无offer' AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left OfferStatus AST#expression#Right . PENDING AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left 'offer待定' AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left OfferStatus AST#expression#Right . RECEIVED AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '已收到offer' AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left OfferStatus AST#expression#Right . ACCEPTED AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '已接受offer' AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left OfferStatus AST#expression#Right . REJECTED AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '已拒绝offer' AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left default AST#expression#Right AST#expression_statement#Right AST#ERROR#Left : return AST#ERROR#Right AST#expression_statement#Left AST#expression#Left '未知' AST#expression#Right ; AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
getOfferStatusText(): string { switch (this.offerStatus) { case OfferStatus.NO_OFFER: return '无offer'; case OfferStatus.PENDING: return 'offer待定'; case OfferStatus.RECEIVED: return '已收到offer'; case OfferStatus.ACCEPTED: return '已接受offer'; case OfferStatus.REJECTED: return '已拒绝offer'; default: return '未知'; } }
https://github.com/chongzi/Lucky-ArkTs.git/blob/84fc104d4a68def780a483e2543ebf9f53e793fd/entry/src/main/ets/model/InterviewRecordModel.ets#L141-L156
9b2ee92084e444d24c2fef15bbbd484de4c088a7
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/component/TextInputDialogView.ets
arkts
TextInputDialogView
TODO TextInputDialog组件 author: 桃花镇童长老ᥫ᭡ since: 2024/08/01
@Component export struct TextInputDialogView { private controller: TextInputController = new TextInputController(); @Prop options: TextInputOptions; @State customOptions: BaseContentOptions | undefined = undefined; @State modifier: TextInputModifier = new TextInputModifier(); @State text: string = ''; @State showPassword: boolean = false; //是否显示密码 @State cancelButton: CancelButtonOptions = { style: CancelButtonStyle.INPUT, icon: { size: '16vp', color: '#99ffffff', src: '' } }; //右侧清除按钮样式 @StorageProp(DialogThemeColorMode) themeColorMode: ThemeColorMode = this.options.themeColorMode ?? ThemeColorMode.SYSTEM; //设置深色浅色,默认跟随系统。 aboutToAppear(): void { this.text = this.options.text ?? ""; this.modifier.inputFilter = this.options.inputFilter; this.showPassword = this.options.showPassword ?? false; if (this.options.cancelButton) { this.cancelButton = this.options.cancelButton; } this.customOptions = (this.options as BaseContentOptions); this.customOptions.contentBuilder = () => { this.InputBuilder() } CacheHelper.put(`${CacheHelper.CACHE_LABEL}${this.options.dialogId ?? ""}`, this.text); } build() { if (this.themeColorMode === ThemeColorMode.LIGHT) { WithTheme({ colorMode: ThemeColorMode.LIGHT }) { CustomContentDialog(this.customOptions) .height(this.options.height) .width(this.options.width) .constraintSize({ maxWidth: this.options.maxWidth, maxHeight: this.options.maxHeight }) .backgroundColor(this.options.backgroundColor) .backgroundBlurStyle(this.options.backgroundBlurStyle) .borderRadius(this.options.cornerRadius) .borderWidth(this.options.borderWidth) .borderColor(this.options.borderColor) .borderStyle(this.options.borderStyle) .clip(true) } } else if (this.themeColorMode === ThemeColorMode.DARK) { WithTheme({ colorMode: ThemeColorMode.DARK }) { CustomContentDialog(this.customOptions) .height(this.options.height) .width(this.options.width) .constraintSize({ maxWidth: this.options.maxWidth, maxHeight: this.options.maxHeight }) .backgroundColor(this.options.backgroundColor) .backgroundBlurStyle(this.options.backgroundBlurStyle) .borderRadius(this.options.cornerRadius) .borderWidth(this.options.borderWidth) .borderColor(this.options.borderColor) .borderStyle(this.options.borderStyle) .clip(true) } } else { CustomContentDialog(this.customOptions) .height(this.options.height) .width(this.options.width) .constraintSize({ maxWidth: this.options.maxWidth, maxHeight: this.options.maxHeight }) .backgroundColor(this.options.backgroundColor) .backgroundBlurStyle(this.options.backgroundBlurStyle) .borderRadius(this.options.cornerRadius) .borderWidth(this.options.borderWidth) .borderColor(this.options.borderColor) .borderStyle(this.options.borderStyle) .clip(true) } } @Builder InputBuilder() { WithTheme({ colorMode: this.themeColorMode }) { TextInput({ controller: this.controller, text: $$this.text, placeholder: this.options.placeholder ?? '请输入' }) .type(this.options.inputType ?? InputType.Normal) .showPassword(this.showPassword) .showPasswordIcon(this.options.showPasswordIcon) .passwordIcon(this.options.passwordIcon) .passwordRules(this.options.passwordRules) .cancelButton(this.cancelButton) .defaultFocus(this.options.defaultFocus) .fontColor(this.options.fontColor) .fontSize(this.options.fontSize) .placeholderColor(this.options.placeholderColor) .backgroundColor(this.options.inputBackgroundColor) .border(this.options.inputBorder) .maxLength(this.options.maxLength == 0 ? Infinity : this.options.maxLength) .height(this.options.inputHeight) .attributeModifier(this.modifier) .onChange((value: string, previewText?: PreviewText) => { CacheHelper.put(`${CacheHelper.CACHE_LABEL}${this.options.dialogId ?? ""}`, value ?? ""); if (this.options.onChange) { this.options.onChange(value); } }) .onSecurityStateChange(show => { this.showPassword = show; }) } } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TextInputDialogView AST#component_body#Left { AST#property_declaration#Left private controller : AST#type_annotation#Left AST#primary_type#Left TextInputController AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TextInputController AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right options : AST#type_annotation#Left AST#primary_type#Left TextInputOptions AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right customOptions : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left BaseContentOptions AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left undefined AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right modifier : AST#type_annotation#Left AST#primary_type#Left TextInputModifier AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left TextInputModifier AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right showPassword : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#property_declaration#Right //是否显示密码 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right cancelButton : AST#type_annotation#Left AST#primary_type#Left CancelButtonOptions AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left style AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left CancelButtonStyle AST#expression#Right . INPUT AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left icon AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left size AST#property_name#Right : AST#expression#Left '16vp' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left color AST#property_name#Right : AST#expression#Left '#99ffffff' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left src AST#property_name#Right : AST#expression#Left '' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ; AST#property_declaration#Right //右侧清除按钮样式 AST#property_declaration#Left AST#decorator#Left @ StorageProp ( AST#expression#Left DialogThemeColorMode AST#expression#Right ) AST#decorator#Right themeColorMode : AST#type_annotation#Left AST#primary_type#Left ThemeColorMode AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . themeColorMode AST#member_expression#Right AST#expression#Right ?? AST#expression#Left ThemeColorMode AST#expression#Right AST#binary_expression#Right AST#expression#Right . SYSTEM AST#member_expression#Right AST#expression#Right ; AST#property_declaration#Right //设置深色浅色,默认跟随系统。 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#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . text AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . text AST#member_expression#Right AST#expression#Right ?? AST#expression#Left "" AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . modifier AST#member_expression#Right AST#expression#Right . inputFilter AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . inputFilter AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . showPassword AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . showPassword AST#member_expression#Right AST#expression#Right ?? AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . cancelButton AST#member_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cancelButton AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . cancelButton AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customOptions AST#member_expression#Right = AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left BaseContentOptions AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customOptions AST#member_expression#Right AST#expression#Right . contentBuilder AST#member_expression#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#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 . InputBuilder AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CacheHelper AST#expression#Right . put AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left CacheHelper AST#expression#Right . CACHE_LABEL AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right AST#template_substitution#Left $ { AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . dialogId AST#member_expression#Right AST#expression#Right ?? AST#expression#Left "" AST#expression#Right AST#binary_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . text AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right AST#build_method#Left build ( ) AST#build_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . themeColorMode AST#member_expression#Right AST#expression#Right === AST#expression#Left ThemeColorMode AST#expression#Right AST#binary_expression#Right AST#expression#Right . LIGHT AST#member_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left WithTheme ( AST#component_parameters#Left { AST#component_parameter#Left colorMode : AST#expression#Left AST#member_expression#Left AST#expression#Left ThemeColorMode AST#expression#Right . LIGHT AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left CustomContentDialog ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customOptions AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . constraintSize ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left maxWidth AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . maxWidth AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left maxHeight AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . maxHeight AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . backgroundColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundBlurStyle ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . backgroundBlurStyle AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . cornerRadius AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderWidth ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderWidth AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderStyle ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderStyle AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . clip ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } else AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . themeColorMode AST#member_expression#Right AST#expression#Right === AST#expression#Left ThemeColorMode AST#expression#Right AST#binary_expression#Right AST#expression#Right . DARK AST#member_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left WithTheme ( AST#component_parameters#Left { AST#component_parameter#Left colorMode : AST#expression#Left AST#member_expression#Left AST#expression#Left ThemeColorMode AST#expression#Right . DARK AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left CustomContentDialog ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customOptions AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . constraintSize ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left maxWidth AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . maxWidth AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left maxHeight AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . maxHeight AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . backgroundColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundBlurStyle ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . backgroundBlurStyle AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . cornerRadius AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderWidth ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderWidth AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderStyle ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderStyle AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . clip ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } else { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left CustomContentDialog ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . customOptions AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . height AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . width AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . constraintSize ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left maxWidth AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . maxWidth AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left maxHeight AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . maxHeight AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . backgroundColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundBlurStyle ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . backgroundBlurStyle AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . cornerRadius AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderWidth ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderWidth AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderStyle ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . borderStyle AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . clip ( AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_if_statement#Right AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#build_body#Right AST#build_method#Right AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right InputBuilder 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 WithTheme ( AST#component_parameters#Left { AST#component_parameter#Left colorMode : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . themeColorMode AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left TextInput ( AST#component_parameters#Left { AST#component_parameter#Left controller : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . controller AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left text : AST#expression#Left AST#member_expression#Left AST#expression#Left $$this AST#expression#Right . text AST#member_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left placeholder : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . placeholder AST#member_expression#Right AST#expression#Right ?? AST#expression#Left '请输入' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . type ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . inputType AST#member_expression#Right AST#expression#Right ?? AST#expression#Left InputType AST#expression#Right AST#binary_expression#Right AST#expression#Right . Normal AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . showPassword ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . showPassword AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . showPasswordIcon ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . showPasswordIcon AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . passwordIcon ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . passwordIcon AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . passwordRules ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . passwordRules AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . cancelButton ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . cancelButton AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . defaultFocus ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . defaultFocus AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . fontColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . fontSize AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . placeholderColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . placeholderColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . inputBackgroundColor AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . border ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . inputBorder AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . maxLength AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#ERROR#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . maxLength AST#member_expression#Right AST#expression#Right == AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ? AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Infinity AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left this . options . maxLength AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right ) AST#ERROR#Right . height AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . inputHeight AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . attributeModifier AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . modifier AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . onChange AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left 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#Left previewText ? : AST#type_annotation#Left AST#primary_type#Left PreviewText AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CacheHelper AST#expression#Right . put AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left CacheHelper AST#expression#Right . CACHE_LABEL AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right AST#template_substitution#Left $ { AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . dialogId AST#member_expression#Right AST#expression#Right ?? AST#expression#Left "" AST#expression#Right AST#binary_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right , AST#expression#Left AST#binary_expression#Left AST#expression#Left value AST#expression#Right ?? AST#expression#Left "" AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . onChange AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . options AST#member_expression#Right AST#expression#Right . onChange AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . onSecurityStateChange AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left show => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . showPassword AST#member_expression#Right = AST#expression#Left show AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#ERROR#Right } AST#container_content_body#Right AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right } AST#component_body#Right AST#decorated_export_declaration#Right
@Component export struct TextInputDialogView { private controller: TextInputController = new TextInputController(); @Prop options: TextInputOptions; @State customOptions: BaseContentOptions | undefined = undefined; @State modifier: TextInputModifier = new TextInputModifier(); @State text: string = ''; @State showPassword: boolean = false; @State cancelButton: CancelButtonOptions = { style: CancelButtonStyle.INPUT, icon: { size: '16vp', color: '#99ffffff', src: '' } }; @StorageProp(DialogThemeColorMode) themeColorMode: ThemeColorMode = this.options.themeColorMode ?? ThemeColorMode.SYSTEM; aboutToAppear(): void { this.text = this.options.text ?? ""; this.modifier.inputFilter = this.options.inputFilter; this.showPassword = this.options.showPassword ?? false; if (this.options.cancelButton) { this.cancelButton = this.options.cancelButton; } this.customOptions = (this.options as BaseContentOptions); this.customOptions.contentBuilder = () => { this.InputBuilder() } CacheHelper.put(`${CacheHelper.CACHE_LABEL}${this.options.dialogId ?? ""}`, this.text); } build() { if (this.themeColorMode === ThemeColorMode.LIGHT) { WithTheme({ colorMode: ThemeColorMode.LIGHT }) { CustomContentDialog(this.customOptions) .height(this.options.height) .width(this.options.width) .constraintSize({ maxWidth: this.options.maxWidth, maxHeight: this.options.maxHeight }) .backgroundColor(this.options.backgroundColor) .backgroundBlurStyle(this.options.backgroundBlurStyle) .borderRadius(this.options.cornerRadius) .borderWidth(this.options.borderWidth) .borderColor(this.options.borderColor) .borderStyle(this.options.borderStyle) .clip(true) } } else if (this.themeColorMode === ThemeColorMode.DARK) { WithTheme({ colorMode: ThemeColorMode.DARK }) { CustomContentDialog(this.customOptions) .height(this.options.height) .width(this.options.width) .constraintSize({ maxWidth: this.options.maxWidth, maxHeight: this.options.maxHeight }) .backgroundColor(this.options.backgroundColor) .backgroundBlurStyle(this.options.backgroundBlurStyle) .borderRadius(this.options.cornerRadius) .borderWidth(this.options.borderWidth) .borderColor(this.options.borderColor) .borderStyle(this.options.borderStyle) .clip(true) } } else { CustomContentDialog(this.customOptions) .height(this.options.height) .width(this.options.width) .constraintSize({ maxWidth: this.options.maxWidth, maxHeight: this.options.maxHeight }) .backgroundColor(this.options.backgroundColor) .backgroundBlurStyle(this.options.backgroundBlurStyle) .borderRadius(this.options.cornerRadius) .borderWidth(this.options.borderWidth) .borderColor(this.options.borderColor) .borderStyle(this.options.borderStyle) .clip(true) } } @Builder InputBuilder() { WithTheme({ colorMode: this.themeColorMode }) { TextInput({ controller: this.controller, text: $$this.text, placeholder: this.options.placeholder ?? '请输入' }) .type(this.options.inputType ?? InputType.Normal) .showPassword(this.showPassword) .showPasswordIcon(this.options.showPasswordIcon) .passwordIcon(this.options.passwordIcon) .passwordRules(this.options.passwordRules) .cancelButton(this.cancelButton) .defaultFocus(this.options.defaultFocus) .fontColor(this.options.fontColor) .fontSize(this.options.fontSize) .placeholderColor(this.options.placeholderColor) .backgroundColor(this.options.inputBackgroundColor) .border(this.options.inputBorder) .maxLength(this.options.maxLength == 0 ? Infinity : this.options.maxLength) .height(this.options.inputHeight) .attributeModifier(this.modifier) .onChange((value: string, previewText?: PreviewText) => { CacheHelper.put(`${CacheHelper.CACHE_LABEL}${this.options.dialogId ?? ""}`, value ?? ""); if (this.options.onChange) { this.options.onChange(value); } }) .onSecurityStateChange(show => { this.showPassword = show; }) } } }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/component/TextInputDialogView.ets#L29-L136
accdd20b7fa60b9454c21e86e5b9da1bf5e63ba1
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/Index.ets
arkts
loadThemeSettings
加载主题设置
private async loadThemeSettings(): Promise<void> { try { this.themeSettings = await this.settingsService.getThemeSettings(); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to load theme settings: ${error}`); } }
AST#method_declaration#Left private async loadThemeSettings 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#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . themeSettings AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . settingsService AST#member_expression#Right AST#expression#Right . getThemeSettings AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to load theme settings: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private async loadThemeSettings(): Promise<void> { try { this.themeSettings = await this.settingsService.getThemeSettings(); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to load theme settings: ${error}`); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/Index.ets#L59-L65
6e4ca3edca317306f7243e42039f24784e80293a
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ar/ARCardService.ets
arkts
captureARScreenshot
截取AR截图
async captureARScreenshot(): Promise<string> { try { const outputPath = `/data/storage/el2/base/cache/ar_screenshot_${Date.now()}.png`; await this.captureFrame(outputPath); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `AR screenshot captured: ${outputPath}`); return outputPath; } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to capture AR screenshot: ${error}`); throw error; } }
AST#method_declaration#Left async captureARScreenshot AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left outputPath = AST#expression#Left AST#template_literal#Left ` /data/storage/el2/base/cache/ar_screenshot_ AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Date AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right .png ` AST#template_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . captureFrame AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left outputPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` AR screenshot captured: AST#template_substitution#Left $ { AST#expression#Left outputPath AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left outputPath AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to capture AR screenshot: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#throw_statement#Left throw AST#expression#Left error AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async captureARScreenshot(): Promise<string> { try { const outputPath = `/data/storage/el2/base/cache/ar_screenshot_${Date.now()}.png`; await this.captureFrame(outputPath); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `AR screenshot captured: ${outputPath}`); return outputPath; } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to capture AR screenshot: ${error}`); throw error; } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L523-L538
eb8e8b5d7075be3e33216ef151ba8dfafc1f2cb8
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/FavoritesService.ets
arkts
saveData
保存数据
private async saveData(): Promise<void> { // 这里可以实现数据持久化 hilog.debug(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Data saved to storage'); }
AST#method_declaration#Left private async saveData 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#Right AST#generic_type#Right 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#member_expression#Left AST#expression#Left hilog AST#expression#Right . debug AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left 'Data saved to storage' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
private async saveData(): Promise<void> { hilog.debug(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Data saved to storage'); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/FavoritesService.ets#L476-L479
0e13f0c802a75a6d49135c3231110605e2ba1c93
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/storage/PreferencesService.ets
arkts
putBatch
批量设置值 @param data 键值对对象
async putBatch(data: Record<string, preferences.ValueType>): Promise<void> { try { this.checkInitialized(); const promises: Promise<void>[] = []; const dataEntries: [string, preferences.ValueType][] = Object.entries(data); for (let i = 0; i < dataEntries.length; i++) { const key = dataEntries[i][0]; const value: preferences.ValueType = dataEntries[i][1]; promises.push(this.dataPreferences!.put(key, value)); } await Promise.all(promises); await this.dataPreferences!.flush(); } catch (error) { const businessError = error as BusinessError; hilog.error(0x0001, 'BirthdayReminder', `Failed to put batch: ${businessError.message}`); throw new Error(businessError.message); } }
AST#method_declaration#Left async putBatch AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left preferences . ValueType AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left 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#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#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 . checkInitialized AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left promises : AST#ERROR#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#Right AST#generic_type#Right AST#primary_type#Right AST#ERROR#Right AST#type_annotation#Left AST#primary_type#Left AST#tuple_type#Left [ ] AST#tuple_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left dataEntries : AST#ERROR#Left AST#primary_type#Left AST#tuple_type#Left [ AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left preferences . ValueType AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right ] AST#tuple_type#Right AST#primary_type#Right AST#ERROR#Right AST#type_annotation#Left AST#primary_type#Left AST#tuple_type#Left [ ] AST#tuple_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Object AST#expression#Right . entries AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left data AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left dataEntries AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left key = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left dataEntries AST#expression#Right [ AST#expression#Left i AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left value : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left preferences . ValueType AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left dataEntries AST#expression#Right [ AST#expression#Left i AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promises AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dataPreferences AST#member_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right . put AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left key AST#expression#Right , AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left Promise AST#expression#Right AST#await_expression#Right AST#expression#Right . all AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left promises AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . dataPreferences AST#member_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right . flush AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left businessError = AST#expression#Left AST#as_expression#Left AST#expression#Left error AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0001 AST#expression#Right , AST#expression#Left 'BirthdayReminder' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to put batch: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left businessError AST#expression#Right . message AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left businessError AST#expression#Right . message AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async putBatch(data: Record<string, preferences.ValueType>): Promise<void> { try { this.checkInitialized(); const promises: Promise<void>[] = []; const dataEntries: [string, preferences.ValueType][] = Object.entries(data); for (let i = 0; i < dataEntries.length; i++) { const key = dataEntries[i][0]; const value: preferences.ValueType = dataEntries[i][1]; promises.push(this.dataPreferences!.put(key, value)); } await Promise.all(promises); await this.dataPreferences!.flush(); } catch (error) { const businessError = error as BusinessError; hilog.error(0x0001, 'BirthdayReminder', `Failed to put batch: ${businessError.message}`); throw new Error(businessError.message); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/storage/PreferencesService.ets#L300-L319
0ac91cb69bbdce13c6f40411977d6e0b4d94be92
github
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
feature/ota/src/main/ets/manager/OtaUpdateManager.ets
arkts
getOtaStatus
取升级状态 @return resolve 状态/reject 错误信息
async getOtaStatus(): Promise<UpgradeData<OtaStatus>> { return new Promise((resolve, reject) => { this.updateManager.getOtaStatus().then((result: UpgradeData<OtaStatus>) => { if (result?.callResult === UpgradeCallResult.OK) { this.refreshState(result?.data); } resolve(result); }); }); }
AST#method_declaration#Left async getOtaStatus 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 UpgradeData AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left OtaStatus AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right 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_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Promise AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left resolve AST#parameter#Right , AST#parameter#Left reject AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . updateManager AST#member_expression#Right AST#expression#Right . getOtaStatus AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . then AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left result : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left UpgradeData AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left OtaStatus AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right ?. callResult AST#member_expression#Right AST#expression#Right === AST#expression#Left UpgradeCallResult AST#expression#Right AST#binary_expression#Right AST#expression#Right . OK AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#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 . refreshState AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right ?. data AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left resolve AST#expression#Right AST#argument_list#Left ( AST#expression#Left result AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async getOtaStatus(): Promise<UpgradeData<OtaStatus>> { return new Promise((resolve, reject) => { this.updateManager.getOtaStatus().then((result: UpgradeData<OtaStatus>) => { if (result?.callResult === UpgradeCallResult.OK) { this.refreshState(result?.data); } resolve(result); }); }); }
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/manager/OtaUpdateManager.ets#L76-L85
b303fced6ed9a4d04cac512c64807275a34b91ab
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/ArkTSComponents/entry/src/main/ets/viewmodel/MainViewModel.ets
arkts
Binds data to components and provides interfaces.
export class MainViewModel { /** * Get swiper image data. * * @return {Array<Resource>} swiperImages. */ getSwiperImages(): Array<Resource> { let swiperImages: Resource[] = [ $r('app.media.fig1'), $r('app.media.fig2'), $r('app.media.fig3'), $r('app.media.fig4') ]; return swiperImages; } /** * 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.string.shopping_cart'), $r('app.media.shopping')), new ItemData($r('app.string.my_goal'), $r('app.media.target')), new ItemData($r('app.string.group'), $r('app.media.circle')), new ItemData($r('app.string.favorites'), $r('app.media.favorite')), new ItemData($r('app.string.recycle_bin'), $r('app.media.recycle')) ]; return firstGridData; } /** * Get data of the second grid. * * @return {Array<PageResource>} secondGridData. */ getSecondGridData(): Array<ItemData> { let secondGridData: ItemData[] = [ new ItemData($r('app.string.mainPage_top'), $r('app.media.top'), $r('app.string.mainPage_text_top')), new ItemData($r('app.string.mainPage_new'), $r('app.media.new'), $r('app.string.mainPage_text_new')), new ItemData($r('app.string.mainPage_brand'), $r('app.media.brand'), $r('app.string.mainPage_text_brand')), new ItemData($r('app.string.mainPage_found'), $r('app.media.found'), $r('app.string.mainPage_text_found')) ]; return secondGridData; } /** * Get data of the setting list. * * @return {Array<PageResource>} settingListData. */ getSettingListData(): Array<ItemData> { let settingListData: ItemData[] = [ new ItemData($r('app.string.setting_list_news'), $r("app.media.news"), $r("app.string.setting_toggle")), new ItemData($r('app.string.setting_list_data'), $r("app.media.data")), new ItemData($r('app.string.setting_list_menu'), $r("app.media.menu")), new ItemData($r('app.string.setting_list_about'), $r("app.media.about")), new ItemData($r('app.string.setting_list_storage'), $r("app.media.storage")), new ItemData($r('app.string.setting_list_privacy'), $r("app.media.privacy")) ]; return settingListData; } }
AST#export_declaration#Left export AST#class_declaration#Left class MainViewModel AST#class_body#Left { /** * Get swiper image data. * * @return {Array<Resource>} swiperImages. */ AST#method_declaration#Left getSwiperImages 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 Resource AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left swiperImages : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Resource [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.fig1' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.fig2' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.fig3' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.fig4' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left swiperImages AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * Get data of the first grid. * * @return {Array<PageResource>} firstGridData. */ 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_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left firstGridData : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ItemData [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.my_love' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.love' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.history_record' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.record' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.message' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.message' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.shopping_cart' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.shopping' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.my_goal' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.target' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.group' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.circle' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.favorites' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.favorite' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.recycle_bin' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.recycle' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left firstGridData AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * Get data of the second grid. * * @return {Array<PageResource>} secondGridData. */ AST#method_declaration#Left getSecondGridData 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_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left secondGridData : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ItemData [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.mainPage_top' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.top' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.mainPage_text_top' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.mainPage_new' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.new' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.mainPage_text_new' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.mainPage_brand' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.brand' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.mainPage_text_brand' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.mainPage_found' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.media.found' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.mainPage_text_found' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left secondGridData AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * Get data of the setting list. * * @return {Array<PageResource>} settingListData. */ AST#method_declaration#Left getSettingListData 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_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left settingListData : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ItemData [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.setting_list_news' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.news" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.setting_toggle" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.setting_list_data' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.data" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.setting_list_menu' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.menu" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.setting_list_about' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.about" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.setting_list_storage' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.storage" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ItemData AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.setting_list_privacy' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right , AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.media.privacy" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left settingListData AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class MainViewModel { getSwiperImages(): Array<Resource> { let swiperImages: Resource[] = [ $r('app.media.fig1'), $r('app.media.fig2'), $r('app.media.fig3'), $r('app.media.fig4') ]; return swiperImages; } 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.string.shopping_cart'), $r('app.media.shopping')), new ItemData($r('app.string.my_goal'), $r('app.media.target')), new ItemData($r('app.string.group'), $r('app.media.circle')), new ItemData($r('app.string.favorites'), $r('app.media.favorite')), new ItemData($r('app.string.recycle_bin'), $r('app.media.recycle')) ]; return firstGridData; } getSecondGridData(): Array<ItemData> { let secondGridData: ItemData[] = [ new ItemData($r('app.string.mainPage_top'), $r('app.media.top'), $r('app.string.mainPage_text_top')), new ItemData($r('app.string.mainPage_new'), $r('app.media.new'), $r('app.string.mainPage_text_new')), new ItemData($r('app.string.mainPage_brand'), $r('app.media.brand'), $r('app.string.mainPage_text_brand')), new ItemData($r('app.string.mainPage_found'), $r('app.media.found'), $r('app.string.mainPage_text_found')) ]; return secondGridData; } getSettingListData(): Array<ItemData> { let settingListData: ItemData[] = [ new ItemData($r('app.string.setting_list_news'), $r("app.media.news"), $r("app.string.setting_toggle")), new ItemData($r('app.string.setting_list_data'), $r("app.media.data")), new ItemData($r('app.string.setting_list_menu'), $r("app.media.menu")), new ItemData($r('app.string.setting_list_about'), $r("app.media.about")), new ItemData($r('app.string.setting_list_storage'), $r("app.media.storage")), new ItemData($r('app.string.setting_list_privacy'), $r("app.media.privacy")) ]; return settingListData; } }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/ArkTSComponents/entry/src/main/ets/viewmodel/MainViewModel.ets#L21-L90
b000a994ad541e2d12cd96258dd29b4a5aebb998
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/media/VoiceService.ets
arkts
parseVoiceCommand
解析语音命令
parseVoiceCommand(recognizedText: string): VoiceCommand[] { const commands: VoiceCommand[] = []; const text = recognizedText.toLowerCase(); // 添加联系人命令 if (text.includes('添加联系人') || text.includes('新增联系人')) { // 提取姓名 const nameMatch = text.match(/添加联系人\s*(.+)|新增联系人\s*(.+)/); const name = nameMatch ? (nameMatch[1] || nameMatch[2]).trim() : ''; commands.push({ command: '添加联系人', action: 'addContact', params: { name }, confidence: 0.9 }); } // 查看生日命令 if (text.includes('查看') && (text.includes('生日') || text.includes('寿星'))) { if (text.includes('今天') || text.includes('今日')) { commands.push({ command: '查看今天生日', action: 'viewTodayBirthdays', confidence: 0.9 }); } else if (text.includes('本周') || text.includes('这周')) { commands.push({ command: '查看本周生日', action: 'viewWeekBirthdays', confidence: 0.8 }); } } // 发送祝福命令 if (text.includes('发送祝福') || text.includes('送祝福') || text.includes('祝福')) { const nameMatch = text.match(/(?:给|为)\s*(.+?)\s*(?:发送祝福|送祝福|祝福)/); const name = nameMatch ? nameMatch[1].trim() : ''; commands.push({ command: '发送祝福', action: 'sendGreeting', params: { name }, confidence: 0.8 }); } // 打开日历命令 if (text.includes('打开日历') || text.includes('查看日历')) { commands.push({ command: '打开日历', action: 'openCalendar', confidence: 0.9 }); } return commands; }
AST#method_declaration#Left parseVoiceCommand AST#parameter_list#Left ( AST#parameter#Left recognizedText : 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#array_type#Left VoiceCommand [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left commands : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left VoiceCommand [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left text = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left recognizedText AST#expression#Right . toLowerCase AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 添加联系人命令 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '添加联系人' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left text AST#expression#Right AST#binary_expression#Right AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '新增联系人' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { // 提取姓名 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left nameMatch = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . match AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right AST#ERROR#Left / 添加联系人\s * ( AST#ERROR#Left . AST#ERROR#Right + ) | 新增联系人\s * ( AST#ERROR#Left . AST#ERROR#Right + ) / ) AST#ERROR#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left name = AST#expression#Left AST#conditional_expression#Left AST#expression#Left nameMatch AST#expression#Right ? AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left nameMatch AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right || AST#expression#Left AST#subscript_expression#Left AST#expression#Left nameMatch AST#expression#Right [ AST#expression#Left 2 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right . trim AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right : AST#expression#Left '' AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left commands AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left command AST#property_name#Right : AST#expression#Left '添加联系人' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left action AST#property_name#Right : AST#expression#Left 'addContact' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left params AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left name AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left confidence AST#property_name#Right : AST#expression#Left 0.9 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 查看生日命令 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '查看' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right && AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '生日' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left text AST#expression#Right AST#binary_expression#Right AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '寿星' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '今天' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left text AST#expression#Right AST#binary_expression#Right AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '今日' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left commands AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left command AST#property_name#Right : AST#expression#Left '查看今天生日' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left action AST#property_name#Right : AST#expression#Left 'viewTodayBirthdays' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left confidence AST#property_name#Right : AST#expression#Left 0.9 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '本周' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left text AST#expression#Right AST#binary_expression#Right AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '这周' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left commands AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left command AST#property_name#Right : AST#expression#Left '查看本周生日' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left action AST#property_name#Right : AST#expression#Left 'viewWeekBirthdays' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left confidence AST#property_name#Right : AST#expression#Left 0.8 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 发送祝福命令 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '发送祝福' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left text AST#expression#Right AST#binary_expression#Right AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '送祝福' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left text AST#expression#Right AST#binary_expression#Right AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '祝福' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left nameMatch = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . match AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#ERROR#Left / AST#parameter_list#Left ( AST#parameter#Left ? AST#parameter#Right AST#ERROR#Left : 给 | 为 AST#ERROR#Right ) AST#parameter_list#Right \s * AST#parameter_list#Left ( AST#ERROR#Left . + ? AST#ERROR#Right ) AST#parameter_list#Right \s * AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#expression#Right AST#ERROR#Left ? : 发送祝福 | 送祝福 | 祝福 AST#ERROR#Right ) AST#parenthesized_expression#Right AST#expression#Right / AST#ERROR#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left name = AST#expression#Left AST#conditional_expression#Left AST#expression#Left nameMatch AST#expression#Right ? AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left nameMatch AST#expression#Right [ AST#expression#Left 1 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . trim AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right : AST#expression#Left '' AST#expression#Right AST#conditional_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left commands AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left command AST#property_name#Right : AST#expression#Left '发送祝福' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left action AST#property_name#Right : AST#expression#Left 'sendGreeting' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left params AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left name AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left confidence AST#property_name#Right : AST#expression#Left 0.8 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 打开日历命令 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left text AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '打开日历' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right || AST#expression#Left text AST#expression#Right AST#binary_expression#Right AST#expression#Right . includes AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '查看日历' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left commands AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left command AST#property_name#Right : AST#expression#Left '打开日历' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left action AST#property_name#Right : AST#expression#Left 'openCalendar' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left confidence AST#property_name#Right : AST#expression#Left 0.9 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left commands AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
parseVoiceCommand(recognizedText: string): VoiceCommand[] { const commands: VoiceCommand[] = []; const text = recognizedText.toLowerCase(); if (text.includes('添加联系人') || text.includes('新增联系人')) { const nameMatch = text.match(/添加联系人\s*(.+)|新增联系人\s*(.+)/); const name = nameMatch ? (nameMatch[1] || nameMatch[2]).trim() : ''; commands.push({ command: '添加联系人', action: 'addContact', params: { name }, confidence: 0.9 }); } if (text.includes('查看') && (text.includes('生日') || text.includes('寿星'))) { if (text.includes('今天') || text.includes('今日')) { commands.push({ command: '查看今天生日', action: 'viewTodayBirthdays', confidence: 0.9 }); } else if (text.includes('本周') || text.includes('这周')) { commands.push({ command: '查看本周生日', action: 'viewWeekBirthdays', confidence: 0.8 }); } } if (text.includes('发送祝福') || text.includes('送祝福') || text.includes('祝福')) { const nameMatch = text.match(/(?:给|为)\s*(.+?)\s*(?:发送祝福|送祝福|祝福)/); const name = nameMatch ? nameMatch[1].trim() : ''; commands.push({ command: '发送祝福', action: 'sendGreeting', params: { name }, confidence: 0.8 }); } if (text.includes('打开日历') || text.includes('查看日历')) { commands.push({ command: '打开日历', action: 'openCalendar', confidence: 0.9 }); } return commands; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/media/VoiceService.ets#L378-L436
cf7f4f1a95c12d9fc259859f8fa7f77fcd4f3a86
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/calendar/CalendarApiService.ets
arkts
getHolidayInfo
获取节假日信息
private async getHolidayInfo(date: Date): Promise<HolidayInfo> { try { const dateStr = this.formatDate(date); const url = `${this.APIs.holiday}${dateStr}`; const request = http.createHttp(); const response = await request.request(url, { method: http.RequestMethod.GET, header: { 'Content-Type': 'application/json' }, connectTimeout: 5000, readTimeout: 5000 }); request.destroy(); if (response.responseCode === 200 && response.result) { const data = JSON.parse(response.result.toString()) as HolidayApiResponse; if (data.code === 0 && data.holiday) { return { isHoliday: data.holiday.holiday, name: data.holiday.name || '', description: data.holiday.name || '' }; } } return { isHoliday: false, name: '', description: '' }; } catch (error) { console.error('获取节假日信息失败:', error); return { isHoliday: false, name: '', description: '' }; } }
AST#method_declaration#Left private async getHolidayInfo AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left HolidayInfo AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left dateStr = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . formatDate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left date AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left url = AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . APIs AST#member_expression#Right AST#expression#Right . holiday AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right AST#template_substitution#Left $ { AST#expression#Left dateStr AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left request = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left http AST#expression#Right . createHttp AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left response = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left request AST#expression#Right AST#await_expression#Right AST#expression#Right . request AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left url AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left method AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left http AST#expression#Right . RequestMethod AST#member_expression#Right AST#expression#Right . GET AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left header AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left 'Content-Type' AST#property_name#Right : AST#expression#Left 'application/json' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left connectTimeout AST#property_name#Right : AST#expression#Left 5000 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left readTimeout AST#property_name#Right : AST#expression#Left 5000 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left request AST#expression#Right . destroy AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left response AST#expression#Right . responseCode AST#member_expression#Right AST#expression#Right === AST#expression#Left 200 AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left response AST#expression#Right AST#binary_expression#Right AST#expression#Right . result AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left data = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . parse AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left response AST#expression#Right . result AST#member_expression#Right AST#expression#Right . toString AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left HolidayApiResponse AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . code AST#member_expression#Right AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left data AST#expression#Right AST#binary_expression#Right AST#expression#Right . holiday AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left isHoliday AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . holiday AST#member_expression#Right AST#expression#Right . holiday AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . holiday AST#member_expression#Right AST#expression#Right . name AST#member_expression#Right AST#expression#Right || AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . holiday AST#member_expression#Right AST#expression#Right . name AST#member_expression#Right AST#expression#Right || AST#expression#Left '' AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left isHoliday AST#property_name#Right : AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left '' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left '' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '获取节假日信息失败:' AST#expression#Right , AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left isHoliday AST#property_name#Right : AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left '' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left description AST#property_name#Right : AST#expression#Left '' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private async getHolidayInfo(date: Date): Promise<HolidayInfo> { try { const dateStr = this.formatDate(date); const url = `${this.APIs.holiday}${dateStr}`; const request = http.createHttp(); const response = await request.request(url, { method: http.RequestMethod.GET, header: { 'Content-Type': 'application/json' }, connectTimeout: 5000, readTimeout: 5000 }); request.destroy(); if (response.responseCode === 200 && response.result) { const data = JSON.parse(response.result.toString()) as HolidayApiResponse; if (data.code === 0 && data.holiday) { return { isHoliday: data.holiday.holiday, name: data.holiday.name || '', description: data.holiday.name || '' }; } } return { isHoliday: false, name: '', description: '' }; } catch (error) { console.error('获取节假日信息失败:', error); return { isHoliday: false, name: '', description: '' }; } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/calendar/CalendarApiService.ets#L175-L209
eba811193f97649242fd5986339041d39b00dd84
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/ReminderScheduler.ets
arkts
initializeScheduler
初始化调度器
private async initializeScheduler(): Promise<void> { try { // 请求提醒代理权限 await this.requestReminderPermissions(); // 启动后台任务 await this.startBackgroundTask(); // 加载已有的提醒 await this.loadExistingReminders(); // 开始定期调度 this.startPeriodicScheduling(); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION, 'ReminderScheduler initialized'); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION, `Failed to initialize ReminderScheduler: ${error}`); } }
AST#method_declaration#Left private async initializeScheduler 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#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { // 请求提醒代理权限 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . requestReminderPermissions AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 启动后台任务 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . startBackgroundTask AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 加载已有的提醒 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . loadExistingReminders AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 开始定期调度 AST#statement#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 . startPeriodicScheduling AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_NOTIFICATION AST#member_expression#Right AST#expression#Right , AST#expression#Left 'ReminderScheduler initialized' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_NOTIFICATION AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Failed to initialize ReminderScheduler: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private async initializeScheduler(): Promise<void> { try { await this.requestReminderPermissions(); await this.startBackgroundTask(); await this.loadExistingReminders(); this.startPeriodicScheduling(); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION, 'ReminderScheduler initialized'); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION, `Failed to initialize ReminderScheduler: ${error}`); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/ReminderScheduler.ets#L64-L82
3fee6a97737cec4cc84d74deb6df8ef6f735c01e
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.ArcSlider.d.ets
arkts
@file @kit ArkUI Enum for ArcSliderPosition @enum { string } @syscap SystemCapability.ArkUI.ArkUI.Circle @crossplatform @atomicservice @since 18
export declare enum ArcSliderPosition { /** * The position is on the left * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ LEFT = 0, /** * The position is on the right. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ RIGHT = 1 }
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ArcSliderPosition AST#enum_body#Left { /** * The position is on the left * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ AST#enum_member#Left LEFT = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , /** * The position is on the right. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ AST#enum_member#Left RIGHT = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export declare enum ArcSliderPosition { LEFT = 0, RIGHT = 1 }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ArcSlider.d.ets#L31-L52
02e847adf37985982156f917b42f1ac1baba3876
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/ChartModel.ets
arkts
clearValues
Removes all DataSets (and thereby Entries) from the chart. Does not set the data object to null. Also refreshes the chart by calling invalidate().
public clearValues() { if (this.mData) { this.mData.clearValues(); } this.invalidate(); }
AST#method_declaration#Left public clearValues AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mData AST#member_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mData AST#member_expression#Right AST#expression#Right . clearValues AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right 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 . invalidate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public clearValues() { if (this.mData) { this.mData.clearValues(); } this.invalidate(); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/ChartModel.ets#L263-L268
6567c8aa043105ba20da2271eacdec3b9dbd0872
gitee
ChangweiZhang/chardet-arkts.git
3a214882ec6a2753c0fed84162952aa659341c19
src/main/ets/components/encoding/mbcs.ets
arkts
Shift_JIS charset recognizer.
export class sjis extends mbcs { name() { return 'Shift_JIS'; } language() { return 'ja'; } // TODO: This set of data comes from the character frequency- // of-occurrence analysis tool. The data needs to be moved // into a resource and loaded from there. commonChars = [ 0x8140, 0x8141, 0x8142, 0x8145, 0x815b, 0x8169, 0x816a, 0x8175, 0x8176, 0x82a0, 0x82a2, 0x82a4, 0x82a9, 0x82aa, 0x82ab, 0x82ad, 0x82af, 0x82b1, 0x82b3, 0x82b5, 0x82b7, 0x82bd, 0x82be, 0x82c1, 0x82c4, 0x82c5, 0x82c6, 0x82c8, 0x82c9, 0x82cc, 0x82cd, 0x82dc, 0x82e0, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82f0, 0x82f1, 0x8341, 0x8343, 0x834e, 0x834f, 0x8358, 0x835e, 0x8362, 0x8367, 0x8375, 0x8376, 0x8389, 0x838a, 0x838b, 0x838d, 0x8393, 0x8e96, 0x93fa, 0x95aa, ]; nextChar(iter: IteratedChar, det: Context) { iter.index = iter.nextIndex; iter.error = false; const firstByte = (iter.charValue = iter.nextByte(det)); if (firstByte < 0) return false; if (firstByte <= 0x7f || (firstByte > 0xa0 && firstByte <= 0xdf)) return true; const secondByte = iter.nextByte(det); if (secondByte < 0) return false; iter.charValue = (firstByte << 8) | secondByte; if ( !( (secondByte >= 0x40 && secondByte <= 0x7f) || (secondByte >= 0x80 && secondByte <= 0xff) ) ) { // Illegal second byte value. iter.error = true; } return true; } }
AST#export_declaration#Left export AST#class_declaration#Left class sjis extends AST#type_annotation#Left AST#primary_type#Left mbcs AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#method_declaration#Left name AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left 'Shift_JIS' AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right AST#method_declaration#Left language AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left 'ja' AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right // TODO: This set of data comes from the character frequency- // of-occurrence analysis tool. The data needs to be moved // into a resource and loaded from there. AST#property_declaration#Left commonChars = AST#expression#Left AST#array_literal#Left [ AST#expression#Left 0x8140 AST#expression#Right , AST#expression#Left 0x8141 AST#expression#Right , AST#expression#Left 0x8142 AST#expression#Right , AST#expression#Left 0x8145 AST#expression#Right , AST#expression#Left 0x815b AST#expression#Right , AST#expression#Left 0x8169 AST#expression#Right , AST#expression#Left 0x816a AST#expression#Right , AST#expression#Left 0x8175 AST#expression#Right , AST#expression#Left 0x8176 AST#expression#Right , AST#expression#Left 0x82a0 AST#expression#Right , AST#expression#Left 0x82a2 AST#expression#Right , AST#expression#Left 0x82a4 AST#expression#Right , AST#expression#Left 0x82a9 AST#expression#Right , AST#expression#Left 0x82aa AST#expression#Right , AST#expression#Left 0x82ab AST#expression#Right , AST#expression#Left 0x82ad AST#expression#Right , AST#expression#Left 0x82af AST#expression#Right , AST#expression#Left 0x82b1 AST#expression#Right , AST#expression#Left 0x82b3 AST#expression#Right , AST#expression#Left 0x82b5 AST#expression#Right , AST#expression#Left 0x82b7 AST#expression#Right , AST#expression#Left 0x82bd AST#expression#Right , AST#expression#Left 0x82be AST#expression#Right , AST#expression#Left 0x82c1 AST#expression#Right , AST#expression#Left 0x82c4 AST#expression#Right , AST#expression#Left 0x82c5 AST#expression#Right , AST#expression#Left 0x82c6 AST#expression#Right , AST#expression#Left 0x82c8 AST#expression#Right , AST#expression#Left 0x82c9 AST#expression#Right , AST#expression#Left 0x82cc AST#expression#Right , AST#expression#Left 0x82cd AST#expression#Right , AST#expression#Left 0x82dc AST#expression#Right , AST#expression#Left 0x82e0 AST#expression#Right , AST#expression#Left 0x82e7 AST#expression#Right , AST#expression#Left 0x82e8 AST#expression#Right , AST#expression#Left 0x82e9 AST#expression#Right , AST#expression#Left 0x82ea AST#expression#Right , AST#expression#Left 0x82f0 AST#expression#Right , AST#expression#Left 0x82f1 AST#expression#Right , AST#expression#Left 0x8341 AST#expression#Right , AST#expression#Left 0x8343 AST#expression#Right , AST#expression#Left 0x834e AST#expression#Right , AST#expression#Left 0x834f AST#expression#Right , AST#expression#Left 0x8358 AST#expression#Right , AST#expression#Left 0x835e AST#expression#Right , AST#expression#Left 0x8362 AST#expression#Right , AST#expression#Left 0x8367 AST#expression#Right , AST#expression#Left 0x8375 AST#expression#Right , AST#expression#Left 0x8376 AST#expression#Right , AST#expression#Left 0x8389 AST#expression#Right , AST#expression#Left 0x838a AST#expression#Right , AST#expression#Left 0x838b AST#expression#Right , AST#expression#Left 0x838d AST#expression#Right , AST#expression#Left 0x8393 AST#expression#Right , AST#expression#Left 0x8e96 AST#expression#Right , AST#expression#Left 0x93fa AST#expression#Right , AST#expression#Left 0x95aa AST#expression#Right , ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right AST#method_declaration#Left nextChar AST#parameter_list#Left ( AST#parameter#Left iter : AST#type_annotation#Left AST#primary_type#Left IteratedChar AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left det : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left iter AST#expression#Right . index AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left iter AST#expression#Right . nextIndex AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left iter AST#expression#Right . error AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left firstByte = AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left iter AST#expression#Right . charValue AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left iter AST#expression#Right . nextByte AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left det AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left firstByte AST#expression#Right < AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left firstByte AST#expression#Right <= AST#expression#Left 0x7f AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left firstByte AST#expression#Right > AST#expression#Left 0xa0 AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left firstByte AST#expression#Right <= AST#expression#Left 0xdf AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left secondByte = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left iter AST#expression#Right . nextByte AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left det AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left secondByte AST#expression#Right < AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left iter AST#expression#Right . charValue AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left firstByte AST#expression#Right << AST#expression#Left 8 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right | AST#expression#Left secondByte AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left secondByte AST#expression#Right >= AST#expression#Left 0x40 AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left secondByte AST#expression#Right <= AST#expression#Left 0x7f AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right || AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left secondByte AST#expression#Right >= AST#expression#Left 0x80 AST#expression#Right AST#binary_expression#Right AST#expression#Right && AST#expression#Left AST#binary_expression#Left AST#expression#Left secondByte AST#expression#Right <= AST#expression#Left 0xff AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { // Illegal second byte value. AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left iter AST#expression#Right . error AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class sjis extends mbcs { name() { return 'Shift_JIS'; } language() { return 'ja'; } commonChars = [ 0x8140, 0x8141, 0x8142, 0x8145, 0x815b, 0x8169, 0x816a, 0x8175, 0x8176, 0x82a0, 0x82a2, 0x82a4, 0x82a9, 0x82aa, 0x82ab, 0x82ad, 0x82af, 0x82b1, 0x82b3, 0x82b5, 0x82b7, 0x82bd, 0x82be, 0x82c1, 0x82c4, 0x82c5, 0x82c6, 0x82c8, 0x82c9, 0x82cc, 0x82cd, 0x82dc, 0x82e0, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82f0, 0x82f1, 0x8341, 0x8343, 0x834e, 0x834f, 0x8358, 0x835e, 0x8362, 0x8367, 0x8375, 0x8376, 0x8389, 0x838a, 0x838b, 0x838d, 0x8393, 0x8e96, 0x93fa, 0x95aa, ]; nextChar(iter: IteratedChar, det: Context) { iter.index = iter.nextIndex; iter.error = false; const firstByte = (iter.charValue = iter.nextByte(det)); if (firstByte < 0) return false; if (firstByte <= 0x7f || (firstByte > 0xa0 && firstByte <= 0xdf)) return true; const secondByte = iter.nextByte(det); if (secondByte < 0) return false; iter.charValue = (firstByte << 8) | secondByte; if ( !( (secondByte >= 0x40 && secondByte <= 0x7f) || (secondByte >= 0x80 && secondByte <= 0xff) ) ) { iter.error = true; } return true; } }
https://github.com/ChangweiZhang/chardet-arkts.git/blob/3a214882ec6a2753c0fed84162952aa659341c19/src/main/ets/components/encoding/mbcs.ets#L199-L245
270b46b384d30c47962f6fe9e0f75f00be96a3f8
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/DialogCoreHandler.ets
arkts
openBaseCustomDialog
创建并弹出dialogContent对应的自定义弹窗 @param uiContext UIContext。 @param wrappedBuilder 自定义弹窗中显示的组件内容。 @param options 弹窗样式。
private openBaseCustomDialog<T extends IBaseDialogOptions>(uiContext: UIContext, wrappedBuilder: WrappedBuilder<[T]>, options: T) { if (this.exist(options.dialogId ?? "")) { //判断dialogId是否存在 // LogUtil.error(`该弹框已存在,dialogId:${options.dialogId}`); return } const newOptions: IBaseDialogOptions = {} as IBaseDialogOptions ObjectUtil.assign(newOptions, options) const observedData = options.observedData ?? {} as IObservedData newOptions.onWillDismiss = (action: DismissDialogAction) => { //交互式关闭回调函数。 if (options.onWillDismiss && typeof options.onWillDismiss === 'function') { options.onWillDismiss(action); } else { if (options.autoCancel) { switch (action.reason) { case DismissReason.PRESS_BACK: case DismissReason.TOUCH_OUTSIDE: if (observedData) { observedData._isShowing = false } action.dismiss(); break; default: break } } } }
AST#method_declaration#Left private openBaseCustomDialog AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left IBaseDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left wrappedBuilder : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left WrappedBuilder AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#tuple_type#Left [ AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right ] AST#tuple_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . exist AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . dialogId AST#member_expression#Right AST#expression#Right ?? AST#expression#Left "" AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#object_literal#Left { //判断dialogId是否存在 // LogUtil.error(`该弹框已存在,dialogId:${options.dialogId}`); AST#ERROR#Left return AST#ERROR#Right } AST#object_literal#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left newOptions : AST#type_annotation#Left AST#primary_type#Left IBaseDialogOptions AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#as_expression#Left AST#expression#Left AST#object_literal#Left { } AST#object_literal#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left IBaseDialogOptions AST#ERROR#Left ObjectUtil AST#ERROR#Right . assign AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left newOptions AST#expression#Right , AST#expression#Left options AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left observedData = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . observedData AST#member_expression#Right AST#expression#Right ?? AST#expression#Left AST#object_literal#Left { } AST#object_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left IObservedData AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left newOptions AST#expression#Right . onWillDismiss AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left = AST#parameter_list#Left ( AST#parameter#Left action : AST#type_annotation#Left AST#primary_type#Left DismissDialogAction AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left => { //交互式关闭回调函数。 if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . onWillDismiss AST#member_expression#Right AST#expression#Right && AST#expression#Left AST#unary_expression#Left typeof AST#expression#Left options AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . onWillDismiss AST#member_expression#Right AST#expression#Right === AST#expression#Left 'function' AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . onWillDismiss AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left action AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else { if ( AST#expression#Left AST#as_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left options AST#expression#Right . autoCancel AST#member_expression#Right AST#expression#Right AST#ERROR#Left ) { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left switch AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left action AST#expression#Right . reason AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right { AST#property_name#Left case AST#property_name#Right DismissRe AST#ERROR#Right as AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left on . PRESS_BACK AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#ERROR#Right : case DismissRe AST#ERROR#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left ason AST#expression#Right . TOUCH_OUTSIDE AST#member_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left observedData AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left observedData AST#expression#Right . _isShowing AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left action AST#expression#Right . dismiss AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#break_statement#Left break ; AST#break_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left default AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : break } } } AST#ERROR#Right } AST#block_statement#Right AST#method_declaration#Right
private openBaseCustomDialog<T extends IBaseDialogOptions>(uiContext: UIContext, wrappedBuilder: WrappedBuilder<[T]>, options: T) { if (this.exist(options.dialogId ?? "")) { return } const newOptions: IBaseDialogOptions = {} as IBaseDialogOptions ObjectUtil.assign(newOptions, options) const observedData = options.observedData ?? {} as IObservedData newOptions.onWillDismiss = (action: DismissDialogAction) => { if (options.onWillDismiss && typeof options.onWillDismiss === 'function') { options.onWillDismiss(action); } else { if (options.autoCancel) { switch (action.reason) { case DismissReason.PRESS_BACK: case DismissReason.TOUCH_OUTSIDE: if (observedData) { observedData._isShowing = false } action.dismiss(); break; default: break } } } }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogCoreHandler.ets#L60-L90
4c5d4fce8883349eb15426726c1c1e78fb583bad
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/ui_tools.ets
arkts
Infers the index of window. @param w The windowClass (window.Window).
export function window_index_of_windowClass(w: window.Window) { let windowClasses = AppStorage.get('windows') as window.Window[]; let window_idx = windowClasses.indexOf(w); return window_idx; }
AST#export_declaration#Left export AST#function_declaration#Left function window_index_of_windowClass AST#parameter_list#Left ( AST#parameter#Left w : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left windowClasses = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AppStorage AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'windows' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right [ AST#expression#Left AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left window_idx = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left windowClasses AST#expression#Right . indexOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left w AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left window_idx AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
export function window_index_of_windowClass(w: window.Window) { let windowClasses = AppStorage.get('windows') as window.Window[]; let window_idx = windowClasses.indexOf(w); return window_idx; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/ui_tools.ets#L429-L433
f23672203c894f348258533904ed5cae7d8c6c5a
gitee
Vinson0709/arkdemo.git
793491fe04b387f55dadfef86b30e28d0535d994
entry/src/main/ets/pages/Progresses.ets
arkts
aboutToAppear
生命周期函数,创建组件实例后,执行build渲染函数之前
aboutToAppear() {}
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
aboutToAppear() {}
https://github.com/Vinson0709/arkdemo.git/blob/793491fe04b387f55dadfef86b30e28d0535d994/entry/src/main/ets/pages/Progresses.ets#L21-L21
7c60d2f2ffd22cef5cb6b37617ad15e4db28fb2a
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/renderer/BubbleChartRenderer.ets
arkts
initBuffers
@Override
public initBuffers(): void { }
AST#method_declaration#Left public initBuffers AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
public initBuffers(): void { }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/BubbleChartRenderer.ets#L48-L50
306604af9dde408ee2a2720dedc6e573246f2e14
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets
arkts
initPreferences
MARK: - Preference 初始化
private async initPreferences() { this.prefs = await preferences.getPreferences(this.context, Prefs.Name); await this.loadPreference(); }
AST#method_declaration#Left private async initPreferences AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . prefs AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left preferences AST#expression#Right AST#await_expression#Right AST#expression#Right . getPreferences AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left Prefs AST#expression#Right . Name AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . loadPreference AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
private async initPreferences() { this.prefs = await preferences.getPreferences(this.context, Prefs.Name); await this.loadPreference(); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets#L102-L105
92f74e89846bf81f19bef623a09556be8314da65
github
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
AtomicService/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets
arkts
聊天数据资源类
export class ChatDataSource implements IChatDataSource { // 聊天信息数组 private originDataArray: IChatMessage[] = []; // 消息监听数组 private listeners: DataChangeListener[] = []; // 添加数据函数 public addData(index: number, data: IChatMessage): void { this.originDataArray.splice(index, 0, data); this.notifyDataAdd(index); } // 插入数据函数 public pushData(data: ChatMessage): void { this.originDataArray.push(data); this.notifyDataAdd(this.originDataArray.length - 1); } // 更新数据函数 public updateData(index: number, data: IChatMessage): void { if (this.originDataArray.length <= index) { this.originDataArray.push(data); } else { this.originDataArray[index].roleType = data.roleType; this.originDataArray[index].name = data.name; this.originDataArray[index].content = data.content; this.originDataArray[index].picurl = data.picurl; } this.notifyDataChange(index); } // 删除数据函数 removeData(index: number): void { this.originDataArray = this.originDataArray.slice(index, 1); } // 清除数据函数 public clearData(): void { this.originDataArray = []; this.listeners.forEach(listener => { listener.onDataReloaded(); }) } // 获取数据函数 public getData(index: number) { return this.originDataArray[index]; } // 获取全部数据函数 public getAllData(): IChatMessage[] { return this.originDataArray; } // 获取聊天信息数组长度函数 public totalCount(): number { return this.originDataArray.length; } // 注册消息监听函数 public registerDataChangeListener(listener: DataChangeListener): void { if (this.listeners.indexOf(listener) < 0) { console.info('add listener'); this.listeners.push(listener); } } // 注销消息监听函数 public unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { console.info('remove listener'); this.listeners.splice(pos, 1); } } // 通知LazyForEach组件需要在index对应索引处添加子组件函数 private notifyDataAdd(index: number): void { this.listeners.forEach(listener => { listener.onDataAdd(index); }) } // 通知LazyForEach组件在index对应索引处数据有变化,需要重建该子组件函数 private notifyDataChange(index: number): void { this.listeners.forEach(listener => { listener.onDataChange(index); }) } }
AST#export_declaration#Left export AST#class_declaration#Left class ChatDataSource AST#implements_clause#Left implements IChatDataSource AST#implements_clause#Right AST#class_body#Left { // 聊天信息数组 AST#property_declaration#Left private originDataArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left IChatMessage [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right // 消息监听数组 AST#property_declaration#Left private listeners : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DataChangeListener [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right ; AST#property_declaration#Right // 添加数据函数 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 IChatMessage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#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#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . splice AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right , AST#expression#Left 0 AST#expression#Right , AST#expression#Left data AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right 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 . notifyDataAdd AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right // 插入数据函数 AST#method_declaration#Left public pushData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left ChatMessage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#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#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left data AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right 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 . notifyDataAdd AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right // 更新数据函数 AST#method_declaration#Left public updateData 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 IChatMessage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right <= AST#expression#Left index AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left data AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } else { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . roleType AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . roleType AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . name AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . name AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . content AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . content AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right . picurl AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . picurl AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right 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 . notifyDataChange AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right // 删除数据函数 AST#method_declaration#Left removeData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . slice AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right , AST#expression#Left 1 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right // 清除数据函数 AST#method_declaration#Left public clearData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right = AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataReloaded AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right // 获取数据函数 AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right // 获取全部数据函数 AST#method_declaration#Left public getAllData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left IChatMessage [ ] AST#array_type#Right 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_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right // 获取聊天信息数组长度函数 AST#method_declaration#Left public totalCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . originDataArray AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right // 注册消息监听函数 AST#method_declaration#Left public registerDataChangeListener 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#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . indexOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right < AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'add listener' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#builder_function_body#Right AST#method_declaration#Right // 注销消息监听函数 AST#method_declaration#Left public 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#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left pos = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . indexOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left pos AST#expression#Right >= AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'remove listener' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . splice AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left pos AST#expression#Right , AST#expression#Left 1 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right // 通知LazyForEach组件需要在index对应索引处添加子组件函数 AST#method_declaration#Left private notifyDataAdd AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void 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#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataAdd AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right // 通知LazyForEach组件在index对应索引处数据有变化,需要重建该子组件函数 AST#method_declaration#Left private notifyDataChange AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void 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#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . forEach AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left listener => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left listener AST#expression#Right . onDataChange AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left index AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class ChatDataSource implements IChatDataSource { private originDataArray: IChatMessage[] = []; private listeners: DataChangeListener[] = []; public addData(index: number, data: IChatMessage): void { this.originDataArray.splice(index, 0, data); this.notifyDataAdd(index); } public pushData(data: ChatMessage): void { this.originDataArray.push(data); this.notifyDataAdd(this.originDataArray.length - 1); } public updateData(index: number, data: IChatMessage): void { if (this.originDataArray.length <= index) { this.originDataArray.push(data); } else { this.originDataArray[index].roleType = data.roleType; this.originDataArray[index].name = data.name; this.originDataArray[index].content = data.content; this.originDataArray[index].picurl = data.picurl; } this.notifyDataChange(index); } removeData(index: number): void { this.originDataArray = this.originDataArray.slice(index, 1); } public clearData(): void { this.originDataArray = []; this.listeners.forEach(listener => { listener.onDataReloaded(); }) } public getData(index: number) { return this.originDataArray[index]; } public getAllData(): IChatMessage[] { return this.originDataArray; } public totalCount(): number { return this.originDataArray.length; } public registerDataChangeListener(listener: DataChangeListener): void { if (this.listeners.indexOf(listener) < 0) { console.info('add listener'); this.listeners.push(listener); } } public unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { console.info('remove listener'); this.listeners.splice(pos, 1); } } private notifyDataAdd(index: number): void { this.listeners.forEach(listener => { listener.onDataAdd(index); }) } private notifyDataChange(index: number): void { this.listeners.forEach(listener => { listener.onDataChange(index); }) } }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/AtomicService/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets#L8-L97
d7e7d743cbd9309ed33d21a87f4910980eeb67e5
gitee
from-north-to-north/OpenHarmony_p7885
f6ea526c039db535a7c958fa154ccfcb3668b37c
hap/手机浏览器/hap源码/laval-browser_v104/entry/src/main/ets/common/TitleBar.ets
arkts
webview
启动预连接,连接地址为即将打开的网址。
webview.WebviewController.prepareForPageLoad(this.src, true, 2);
AST#method_declaration#Left webview AST#ERROR#Left . WebviewController . prepareForPageLoad AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left this AST#parameter#Right AST#ERROR#Left . src AST#ERROR#Right , AST#parameter#Left true AST#parameter#Right AST#ERROR#Left , 2 AST#ERROR#Right ) AST#parameter_list#Right ; AST#method_declaration#Right
webview.WebviewController.prepareForPageLoad(this.src, true, 2);
https://github.com/from-north-to-north/OpenHarmony_p7885/blob/f6ea526c039db535a7c958fa154ccfcb3668b37c/hap/手机浏览器/hap源码/laval-browser_v104/entry/src/main/ets/common/TitleBar.ets#L248-L248
a1f4bf1446fdcdd2f080bc8da3d9fc48301bbbe5
gitee
openharmony-tpc/ImageKnife
bc55de9e2edd79ed4646ce37177ad94b432874f7
library/src/main/ets/cache/FileCache.ets
arkts
initFileCache
遍历缓存文件目录,初始化缓存
public async initFileCache(path: string = FileCache.CACHE_FOLDER) { if (this.isInited) { return } let startTime = Date.now() if (this.context && path.startsWith(this.context.cacheDir) === true) { this.path = path } else { FileCache.CACHE_FOLDER = path this.path = this.context?.cacheDir + FileUtils.SEPARATOR + FileCache.CACHE_FOLDER + FileUtils.SEPARATOR } await FileUtils.getInstance().createFolder(this.path) // 遍历缓存目录下的文件,按照时间顺序加入缓存 let filenames: string[] = await FileUtils.getInstance().ListFile(this.path) interface CacheFileInfo { file: string; ctime: number; size: number; }
AST#method_declaration#Left public async initFileCache AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left FileCache AST#expression#Right . CACHE_FOLDER AST#member_expression#Right AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isInited AST#member_expression#Right AST#expression#Right ) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#object_literal#Left { AST#ERROR#Left return AST#ERROR#Right } AST#object_literal#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left startTime = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Date AST#expression#Right . now AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right && AST#expression#Left path AST#expression#Right AST#binary_expression#Right AST#expression#Right . startsWith AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right . cacheDir AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right === AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . path AST#member_expression#Right = AST#expression#Left path AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left FileCache AST#expression#Right . CACHE_FOLDER AST#member_expression#Right = AST#expression#Left path AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . path AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right AST#expression#Right ?. cacheDir AST#member_expression#Right AST#expression#Right + AST#expression#Left FileUtils AST#expression#Right AST#binary_expression#Right AST#expression#Right . SEPARATOR AST#member_expression#Right AST#expression#Right + AST#expression#Left FileCache AST#expression#Right AST#binary_expression#Right AST#expression#Right . CACHE_FOLDER AST#member_expression#Right AST#expression#Right + AST#expression#Left FileUtils AST#expression#Right AST#binary_expression#Right AST#expression#Right . SEPARATOR AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left FileUtils AST#expression#Right AST#await_expression#Right AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . createFolder AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . path AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right // 遍历缓存目录下的文件,按照时间顺序加入缓存 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left filenames : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left FileUtils AST#expression#Right AST#await_expression#Right AST#expression#Right . getInstance AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . ListFile AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . path AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right in AST#ERROR#Left terface CacheFileInfo AST#ERROR#Right AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left file AST#property_name#Right : AST#expression#Left string AST#expression#Right AST#property_assignment#Right AST#object_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left ctime AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left size AST#expression#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public async initFileCache(path: string = FileCache.CACHE_FOLDER) { if (this.isInited) { return } let startTime = Date.now() if (this.context && path.startsWith(this.context.cacheDir) === true) { this.path = path } else { FileCache.CACHE_FOLDER = path this.path = this.context?.cacheDir + FileUtils.SEPARATOR + FileCache.CACHE_FOLDER + FileUtils.SEPARATOR } await FileUtils.getInstance().createFolder(this.path) let filenames: string[] = await FileUtils.getInstance().ListFile(this.path) interface CacheFileInfo { file: string; ctime: number; size: number; }
https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/cache/FileCache.ets#L55-L74
466f3c57615772803c8df57a7fb6b7a2cf34a555
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
buildContactsContent
构建联系人页面内容
@Builder buildContactsContent() { Column({ space: 16 }) { // 搜索和筛选工具栏 this.buildContactsToolbar() // 联系人统计信息 this.buildContactsStats() // 联系人列表 this.buildContactsList() } .width('100%') .alignItems(HorizontalAlign.Start) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContactsContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 16 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#container_content_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 . buildContactsToolbar AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right // 联系人统计信息 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 . buildContactsStats AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right // 联系人列表 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 . buildContactsList AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . alignItems ( AST#expression#Left AST#member_expression#Left AST#expression#Left HorizontalAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder buildContactsContent() { Column({ space: 16 }) { this.buildContactsToolbar() this.buildContactsStats() this.buildContactsList() } .width('100%') .alignItems(HorizontalAlign.Start) }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L1757-L1771
8ebd76c0be43b353439375099424a63878a0a68c
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets
arkts
ref
Returns an alias to the AppStorage property with given name. @param propName - a property name @returns an AbstractProperty by the given name, or `undefined` if it does not exist
static ref<T>(propName: string): AbstractProperty<T> | undefined { return StorageMap.shared.entry<T>(propName) }
AST#method_declaration#Left static ref AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#generic_type#Left AbstractProperty AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left StorageMap AST#expression#Right . shared AST#member_expression#Right AST#expression#Right . entry AST#member_expression#Right AST#expression#Right AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#argument_list#Left ( AST#expression#Left propName AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static ref<T>(propName: string): AbstractProperty<T> | undefined { return StorageMap.shared.entry<T>(propName) }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L33-L35
bddea33c926a36f1edfa6c07903a930966af1a65
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/data/DataImportExportService.ets
arkts
importFromOtherApps
从其他应用导入联系人
async importFromOtherApps(onProgress?: ImportProgressCallback): Promise<ImportResult> { try { hilog.info(0x0000, 'DataImportExportService', 'Starting other apps import...'); if (onProgress) { onProgress({ totalRecords: 0, processedRecords: 0, currentOperation: '检测其他应用数据...', percentage: 0 }); } // 模拟检测其他应用的数据 const otherAppsData = await this.detectOtherAppsData(); if (onProgress) { onProgress({ totalRecords: otherAppsData.length, processedRecords: 0, currentOperation: '开始转换数据格式...', percentage: 30 }); } const result = await this.processContactsImport(otherAppsData, onProgress); hilog.info(0x0000, 'DataImportExportService', `Other apps import completed: ${result.importedCount} imported`); return result; } catch (error) { hilog.error(0x0000, 'DataImportExportService', `Other apps import failed: ${error}`); return { success: false, importedCount: 0, skippedCount: 0, errorCount: 1, errors: [`第三方应用导入失败: ${error}`], contacts: [] }; } }
AST#method_declaration#Left async importFromOtherApps AST#parameter_list#Left ( AST#parameter#Left onProgress ? : AST#type_annotation#Left AST#primary_type#Left ImportProgressCallback AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ImportResult AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0000 AST#expression#Right , AST#expression#Left 'DataImportExportService' AST#expression#Right , AST#expression#Left 'Starting other apps import...' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left onProgress AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left onProgress AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left totalRecords AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left processedRecords AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left currentOperation AST#property_name#Right : AST#expression#Left '检测其他应用数据...' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left percentage AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right // 模拟检测其他应用的数据 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left otherAppsData = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . detectOtherAppsData AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left onProgress AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left onProgress AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left totalRecords AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left otherAppsData AST#expression#Right . length AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left processedRecords AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left currentOperation AST#property_name#Right : AST#expression#Left '开始转换数据格式...' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left percentage AST#property_name#Right : AST#expression#Left 30 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left result = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . processContactsImport AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left otherAppsData AST#expression#Right , AST#expression#Left onProgress AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0000 AST#expression#Right , AST#expression#Left 'DataImportExportService' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Other apps import completed: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left result AST#expression#Right . importedCount AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right imported ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left result AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0000 AST#expression#Right , AST#expression#Left 'DataImportExportService' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Other apps import failed: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left success AST#property_name#Right : AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left importedCount AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left skippedCount AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left errorCount AST#property_name#Right : AST#expression#Left 1 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left errors AST#property_name#Right : AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#template_literal#Left ` 第三方应用导入失败: AST#template_substitution#Left $ { AST#expression#Left error AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ] AST#array_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left contacts AST#property_name#Right : AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async importFromOtherApps(onProgress?: ImportProgressCallback): Promise<ImportResult> { try { hilog.info(0x0000, 'DataImportExportService', 'Starting other apps import...'); if (onProgress) { onProgress({ totalRecords: 0, processedRecords: 0, currentOperation: '检测其他应用数据...', percentage: 0 }); } const otherAppsData = await this.detectOtherAppsData(); if (onProgress) { onProgress({ totalRecords: otherAppsData.length, processedRecords: 0, currentOperation: '开始转换数据格式...', percentage: 30 }); } const result = await this.processContactsImport(otherAppsData, onProgress); hilog.info(0x0000, 'DataImportExportService', `Other apps import completed: ${result.importedCount} imported`); return result; } catch (error) { hilog.error(0x0000, 'DataImportExportService', `Other apps import failed: ${error}`); return { success: false, importedCount: 0, skippedCount: 0, errorCount: 1, errors: [`第三方应用导入失败: ${error}`], contacts: [] }; } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/data/DataImportExportService.ets#L270-L310
b729e69be9532d1c32859049581924fb9ed5632d
github
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/model/DataModel.ets
arkts
pushData
Add data.
public pushData(data: string): void { this.tabContent.push(data); this.notifyDataAdd(this.tabContent.length - 1); }
AST#method_declaration#Left public pushData 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_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#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabContent AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left data AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right 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 . notifyDataAdd AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . tabContent AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public pushData(data: string): void { this.tabContent.push(data); this.notifyDataAdd(this.tabContent.length - 1); }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/model/DataModel.ets#L71-L74
f2c9aed94850134de3242e61575981b6e33ee563
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/GreetingTypes.ets
arkts
祝福语发送结果接口
export interface GreetingSendResult { success: boolean; message?: string; sentAt?: string; historyId?: string; error?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface GreetingSendResult AST#object_type#Left { AST#type_member#Left success : 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 message ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left sentAt ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left historyId ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left error ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface GreetingSendResult { success: boolean; message?: string; sentAt?: string; historyId?: string; error?: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GreetingTypes.ets#L196-L202
a1c76d2e3ae95453cd9b47cfbc6daf13fc618566
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/media/VoiceService.ets
arkts
executeVoiceCommand
执行语音命令
async executeVoiceCommand(command: VoiceCommand): Promise<any> { try { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Executing voice command: ${command.action}`); switch (command.action) { case 'addContact': return await this.handleAddContactCommand(command.params); case 'viewTodayBirthdays': return await this.handleViewTodayBirthdaysCommand(); case 'viewWeekBirthdays': return await this.handleViewWeekBirthdaysCommand(); case 'sendGreeting': return await this.handleSendGreetingCommand(command.params); case 'openCalendar': return await this.handleOpenCalendarCommand(); default: throw new Error(`未知的语音命令: ${command.action}`); } }
AST#method_declaration#Left async executeVoiceCommand AST#parameter_list#Left ( AST#parameter#Left command : AST#type_annotation#Left AST#primary_type#Left VoiceCommand AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left any AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . DOMAIN_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left LogConstants AST#expression#Right . TAG_APP AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Executing voice command: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left command AST#expression#Right . action AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left switch AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left command AST#expression#Right . action AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#object_literal#Left { AST#ERROR#Left AST#property_name#Left case AST#property_name#Right AST#ERROR#Right AST#property_assignment#Left AST#property_name#Left 'addContact' AST#property_name#Right : AST#expression#Left return AST#expression#Right AST#property_assignment#Right AST#object_literal#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . handleAddContactCommand AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left command AST#expression#Right . params AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left 'viewTodayBirthdays' AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . handleViewTodayBirthdaysCommand AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left 'viewWeekBirthdays' AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . handleViewWeekBirthdaysCommand AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left 'sendGreeting' AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . handleSendGreetingCommand AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left command AST#expression#Right . params AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left case AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left 'openCalendar' AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : AST#ERROR#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . handleOpenCalendarCommand AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left default AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#ERROR#Left : throw AST#ERROR#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` 未知的语音命令: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left command AST#expression#Right . action AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async executeVoiceCommand(command: VoiceCommand): Promise<any> { try { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Executing voice command: ${command.action}`); switch (command.action) { case 'addContact': return await this.handleAddContactCommand(command.params); case 'viewTodayBirthdays': return await this.handleViewTodayBirthdaysCommand(); case 'viewWeekBirthdays': return await this.handleViewWeekBirthdaysCommand(); case 'sendGreeting': return await this.handleSendGreetingCommand(command.params); case 'openCalendar': return await this.handleOpenCalendarCommand(); default: throw new Error(`未知的语音命令: ${command.action}`); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/media/VoiceService.ets#L441-L460
773f1f0dd3c429373cba4a1ea7df2739ea1b97b2
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/util/CryptoUtil.ets
arkts
sign
签名 @param str 需要签名的字符串 @param priKey 给定秘钥规格私钥 @param symAlgName 秘钥规格 @param symEncryptName 加密规格 @returns string> 签名对象
static async sign(str: string, priKey: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<string> { //将私钥转换 let priPair = await CryptoUtil.convertPriKeyFromStr(priKey, symAlgName, keyName); //创建签名器 let signer = crypto.createSign(symEncryptName); //初始化签名器 await signer.init(priPair.priKey); let encode = new util.TextEncoder(); //签名的字符串 let input: crypto.DataBlob = { data: encode.encodeInto(str) }; await signer.update(input); let sign = await signer.sign(input); return StrAndUintUtil.unitArray2String(sign.data); }
AST#method_declaration#Left static async sign AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symAlgName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symEncryptName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left keyName : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { //将私钥转换 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left priPair = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left CryptoUtil AST#expression#Right AST#await_expression#Right AST#expression#Right . convertPriKeyFromStr AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left priKey AST#expression#Right , AST#expression#Left symAlgName AST#expression#Right , AST#expression#Left keyName AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //创建签名器 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left signer = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left crypto AST#expression#Right . createSign AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left symEncryptName AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //初始化签名器 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left signer AST#expression#Right AST#await_expression#Right AST#expression#Right . init AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left priPair AST#expression#Right . priKey AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left encode = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left util AST#expression#Right AST#new_expression#Right AST#expression#Right . TextEncoder AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //签名的字符串 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left input : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left crypto . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left data AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left encode AST#expression#Right . encodeInto AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left str AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left signer AST#expression#Right AST#await_expression#Right AST#expression#Right . update AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left input AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sign = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left signer AST#expression#Right AST#await_expression#Right AST#expression#Right . sign AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left input AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left StrAndUintUtil AST#expression#Right . unitArray2String AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left sign AST#expression#Right . data AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static async sign(str: string, priKey: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<string> { let priPair = await CryptoUtil.convertPriKeyFromStr(priKey, symAlgName, keyName); let signer = crypto.createSign(symEncryptName); await signer.init(priPair.priKey); let encode = new util.TextEncoder(); let input: crypto.DataBlob = { data: encode.encodeInto(str) }; await signer.update(input); let sign = await signer.sign(input); return StrAndUintUtil.unitArray2String(sign.data); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/util/CryptoUtil.ets#L341-L355
95a923664861643f1a5731c751c302719af8054c
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/utils/NumberUtil.ets
arkts
TODO number工具类 author: 桃花镇童长老ᥫ᭡ since: 2024/05/01
export class NumberUtil { /** * 检查值是否为NaN * @param value * @returns */ static isNaN(value: Any): boolean { return Number.isNaN(value); } /** * 检查值是否为有限数字 * @param value * @returns */ static isFinite(value: Any): boolean { return Number.isFinite(value); } /** * 检查值是否为整数 * @param value * @returns */ static isInteger(value: Any): boolean { return Number.isInteger(value); } /** * 检查值是否为安全整数 * @param value * @returns */ static isSafeInteger(value: Any): boolean { return Number.isSafeInteger(value); } /** * 判断是否是数值 * @param value 需要判断的参数 */ static isNumber(value: Any): boolean { return (typeof value === "number") && !NumberUtil.isNaN(value); } /** * 检查数字是否为偶数 * @param {number} num - 要检查的数字 * @returns {boolean} 如果是偶数返回 true,否则返回 false */ static isEven(num: number): boolean { return num % 2 === 0; } /** * 检查数字是否为奇数 * @param {number} num - 要检查的数字 * @returns {boolean} 如果是奇数返回 true,否则返回 false */ static isOdd(num: number): boolean { return num % 2 !== 0; } /** * 将字符串转换为Number。 * @param value 要转换的字符串 * @param defaultValue 异常时给默认值 * @returns */ static toNumber(value: string, defaultValue: number = Number.NaN): number { let num = Number(value).valueOf(); if (isNaN(num)) { return defaultValue; } return num } /** * 将字符串转换为整数。 * @param value 要转换的字符串 * @param defaultValue 异常时给默认值 * @returns */ static toInt(value: string, defaultValue: number = Number.NaN): number { const parseValue = parseInt(value); if (isNaN(parseValue)) { return defaultValue; } return parseValue; } /** * 将字符串转换为浮点数。 * @param value 要转换的字符串 * @param defaultValue 异常时给默认值 * @returns */ static toFloat(value: string, defaultValue: number = Number.NaN): number { const parseValue = parseFloat(value); if (isNaN(parseValue)) { return defaultValue; } return parseValue; } /** * 计算数字的平均值 * @param numbers - 要计算的数字列表 * @returns 平均值 */ static average(...numbers: number[]): number { if (numbers.length > 0) { const sum = numbers.reduce((acc, num) => acc + num, 0); return sum / numbers.length; } return 0; } /** * 加法 * @param x * @param y * @returns */ static add(x: number, y: number): number { return NumberUtil.addDecimal(x, y).toNumber(); } /** * 减法 * @param x * @param y * @returns */ static sub(x: number, y: number): number { return NumberUtil.subDecimal(x, y).toNumber(); } /** * 求和 * @param x * @param y * @returns */ static sum(...n: number[]): number { return NumberUtil.sumDecimal(...n).toNumber(); } /** * 构造Decimal * @param value * @returns */ static toDecimal(value: Value): Decimal { return new Decimal(value); } /** * 加法Decimal * @param x * @param y * @returns */ static addDecimal(x: Value, y: Value): Decimal { return Decimal.add(x, y); } /** * 减法Decimal * @param x * @param y * @returns */ static subDecimal(x: Value, y: Value): Decimal { return Decimal.sub(x, y); } /** * 求和Decimal * @param x * @param y * @returns */ static sumDecimal(...n: Value[]): Decimal { return Decimal.sum(...n); } }
AST#export_declaration#Left export AST#class_declaration#Left class NumberUtil AST#class_body#Left { /** * 检查值是否为NaN * @param value * @returns */ AST#method_declaration#Left static isNaN AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Number AST#expression#Right . isNaN AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 检查值是否为有限数字 * @param value * @returns */ AST#method_declaration#Left static isFinite AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Number AST#expression#Right . isFinite AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 检查值是否为整数 * @param value * @returns */ AST#method_declaration#Left static isInteger AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Number AST#expression#Right . isInteger AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 检查值是否为安全整数 * @param value * @returns */ AST#method_declaration#Left static isSafeInteger AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Number AST#expression#Right . isSafeInteger AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 判断是否是数值 * @param value 需要判断的参数 */ AST#method_declaration#Left static isNumber AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#unary_expression#Left typeof AST#expression#Left value AST#expression#Right AST#unary_expression#Right AST#expression#Right === AST#expression#Left "number" AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right && AST#expression#Left AST#unary_expression#Left ! AST#expression#Left NumberUtil AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . isNaN AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 检查数字是否为偶数 * @param {number} num - 要检查的数字 * @returns {boolean} 如果是偶数返回 true,否则返回 false */ AST#method_declaration#Left static isEven AST#parameter_list#Left ( AST#parameter#Left num : 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 boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left num AST#expression#Right % AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 检查数字是否为奇数 * @param {number} num - 要检查的数字 * @returns {boolean} 如果是奇数返回 true,否则返回 false */ AST#method_declaration#Left static isOdd AST#parameter_list#Left ( AST#parameter#Left num : 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 boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left num AST#expression#Right % AST#expression#Left 2 AST#expression#Right AST#binary_expression#Right AST#expression#Right !== AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 将字符串转换为Number。 * @param value 要转换的字符串 * @param defaultValue 异常时给默认值 * @returns */ AST#method_declaration#Left static toNumber 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#Left defaultValue : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left Number AST#expression#Right . NaN AST#member_expression#Right AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left num = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left Number AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . valueOf AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left isNaN AST#expression#Right AST#argument_list#Left ( AST#expression#Left num AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left defaultValue AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left num AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 将字符串转换为整数。 * @param value 要转换的字符串 * @param defaultValue 异常时给默认值 * @returns */ AST#method_declaration#Left static toInt 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#Left defaultValue : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left Number AST#expression#Right . NaN AST#member_expression#Right AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left parseValue = AST#expression#Left AST#call_expression#Left AST#expression#Left parseInt AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left isNaN AST#expression#Right AST#argument_list#Left ( AST#expression#Left parseValue AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left defaultValue AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left parseValue AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 将字符串转换为浮点数。 * @param value 要转换的字符串 * @param defaultValue 异常时给默认值 * @returns */ AST#method_declaration#Left static toFloat 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#Left defaultValue : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left Number AST#expression#Right . NaN AST#member_expression#Right AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left parseValue = AST#expression#Left AST#call_expression#Left AST#expression#Left parseFloat AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left isNaN AST#expression#Right AST#argument_list#Left ( AST#expression#Left parseValue AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left defaultValue AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left parseValue AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 计算数字的平均值 * @param numbers - 要计算的数字列表 * @returns 平均值 */ AST#method_declaration#Left static average AST#parameter_list#Left ( AST#parameter#Left ... numbers : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) 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#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left numbers AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left sum = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left numbers AST#expression#Right . reduce AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left acc AST#parameter#Right , AST#parameter#Left num AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#binary_expression#Left AST#expression#Left acc AST#expression#Right + AST#expression#Left num AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right , AST#expression#Left 0 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left sum AST#expression#Right / AST#expression#Left numbers AST#expression#Right AST#binary_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left 0 AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 加法 * @param x * @param y * @returns */ AST#method_declaration#Left static add 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#type_annotation#Right AST#parameter#Right ) 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#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left NumberUtil AST#expression#Right . addDecimal AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left x AST#expression#Right , AST#expression#Left y AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . toNumber AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 减法 * @param x * @param y * @returns */ AST#method_declaration#Left static sub 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#type_annotation#Right AST#parameter#Right ) 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#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left NumberUtil AST#expression#Right . subDecimal AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left x AST#expression#Right , AST#expression#Left y AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . toNumber AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 求和 * @param x * @param y * @returns */ AST#method_declaration#Left static sum AST#parameter_list#Left ( AST#parameter#Left ... n : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) 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#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left NumberUtil AST#expression#Right . sumDecimal AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#spread_element#Left ... AST#expression#Left n AST#expression#Right AST#spread_element#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . toNumber AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 构造Decimal * @param value * @returns */ AST#method_declaration#Left static toDecimal AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Value AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Decimal 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_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Decimal AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left value AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 加法Decimal * @param x * @param y * @returns */ AST#method_declaration#Left static addDecimal AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left Value AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left Value AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Decimal 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_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Decimal AST#expression#Right . add AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left x AST#expression#Right , AST#expression#Left y AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 减法Decimal * @param x * @param y * @returns */ AST#method_declaration#Left static subDecimal AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left Value AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left Value AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Decimal 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_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Decimal AST#expression#Right . sub AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left x AST#expression#Right , AST#expression#Left y AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right /** * 求和Decimal * @param x * @param y * @returns */ AST#method_declaration#Left static sumDecimal AST#parameter_list#Left ( AST#parameter#Left ... n : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Value [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Decimal 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_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Decimal AST#expression#Right . sum AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#spread_element#Left ... AST#expression#Left n AST#expression#Right AST#spread_element#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export class NumberUtil { static isNaN(value: Any): boolean { return Number.isNaN(value); } static isFinite(value: Any): boolean { return Number.isFinite(value); } static isInteger(value: Any): boolean { return Number.isInteger(value); } static isSafeInteger(value: Any): boolean { return Number.isSafeInteger(value); } static isNumber(value: Any): boolean { return (typeof value === "number") && !NumberUtil.isNaN(value); } static isEven(num: number): boolean { return num % 2 === 0; } static isOdd(num: number): boolean { return num % 2 !== 0; } static toNumber(value: string, defaultValue: number = Number.NaN): number { let num = Number(value).valueOf(); if (isNaN(num)) { return defaultValue; } return num } static toInt(value: string, defaultValue: number = Number.NaN): number { const parseValue = parseInt(value); if (isNaN(parseValue)) { return defaultValue; } return parseValue; } static toFloat(value: string, defaultValue: number = Number.NaN): number { const parseValue = parseFloat(value); if (isNaN(parseValue)) { return defaultValue; } return parseValue; } static average(...numbers: number[]): number { if (numbers.length > 0) { const sum = numbers.reduce((acc, num) => acc + num, 0); return sum / numbers.length; } return 0; } static add(x: number, y: number): number { return NumberUtil.addDecimal(x, y).toNumber(); } static sub(x: number, y: number): number { return NumberUtil.subDecimal(x, y).toNumber(); } static sum(...n: number[]): number { return NumberUtil.sumDecimal(...n).toNumber(); } static toDecimal(value: Value): Decimal { return new Decimal(value); } static addDecimal(x: Value, y: Value): Decimal { return Decimal.add(x, y); } static subDecimal(x: Value, y: Value): Decimal { return Decimal.sub(x, y); } static sumDecimal(...n: Value[]): Decimal { return Decimal.sum(...n); } }
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/utils/NumberUtil.ets#L27-L226
8a0c1303af8c678d9ab3224fcdc27ff15e1841dc
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamPage.ets
arkts
navigateToCreateDream
点击创建新梦想
navigateToCreateDream() { router.pushUrl({ url: 'pages/dream/DreamEditPage' }); }
AST#method_declaration#Left navigateToCreateDream 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 router AST#expression#Right . pushUrl AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left url AST#property_name#Right : AST#expression#Left 'pages/dream/DreamEditPage' AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
navigateToCreateDream() { router.pushUrl({ url: 'pages/dream/DreamEditPage' }); }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamPage.ets#L103-L107
98f9f64abf1fbd519d4d2eaeb2a50462ee5eb1b5
github
Classaspen/ArkTS_PasswordManagement.git
66aea6e4f8ee3a78e5029c63186dba70707ca2d9
entry/src/main/ets/components/database/Database.ets
arkts
initialize
添加初始化状态标识
async initialize(tablename: string, context: Context): Promise<void> { if (this.isInitialized) return; try { // 创建新数据库 this.store = await relationalStore.getRdbStore(context, CommonConstants.STORE_CONFIG); hilog.info(0x0000, 'DB', 'RdbStore instance created'); // 先执行建表语句 const createTableSQL = `CREATE TABLE IF NOT EXISTS ${tablename} ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, content TEXT NOT NULL, timestamp INTEGER NOT NULL )`; await this.store.executeSql(createTableSQL); console.info(`Table ${tablename} created or already exists`); // 然后进行表结构校验(如果需要) await this.checkTableSchema(tablename); this.isInitialized = true; hilog.info(0x0000, 'DB', 'Database initialized successfully'); } catch (err) { hilog.error(0x0000, 'DB', `Database operation failed: ${err.message}`); throw new Error(`Initialize failed: ${err.message}`); } }
AST#method_declaration#Left async initialize AST#parameter_list#Left ( AST#parameter#Left tablename : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#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#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isInitialized AST#member_expression#Right AST#expression#Right ) AST#statement#Left AST#return_statement#Left return ; AST#return_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { // 创建新数据库 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . store AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left relationalStore AST#expression#Right AST#await_expression#Right AST#expression#Right . getRdbStore AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left context AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left CommonConstants AST#expression#Right . STORE_CONFIG AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0000 AST#expression#Right , AST#expression#Left 'DB' AST#expression#Right , AST#expression#Left 'RdbStore instance created' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 先执行建表语句 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left createTableSQL = AST#expression#Left AST#template_literal#Left ` CREATE TABLE IF NOT EXISTS AST#template_substitution#Left $ { AST#expression#Left tablename AST#expression#Right } AST#template_substitution#Right ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, content TEXT NOT NULL, timestamp INTEGER NOT NULL ) ` AST#template_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . store AST#member_expression#Right AST#expression#Right . executeSql AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left createTableSQL AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` Table AST#template_substitution#Left $ { AST#expression#Left tablename AST#expression#Right } AST#template_substitution#Right created or already exists ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right // 然后进行表结构校验(如果需要) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left this AST#expression#Right AST#await_expression#Right AST#expression#Right . checkTableSchema AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left tablename AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isInitialized AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0000 AST#expression#Right , AST#expression#Left 'DB' AST#expression#Right , AST#expression#Left 'Database initialized successfully' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( err ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left hilog AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 0x0000 AST#expression#Right , AST#expression#Left 'DB' AST#expression#Right , AST#expression#Left AST#template_literal#Left ` Database operation failed: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left err AST#expression#Right . message AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` Initialize failed: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left err AST#expression#Right . message AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async initialize(tablename: string, context: Context): Promise<void> { if (this.isInitialized) return; try { this.store = await relationalStore.getRdbStore(context, CommonConstants.STORE_CONFIG); hilog.info(0x0000, 'DB', 'RdbStore instance created'); const createTableSQL = `CREATE TABLE IF NOT EXISTS ${tablename} ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, content TEXT NOT NULL, timestamp INTEGER NOT NULL )`; await this.store.executeSql(createTableSQL); console.info(`Table ${tablename} created or already exists`); await this.checkTableSchema(tablename); this.isInitialized = true; hilog.info(0x0000, 'DB', 'Database initialized successfully'); } catch (err) { hilog.error(0x0000, 'DB', `Database operation failed: ${err.message}`); throw new Error(`Initialize failed: ${err.message}`); } }
https://github.com/Classaspen/ArkTS_PasswordManagement.git/blob/66aea6e4f8ee3a78e5029c63186dba70707ca2d9/entry/src/main/ets/components/database/Database.ets#L43-L71
3c72044e6e4da23a3952b59cf15c08466a3878a1
github
from-north-to-north/OpenHarmony_p7885
f6ea526c039db535a7c958fa154ccfcb3668b37c
hap/easy_demo/audio-native-master/entry/src/main/ets/constants/CommonConstants.ets
arkts
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
export default class CommonConstants { /** * Hundred percent. */ static readonly FULL_PERCENT: string = '100%'; /** * Default column space. */ static readonly COLUMN_DEFAULT_SPACE: string = '12vp'; /** * Pause position x. */ static readonly PAUSE_POSITION_X: string = '80%'; /** * Record position y. */ static readonly RECORD_POSITION_Y: string = '82%'; /** * Play status. */ static readonly PLAY_INIT: string = 'init'; /** * Play status. */ static readonly PLAY_STARTED: string = 'started'; /** * Play status. */ static readonly PLAY_CONTINUED: string = 'continued'; /** * Play status. */ static readonly PLAY_PAUSED: string = 'paused'; /** * Play status. */ static readonly PLAY_STOPPED: string = 'stopped'; /** * Device phone. */ static readonly DEVICE_PHONE: string = 'phone'; /** * The minimum duration of audio recording is limited. */ static readonly MIN_RECORD_SECOND: number = 5; /** * Total audio recording duration. */ static readonly TOTAL_SECOND: number = 30; /** * Timer delay. */ static readonly INTERVAL_TIME: number = 1000; /** * Font weight. */ static readonly FONT_WIGHT_500: number = 500; /** * Opacity. */ static readonly COMMON_OPACITY: number = 0.6; /** * Opacity. */ static readonly AUDIO_OPACITY: number = 0.4; }
AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * Hundred percent. */ AST#property_declaration#Left static readonly FULL_PERCENT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '100%' AST#expression#Right ; AST#property_declaration#Right /** * Default column space. */ AST#property_declaration#Left static readonly COLUMN_DEFAULT_SPACE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '12vp' AST#expression#Right ; AST#property_declaration#Right /** * Pause position x. */ AST#property_declaration#Left static readonly PAUSE_POSITION_X : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '80%' AST#expression#Right ; AST#property_declaration#Right /** * Record position y. */ AST#property_declaration#Left static readonly RECORD_POSITION_Y : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '82%' AST#expression#Right ; AST#property_declaration#Right /** * Play status. */ AST#property_declaration#Left static readonly PLAY_INIT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'init' AST#expression#Right ; AST#property_declaration#Right /** * Play status. */ AST#property_declaration#Left static readonly PLAY_STARTED : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'started' AST#expression#Right ; AST#property_declaration#Right /** * Play status. */ AST#property_declaration#Left static readonly PLAY_CONTINUED : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'continued' AST#expression#Right ; AST#property_declaration#Right /** * Play status. */ AST#property_declaration#Left static readonly PLAY_PAUSED : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'paused' AST#expression#Right ; AST#property_declaration#Right /** * Play status. */ AST#property_declaration#Left static readonly PLAY_STOPPED : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'stopped' AST#expression#Right ; AST#property_declaration#Right /** * Device phone. */ AST#property_declaration#Left static readonly DEVICE_PHONE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'phone' AST#expression#Right ; AST#property_declaration#Right /** * The minimum duration of audio recording is limited. */ AST#property_declaration#Left static readonly MIN_RECORD_SECOND : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 5 AST#expression#Right ; AST#property_declaration#Right /** * Total audio recording duration. */ AST#property_declaration#Left static readonly TOTAL_SECOND : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 30 AST#expression#Right ; AST#property_declaration#Right /** * Timer delay. */ AST#property_declaration#Left static readonly INTERVAL_TIME : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1000 AST#expression#Right ; AST#property_declaration#Right /** * Font weight. */ AST#property_declaration#Left static readonly FONT_WIGHT_500 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 500 AST#expression#Right ; AST#property_declaration#Right /** * Opacity. */ AST#property_declaration#Left static readonly COMMON_OPACITY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.6 AST#expression#Right ; AST#property_declaration#Right /** * Opacity. */ AST#property_declaration#Left static readonly AUDIO_OPACITY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0.4 AST#expression#Right ; AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export default class CommonConstants { static readonly FULL_PERCENT: string = '100%'; static readonly COLUMN_DEFAULT_SPACE: string = '12vp'; static readonly PAUSE_POSITION_X: string = '80%'; static readonly RECORD_POSITION_Y: string = '82%'; static readonly PLAY_INIT: string = 'init'; static readonly PLAY_STARTED: string = 'started'; static readonly PLAY_CONTINUED: string = 'continued'; static readonly PLAY_PAUSED: string = 'paused'; static readonly PLAY_STOPPED: string = 'stopped'; static readonly DEVICE_PHONE: string = 'phone'; static readonly MIN_RECORD_SECOND: number = 5; static readonly TOTAL_SECOND: number = 30; static readonly INTERVAL_TIME: number = 1000; static readonly FONT_WIGHT_500: number = 500; static readonly COMMON_OPACITY: number = 0.6; static readonly AUDIO_OPACITY: number = 0.4; }
https://github.com/from-north-to-north/OpenHarmony_p7885/blob/f6ea526c039db535a7c958fa154ccfcb3668b37c/hap/easy_demo/audio-native-master/entry/src/main/ets/constants/CommonConstants.ets#L16-L95
ed122cc2b44d409579e1aff60b785c8cbe7f5df3
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
entry/src/main/ets/pages/scrollingCharts/data/Sine.ets
arkts
Copyright (C) 2022 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
export default class Sine { public data: number[] = [ 0.0, //#0 0.019998666246387648, //#1 0.039989333293279646, //#2 0.059964005140753354, //#3 0.07991469218675235, //#4 0.0998334181294999, //#5 0.11971221202299985, //#6 0.1395431152344512, //#7 0.15931820308364608, //#8 0.17902956580240917, //#9 0.19866931911175714, //#10 0.21822960737550368, //#11 0.23770260674240787, //#12 0.25708054267594205, //#13 0.2763556497097811, //#14 0.29552021804983797, //#15 0.31456658211607685, //#16 0.33348712360864613, //#17 0.35227427455509996, //#18 0.3709205203374898, //#19 0.38941840269811434, //#20 0.40776052272272667, //#21 0.42593954380000415, //#22 0.4439481945560986, //#23 0.46177927176309164, //#24 0.4794256432201933, //#25 0.49688022474350485, //#26 0.5141360611809643, //#27 0.5311862504412359, //#28 0.5480239726889556, //#29 0.5646424930725696, //#30 0.5810351644181799, //#31 0.5971954298883201, //#32 0.6131168256045979, //#33 0.6287929832331555, //#34 0.6442176325319131, //#35 0.659384603858578, //#36 0.6742878306384138, //#37 0.6889213517907848, //#38 0.7032793141135052, //#39 0.7173559746240362, //#40 0.7311457028565987, //#41 0.7446429831142805, //#42 0.7578424166752367, //#43 0.7707387239521026, //#44 0.7833267466037546, //#45 0.795601449598573, //#46 0.8075579232283849, //#47 0.8191913850722774, //#48 0.8304971819094986, //#49 0.8414707915806806, //#50 0.8521078247966395, //#51 0.8624040268940288, //#52 0.8723552795371456, //#53 0.8819576023652057, //#54 0.8912071545844327, //#55 0.9001002365043209, //#56 0.9086332910174598, //#57 0.9168029050223264, //#58 0.9246058107884779, //#59 0.9320388872635981, //#60 0.9390991613218737, //#61 0.9457838089532035, //#62 0.952090156392762, //#63 0.9580156811904679, //#64 0.9635580132199286, //#65 0.9687149356264573, //#66 0.9734843857137836, //#67 0.9778644557691029, //#68 0.9818533938261347, //#69 0.9854496043658845, //#70 0.9886516489548286, //#71 0.9914582468202678, //#72 0.9938682753626178, //#73 0.9958807706044335, //#74 0.9974949275759862, //#75 0.9987101006372409, //#76 0.9995258037361018, //#77 0.9999417106028279, //#78 0.9999576548805349, //#79 0.9995736301917366, //#80 0.9987897901408953, //#81 0.9976064482529823, //#82 0.9960240778480722, //#83 0.9940433118520219, //#84 0.9916649425433088, //#85 0.988889921236131, //#86 0.9857193578998942, //#87 0.9821545207152407, //#88 0.9781968355667943, //#89 0.9738478854728265, //#90 0.9691094099520721, //#91 0.9639833043279455, //#92 0.9584716189704385, //#93 0.9525765584760014, //#94 0.9463004807857347, //#95 0.9396458962422467, //#96 0.9326154665855515, //#97 0.9252120038884106, //#98 0.9174384694315432, //#99 0.909297972519156, //#100 0.9007937174689649, //#101 0.8919292072378467, //#102 0.8827079378965067, //#103 0.8731335978226978, //#104 0.8632100166174893, //#105 0.85294116357348, //#106 0.8423311460871373, //#107 0.8313842080158964, //#108 0.8201047279806774, //#109 0.8084972176144982, //#110 0.7965663197578854, //#111 0.7843168066018031, //#112 0.7717535777788443, //#113 0.7588816584034461, //#114 0.7457061970619157, //#115 0.7322324637530676, //#116 0.7184658477802992, //#117 0.7044118555959447, //#118 0.6900761085987721, //#119 0.6754643408855032, //#120 0.660582396957255, //#121 0.6454362293818222, //#122 0.630031896412734, //#123 0.6143755595660381, //#124 0.5984734811557804, //#125 0.5823320217891688, //#126 0.5659576378224191, //#127 0.5493568787783043, //#128 0.5325363847264367, //#129 0.5155028836273348, //#130 0.498263188641333, //#131 0.48082419540341453, //#132 0.46319287926505354, //#133 0.44537629250417365, //#134 0.42738156150433587, //#135 0.4092158839042855, //#136 0.39088652571899846, //#137 0.37240081843337736, //#138 0.3537661560697612, //#139 0.33498999223042036, //#140 0.3160798371162209, //#141 0.29704325452265024, //#142 0.2778878588144052, //#143 0.25862131187975385, //#144 0.2392513200658879, //#145 0.21978563109649268, //#146 0.20023203097276676, //#147 0.1805983408591312, //#148 0.1608924139548741, //#149 0.1411221323529816, //#150 0.12129540388741163, //#151 0.10142015897007202, //#152 0.08150434741876739, //#153 0.06155593527738411, //#154 0.04158290162958502, //#155 0.02159323540728851, //#156 0.0015949321952082743, //#157 -0.01840400896726781, //#158 -0.038395588785580706, //#159 -0.05837181090960527, //#160 -0.07832468513207759, //#161 -0.09824623058456528, //#162 -0.11812847892970231, //#163 -0.13796347754841165, //#164 -0.15774329272084087, //#165 -0.1774600127997381, //#166 -0.19710575137499955, //#167 -0.2166726504281223, //#168 -0.23615288347530097, //#169 -0.2555386586979109, //#170 -0.2748222220591258, //#171 -0.29399586040542314, //#172 -0.3130519045517368, //#173 -0.33198273234902315, //#174 -0.350780771733013, //#175 -0.36943850375293075, //#176 -0.38794846557896867, //#177 -0.40630325348731355, //#178 -0.42449552582153194, //#179 -0.44251800592912927, //#180 -0.4603634850721081, //#181 -0.47802482531036194, //#182 -0.49549496235675056, //#183 -0.5127669084027151, //#184 -0.5298337549133033, //#185 -0.5466886753904862, //#186 -0.5633249281036602, //#187 -0.5797358587862456, //#188 -0.5959149032972986, //#189 -0.6118555902470753, //#190 -0.6275515435854963, //#191 -0.6429964851524771, //#192 -0.6581842371891036, //#193 -0.6731087248086483, //#194 -0.6877639784264394, //#195 -0.7021441361476113, //#196 -0.7162434461117786, //#197 -0.7300562687937001, //#198 -0.7435770792590093, //#199 -0.7568004693741099, //#200 -0.7697213021710452, //#201 -0.7823341014558161, //#202 -0.7946339781278204, //#203 -0.806616012409769, //#204 -0.8182754116568484, //#205 -0.8296075122737109, //#206 -0.8406077815798478, //#207 -0.8512718196225969, //#208 -0.8615953609370618, //#209 -0.8715742762522378, //#210 -0.8812045741426621, //#211 -0.8904824026249275, //#212 -0.8994040506984219, //#213 -0.9079659498296758, //#214 -0.9161646753797257, //#215 -0.923996947973921, //#216 -0.9314596348136281, //#217 -0.9385497509293057, //#218 -0.9452644603744499, //#219 -0.9516010773599336, //#220 -0.9575570673282837, //#221 -0.9631300479674688, //#222 -0.9683177901637904, //#223 -0.9731182188934963, //#224 -0.9775294140527618, //#225 -0.9815496112257037, //#226 -0.9851772023901216, //#227 -0.9884107365606845, //#228 -0.991248920369304, //#229 -0.9936906185824641, //#230 -0.9957348545552975, //#231 -0.997380810622231, //#232 -0.9986278284240393, //#233 -0.9994754091711795, //#234 -0.9999232138433003, //#235 -0.9999710633248452, //#236 -0.999618938476696, //#237 -0.9988669801438286, //#238 -0.9977154890989762, //#239 -0.9961649259223255, //#240 -0.9942159108172903, //#241 -0.9918692233624392, //#242 -0.989125802199675, //#243 -0.9859867446587918, //#244 -0.9824533063185572, //#245 -0.9785269005045, //#246 -0.9742090977235991, //#247 -0.9695016250361028, //#248 -0.9644063653647295, //#249 -0.9589253567415246, //#250 -0.953060791492677, //#251 -0.9468150153616188, //#252 -0.940190526570762, //#253 -0.9331899748222436, //#254 -0.9258161602380832, //#255 -0.9180720322401726, //#256 -0.9099606883705496, //#257 -0.901485373052424, //#258 -0.8926494762924547, //#259 -0.8834565323247946, //#260 -0.8739102181974464, //#261 -0.864014352301496, //#262 -0.8537728928438092, //#263 -0.8431899362638049, //#264 -0.8322697155949375, //#265 -0.8210165987715422, //#266 -0.8094350868817244, //#267 -0.7975298123669863, //#268 -0.7853055371693165, //#269 -0.7727671508264802, //#270 -0.7599196685162729, //#271 -0.7467682290505201, //#272 -0.7333180928196247, //#273 -0.7195746396884855, //#274 -0.7055433668446264, //#275 -0.6912298865993995, //#276 -0.6766399241431399, //#277 -0.6617793152551689, //#278 -0.646654003969566, //#279 -0.6312700401976384, //#280 -0.6156335773080419, //#281 -0.5997508696655202, //#282 -0.5836282701292467, //#283 -0.5672722275117711, //#284 -0.5506892839995849, //#285 -0.5338860725363392, //#286 -0.5168693141697605, //#287 -0.4996458153633263, //#288 -0.48222246527377605, //#289 -0.4646062329955453, //#290 -0.44680416477322615, //#291 -0.42882338118316876, //#292 -0.4106710742853512, //#293 -0.392354504746657, //#294 -0.37388099893671045, //#295 -0.3552579459974321, //#296 -0.33649279488748635, //#297 -0.31759305140280275, //#298 -0.2985662751743636, //#299 -0.27942007664445806, //#300 -0.2601621140226123, //#301 -0.24080009022241405, //#302 -0.22134174978045548, //#303 -0.2017948757586277, //#304 -0.18216728663100587, //#305 -0.1624668331565697, //#306 -0.1427013952390105, //#307 -0.12287887877488078, //#308 -0.10300721249134719, //#309 -0.08309434477481123, //#310 -0.06314824049166687, //#311 -0.04317687780246621, //#312 -0.02318824497076772, //#313 -0.0031903371679434384, //#314 0.016808846724776887, //#315 0.03680130731574554, //#316 0.056779047902540736, //#317 0.07673407767053486, //#318 0.09665841488910769, //#319 0.11654409010422613, //#320 0.13638314932611348, //#321 0.1561676572107332, //#322 0.17588970023381478, //#323 0.19554138985615177, //#324 0.21511486567890625, //#325 0.23460229858765777, //#326 0.2539958938839385, //#327 0.2732878944030029, //#328 0.2924705836165842, //#329 0.311536288719397, //#330 0.3304773836981512, //#331 0.3492862923818499, //#332 0.3679554914721506, //#333 0.38647751355257925, //#334 0.40484495007539084, //#335 0.42305045432488436, //#336 0.44108674435598566, //#337 0.45894660590692266, //#338 0.4766228952848283, //#339 0.49410854222311723, //#340 0.5113965527094926, //#341 0.5284800117834523, //#342 0.545352086302176, //#343 0.5620060276736858, //#344 0.5784351745561876, //#345 0.5946329555225146, //#346 0.6105928916886046, //#347 0.6263085993049634, //#348 0.6417737923100737, //#349 0.6569822848447313, //#350 0.6719279937263022, //#351 0.6866049408819089, //#352 0.7010072557395762, //#353 0.7151291775763766, //#354 0.7289650578226388, //#355 0.7425093623212952, //#356 0.7557566735414675, //#357 0.7687016927454025, //#358 0.781339242107892, //#359 0.7936642667873305, //#360 0.8056718369475803, //#361 0.8173571497298365, //#362 0.8287155311737031, //#363 0.8397424380867105, //#364 0.8504334598615295, //#365 0.8607843202401511, //#366 0.8707908790243301, //#367 0.8804491337316057, //#368 0.8897552211962383, //#369 0.8987054191144209, //#370 0.9072961475331487, //#371 0.9155239702821494, //#372 0.9233855963483032, //#373 0.9308778811920015, //#374 0.9379978280049185, //#375 0.9447425889086918, //#376 0.9511094660940346, //#377 0.9570959128998204, //#378 0.9626995348317123, //#379 0.9679180905199263, //#380 0.9727494926157481, //#381 0.977191808626443, //#382 0.9812432616882257, //#383 0.9849022312769813, //#384 0.988167253856451, //#385 0.991037023463627, //#386 0.9935103922311188, //#387 0.9955863708462842, //#388 0.9972641289469402, //#389 0.9985429954534961, //#390 0.9994224588373765, //#391 0.9999021673256246, //#392 0.9999819290416072, //#393 0.9996617120817624, //#394 0.9989416445283599, //#395 0.9978220143982713, //#396 0.9963032695277663, //#397 0.9943860173933846, //#398 0.9920710248689544, //#399 0.9893592179188533, //#400 0.986251602430098, //#401 0.9827494813924079, //#402 0.9788542556716259, //#403 0.9745674833774243, //#404 0.9698908792400535, //#405 0.9648263139244408, //#406 0.959375813281916, //#407 0.9535415575398596, //#408 0.947325880429602, //#409 0.9407312682529189, //#410 0.9337603588874981, //#411 0.9264159407317759, //#412 0.918700951589563, //#413 0.9106184774949092, //#414 0.9021717514776737, //#415 0.8933641522702975, //#416 0.8841992029562936, //#417 0.8746805695609958, //#418 0.8648120595851305, //#419 0.8545976204817978, //#420 0.8440413380774695, //#421 0.8331474349376399, //#422 0.8219202686777767, //#423 0.8103643302202548, //#424 0.7984842419979638, //#425 0.7862847561053125, //#426 0.7737707523973671, //#427 0.7609472365378854, //#428 0.7478193379970259, //#429 0.7343923079995343, //#430 0.7206715174242275, //#431 0.7066624546556156, //#432 0.6923707233885205, //#433 0.67780204038657, //#434 0.6629622331954643, //#435 0.6478572378119283, //#436 0.6324930963092836, //#437 0.6168759544205892, //#438 0.6010120590803173, //#439 0.5849077559255487, //#440 0.5685694867576866, //#441 0.5520037869657035, //#442 0.5352172829119535, //#443 0.5182166892815939, //#444 0.5010088063966786, //#445 0.48360051749599425, //#446 0.4659987859817315, //#447 0.44821065263408894, //#448 0.4302432327949262, //#449 0.4121037135215916, //#450 0.39379935071206357, //#451 0.3753374662025555, //#452 0.35672544483874447, //#453 0.3379707315217965, //#454 0.31908082823036904, //#455 0.30006329101978185, //#456 0.2809257269995578, //#457 0.2616757912905407, //#458 0.2423211839628092, //#459 0.2228696469556102, //#460 0.2033289609805449, //#461 0.18370694240924518, //#462 0.16401144014678615, //#463 0.14425033249208516, //#464 0.12443152398654284, //#465 0.10456294225218733, //#466 0.084652534820586, //#467 0.06470826595379324, //#468 0.04473811345860604, //#469 0.024750065495401534, //#470 0.004752117382833131, //#471 -0.015247731600336746, //#472 -0.03524148141498798, //#473 -0.05522113446169821, //#474 -0.0751786987798224, //#475 -0.09510619124431689, //#476 -0.11499564075902909, //#477 -0.13483909144517564, //#478 -0.15462860582373356, //#479 -0.17435626799047124, //#480 -0.19401418678234966, //#481 -0.21359449893402682, //#482 -0.23308937222320295, //#483 -0.25249100860354845, //#484 -0.27179164732396127, //#485 -0.290983568032906, //#486 -0.3100590938665927, //#487 -0.32901059451976084, //#488 -0.3478304892978393, //#489 -0.36651125014926184, //#490 -0.3850454046767254, //#491 -0.40342553912618595, //#492 -0.42164430135239717, //#493 -0.4396944037598051, //#494 -0.4575686262176226, //#495 -0.4752598189479177, //#496 -0.49276090538556006, //#497 -0.5100648850088826, //#498 -0.5271648361399248, //#499 -0.5440539187131385, //#500 -0.5607253770114478, //#501 -0.5771725423685697, //#502 -0.5933888358365144, //#503 -0.6093677708171961, //#504 -0.625102955657105, //#505 -0.6405880962040014, //#506 -0.6558169983246062, //#507 -0.6707835703822864, //#508 -0.6854818256737397, //#509 -0.6999058848237054, //#510 -0.7140499781367439, //#511 -0.7279084479051434, //#512 -0.7414757506720319, //#513 -0.7547464594487863, //#514 -0.7677152658858558, //#515 -0.780376982396128, //#516 -0.7927265442299892, //#517 -0.8047590115012498, //#518 -0.8164695711631232, //#519 -0.8278535389334684, //#520 -0.8389063611685262, //#521 -0.8496236166843997, //#522 -0.8600010185255492, //#523 -0.8700344156795967, //#524 -0.8797197947377503, //#525 -0.8890532815001886, //#526 -0.8980311425257598, //#527 -0.9066497866253763, //#528 -0.9149057662985087, //#529 -0.9227957791122028, //#530 -0.9303166690220693, //#531 -0.9374654276347177, //#532 -0.9442391954111279, //#533 -0.9506352628104804, //#534 -0.9566510713739863, //#535 -0.9622842147482832, //#536 -0.9675324396479887, //#537 -0.9723936467570258, //#538 -0.9768658915683597, //#539 -0.9809473851618101, //#540 -0.9846364949196288, //#541 -0.9879317451795541, //#542 -0.9908318178250837, //#543 -0.9933355528127273, //#544 -0.9954419486360307, //#545 -0.9971501627261821, //#546 -0.9984595117890447, //#547 -0.9993694720784776, //#548 -0.9998796796058368, //#549 -0.9999899302855721, //#550 -0.9997001800168633, //#551 -0.9990105447012596, //#552 -0.9979213001963191, //#553 -0.9964328822052644, //#554 -0.9945458861026987, //#555 -0.9922610666964535, //#556 -0.9895793379256616, //#557 -0.9865017724951763, //#558 -0.9830296014464852, //#559 -0.9791642136652865, //#560 -0.9749071553259283, //#561 -0.9702601292729311, //#562 -0.9652249943398415, //#563 -0.9598037646056896, //#564 -0.9539986085893469, //#565 -0.9478118483821087, //#566 -0.9412459587188456, //#567 -0.9343035659880974, //#568 -0.926987447181504, //#569 -0.9193005287829963, //#570 -0.9112458855981864, //#571 -0.9028267395244314, //#572 -0.8940464582620574, //#573 -0.8849085539672636, //#574 -0.8754166818472415, //#575 -0.8655746386980744, //#576 -0.8553863613859995, //#577 -0.8448559252726426, //#578 -0.8339875425848524, //#579 -0.8227855607297891, //#580 -0.8112544605559403, //#581 -0.7993988545607584, //#582 -0.7872234850456398, //#583 -0.7747332222189794, //#584 -0.7619330622480646, //#585 -0.7488281252605818, //#586 -0.7354236532965415, //#587 -0.7217250082114348, //#588 -0.7077376695314656, //#589 -0.6934672322617121, //#590 -0.6789194046480973, //#591 -0.6641000058940624, //#592 -0.6490149638328556, //#593 -0.6336703125563705, //#594 -0.6180721900014786, //#595 -0.6022268354948238, //#596 -0.5861405872570615, //#597 -0.569819879867538, //#598 -0.5532712416904271, //#599 -0.5365012922633521, //#600 -0.5195167396495373, //#601 -0.5023243777545499, //#602 -0.4849310836087036, //#603 -0.4673438146162124, //#604 -0.44956960577219424, //#605 -0.43161556684863794, //#606 -0.4134888795504591, //#607 -0.3951967946427822, //#608 -0.3767466290505987, //#609 -0.3581457629319605, //#610 -0.33940163672588003, //#611 -0.32052174817611767, //#612 -0.30151364933204683, //#613 -0.28238494352779664, //#614 -0.26314328234088047, //#615 -0.24379636253152692, //#616 -0.2243519229639374, //#617 -0.20481774151070187, //#618 -0.1852016319416111, //#619 -0.16551144079810998, //#620 -0.14575504425464175, //#621 -0.12594034496813916, //#622 -0.10607526891692229, //#623 -0.08616776223026779, //#624 -0.06622578800991763, //#625 -0.04625732314479881, //#626 -0.02627035512022804, //#627 -0.006272878822877913, //#628 0.013727106657217596, //#629 0.03372160122633892, //#630 0.053702606987158195, //#631 0.07366213143793802, //#632 0.0935921906695719, //#633 0.11348481255918764, //#634 0.13333203995903614, //#635 0.1531259338793901, //#636 0.17285857666417945, //#637 0.19252207515809314, //#638 0.21210856386388055, //#639 0.2316102080885896, //#640 0.2510192070774827, //#641 0.2703277971343779, //#642 0.2895282547271654, //#643 0.3086128995772594, //#644 0.3275740977317474, //#645 0.34640426461700946, //#646 0.36509586807258537, //#647 0.38364143136407647, //#648 0.4020335361738763, //#649 0.4202648255685349, //#650 0.43832800694156854, //#651 0.45621585493053873, //#652 0.4739212143072332, //#653 0.49143700283979275, //#654 0.508756214125639, //#655 0.5258719203940706, //#656 0.5427772752774059, //#657 0.5594655165495643, //#658 0.5759299688309899, //#659 0.5921640462588365, //#660 0.6081612551213462, //#661 0.6239151964553658, //#662 0.6394195686059639, //#663 0.6546681697471249, //#664 0.6696549003625094, //#665 0.6843737656852915, //#666 0.6988188780960954, //#667 0.7129844594780727, //#668 0.7268648435281768, //#669 0.740454478023714, //#670 0.7537479270432587, //#671 0.7667398731410499, //#672 0.7794251194739955, //#673 0.7917985918804359, //#674 0.8038553409098333, //#675 0.8155905438025771, //#676 0.8269995064191112, //#677 0.8380776651176137, //#678 0.8488205885794762, //#679 0.8592239795818529, //#680 0.8692836767165718, //#681 0.878995656054718, //#682 0.8883560327562258, //#683 0.8973610626238337, //#684 0.9060071436007824, //#685 0.9142908172116547, //#686 0.9222087699457837, //#687 0.929757834582673, //#688 0.9369349914589009, //#689 0.9437373696760004, //#690 0.9501622482488337, //#691 0.9562070571939989, //#692 0.9618693785578367, //#693 0.9671469473836236, //#694 0.9720376526175663, //#695 0.976539537953233, //#696 0.9806508026140864, //#697 0.9843698020738031, //#698 0.9876950487140919, //#699 0.990625212419749, //#700 0.9931591211107106, //#701 0.9952957612108906, //#702 0.9970342780536162, //#703 0.9983739762234987, //#704 0.9993143198346034, //#705 0.9998549327448063, //#706 0.9999955987062531, //#707 0.999736261451859, //#708 0.9990770247178167, //#709 0.9980181522021, //#710 0.9965600674589848, //#711 0.9947033537296244, //#712 0.99244875370875, //#713 0.9897971692475899, //#714 0.9867496609931237, //#715 0.9833074479638189, //#716 0.9794719070620168, //#717 0.9752445725231655, //#718 0.9706271353021171, //#719 0.9656214423967383, //#720 0.9602294961091015, //#721 0.9544534532445539, //#722 0.9482956242489854, //#723 0.9417584722846377, //#724 0.934844612244828, //#725 0.9275568097079782, //#726 0.9198979798313699, //#727 0.911871186185067, //#728 0.9034796395264725, //#729 0.8947266965160092, //#730 0.8856158583744393, //#731 0.8761507694823586, //#732 0.8663352159224256, //#733 0.8561731239649102, //#734 0.8456685584971658, //#735 0.8348257213976545, //#736 0.8236489498551739, //#737 0.812142714633961, //#738 0.8003116182853636, //#739 0.7881603933067972, //#740 0.7756939002487224, //#741 0.7629171257704004, //#742 0.7498351806452045, //#743 0.7364532977162856, //#744 0.7227768298034087, //#745 0.7088112475617983, //#746 0.6945621372938487, //#747 0.6800351987145765, //#748 0.6652362426717048//#749 ] }
AST#export_declaration#Left export default AST#class_declaration#Left class Sine AST#class_body#Left { AST#property_declaration#Left public data : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#Left 0.0 AST#expression#Right , //#0 AST#expression#Left 0.019998666246387648 AST#expression#Right , //#1 AST#expression#Left 0.039989333293279646 AST#expression#Right , //#2 AST#expression#Left 0.059964005140753354 AST#expression#Right , //#3 AST#expression#Left 0.07991469218675235 AST#expression#Right , //#4 AST#expression#Left 0.0998334181294999 AST#expression#Right , //#5 AST#expression#Left 0.11971221202299985 AST#expression#Right , //#6 AST#expression#Left 0.1395431152344512 AST#expression#Right , //#7 AST#expression#Left 0.15931820308364608 AST#expression#Right , //#8 AST#expression#Left 0.17902956580240917 AST#expression#Right , //#9 AST#expression#Left 0.19866931911175714 AST#expression#Right , //#10 AST#expression#Left 0.21822960737550368 AST#expression#Right , //#11 AST#expression#Left 0.23770260674240787 AST#expression#Right , //#12 AST#expression#Left 0.25708054267594205 AST#expression#Right , //#13 AST#expression#Left 0.2763556497097811 AST#expression#Right , //#14 AST#expression#Left 0.29552021804983797 AST#expression#Right , //#15 AST#expression#Left 0.31456658211607685 AST#expression#Right , //#16 AST#expression#Left 0.33348712360864613 AST#expression#Right , //#17 AST#expression#Left 0.35227427455509996 AST#expression#Right , //#18 AST#expression#Left 0.3709205203374898 AST#expression#Right , //#19 AST#expression#Left 0.38941840269811434 AST#expression#Right , //#20 AST#expression#Left 0.40776052272272667 AST#expression#Right , //#21 AST#expression#Left 0.42593954380000415 AST#expression#Right , //#22 AST#expression#Left 0.4439481945560986 AST#expression#Right , //#23 AST#expression#Left 0.46177927176309164 AST#expression#Right , //#24 AST#expression#Left 0.4794256432201933 AST#expression#Right , //#25 AST#expression#Left 0.49688022474350485 AST#expression#Right , //#26 AST#expression#Left 0.5141360611809643 AST#expression#Right , //#27 AST#expression#Left 0.5311862504412359 AST#expression#Right , //#28 AST#expression#Left 0.5480239726889556 AST#expression#Right , //#29 AST#expression#Left 0.5646424930725696 AST#expression#Right , //#30 AST#expression#Left 0.5810351644181799 AST#expression#Right , //#31 AST#expression#Left 0.5971954298883201 AST#expression#Right , //#32 AST#expression#Left 0.6131168256045979 AST#expression#Right , //#33 AST#expression#Left 0.6287929832331555 AST#expression#Right , //#34 AST#expression#Left 0.6442176325319131 AST#expression#Right , //#35 AST#expression#Left 0.659384603858578 AST#expression#Right , //#36 AST#expression#Left 0.6742878306384138 AST#expression#Right , //#37 AST#expression#Left 0.6889213517907848 AST#expression#Right , //#38 AST#expression#Left 0.7032793141135052 AST#expression#Right , //#39 AST#expression#Left 0.7173559746240362 AST#expression#Right , //#40 AST#expression#Left 0.7311457028565987 AST#expression#Right , //#41 AST#expression#Left 0.7446429831142805 AST#expression#Right , //#42 AST#expression#Left 0.7578424166752367 AST#expression#Right , //#43 AST#expression#Left 0.7707387239521026 AST#expression#Right , //#44 AST#expression#Left 0.7833267466037546 AST#expression#Right , //#45 AST#expression#Left 0.795601449598573 AST#expression#Right , //#46 AST#expression#Left 0.8075579232283849 AST#expression#Right , //#47 AST#expression#Left 0.8191913850722774 AST#expression#Right , //#48 AST#expression#Left 0.8304971819094986 AST#expression#Right , //#49 AST#expression#Left 0.8414707915806806 AST#expression#Right , //#50 AST#expression#Left 0.8521078247966395 AST#expression#Right , //#51 AST#expression#Left 0.8624040268940288 AST#expression#Right , //#52 AST#expression#Left 0.8723552795371456 AST#expression#Right , //#53 AST#expression#Left 0.8819576023652057 AST#expression#Right , //#54 AST#expression#Left 0.8912071545844327 AST#expression#Right , //#55 AST#expression#Left 0.9001002365043209 AST#expression#Right , //#56 AST#expression#Left 0.9086332910174598 AST#expression#Right , //#57 AST#expression#Left 0.9168029050223264 AST#expression#Right , //#58 AST#expression#Left 0.9246058107884779 AST#expression#Right , //#59 AST#expression#Left 0.9320388872635981 AST#expression#Right , //#60 AST#expression#Left 0.9390991613218737 AST#expression#Right , //#61 AST#expression#Left 0.9457838089532035 AST#expression#Right , //#62 AST#expression#Left 0.952090156392762 AST#expression#Right , //#63 AST#expression#Left 0.9580156811904679 AST#expression#Right , //#64 AST#expression#Left 0.9635580132199286 AST#expression#Right , //#65 AST#expression#Left 0.9687149356264573 AST#expression#Right , //#66 AST#expression#Left 0.9734843857137836 AST#expression#Right , //#67 AST#expression#Left 0.9778644557691029 AST#expression#Right , //#68 AST#expression#Left 0.9818533938261347 AST#expression#Right , //#69 AST#expression#Left 0.9854496043658845 AST#expression#Right , //#70 AST#expression#Left 0.9886516489548286 AST#expression#Right , //#71 AST#expression#Left 0.9914582468202678 AST#expression#Right , //#72 AST#expression#Left 0.9938682753626178 AST#expression#Right , //#73 AST#expression#Left 0.9958807706044335 AST#expression#Right , //#74 AST#expression#Left 0.9974949275759862 AST#expression#Right , //#75 AST#expression#Left 0.9987101006372409 AST#expression#Right , //#76 AST#expression#Left 0.9995258037361018 AST#expression#Right , //#77 AST#expression#Left 0.9999417106028279 AST#expression#Right , //#78 AST#expression#Left 0.9999576548805349 AST#expression#Right , //#79 AST#expression#Left 0.9995736301917366 AST#expression#Right , //#80 AST#expression#Left 0.9987897901408953 AST#expression#Right , //#81 AST#expression#Left 0.9976064482529823 AST#expression#Right , //#82 AST#expression#Left 0.9960240778480722 AST#expression#Right , //#83 AST#expression#Left 0.9940433118520219 AST#expression#Right , //#84 AST#expression#Left 0.9916649425433088 AST#expression#Right , //#85 AST#expression#Left 0.988889921236131 AST#expression#Right , //#86 AST#expression#Left 0.9857193578998942 AST#expression#Right , //#87 AST#expression#Left 0.9821545207152407 AST#expression#Right , //#88 AST#expression#Left 0.9781968355667943 AST#expression#Right , //#89 AST#expression#Left 0.9738478854728265 AST#expression#Right , //#90 AST#expression#Left 0.9691094099520721 AST#expression#Right , //#91 AST#expression#Left 0.9639833043279455 AST#expression#Right , //#92 AST#expression#Left 0.9584716189704385 AST#expression#Right , //#93 AST#expression#Left 0.9525765584760014 AST#expression#Right , //#94 AST#expression#Left 0.9463004807857347 AST#expression#Right , //#95 AST#expression#Left 0.9396458962422467 AST#expression#Right , //#96 AST#expression#Left 0.9326154665855515 AST#expression#Right , //#97 AST#expression#Left 0.9252120038884106 AST#expression#Right , //#98 AST#expression#Left 0.9174384694315432 AST#expression#Right , //#99 AST#expression#Left 0.909297972519156 AST#expression#Right , //#100 AST#expression#Left 0.9007937174689649 AST#expression#Right , //#101 AST#expression#Left 0.8919292072378467 AST#expression#Right , //#102 AST#expression#Left 0.8827079378965067 AST#expression#Right , //#103 AST#expression#Left 0.8731335978226978 AST#expression#Right , //#104 AST#expression#Left 0.8632100166174893 AST#expression#Right , //#105 AST#expression#Left 0.85294116357348 AST#expression#Right , //#106 AST#expression#Left 0.8423311460871373 AST#expression#Right , //#107 AST#expression#Left 0.8313842080158964 AST#expression#Right , //#108 AST#expression#Left 0.8201047279806774 AST#expression#Right , //#109 AST#expression#Left 0.8084972176144982 AST#expression#Right , //#110 AST#expression#Left 0.7965663197578854 AST#expression#Right , //#111 AST#expression#Left 0.7843168066018031 AST#expression#Right , //#112 AST#expression#Left 0.7717535777788443 AST#expression#Right , //#113 AST#expression#Left 0.7588816584034461 AST#expression#Right , //#114 AST#expression#Left 0.7457061970619157 AST#expression#Right , //#115 AST#expression#Left 0.7322324637530676 AST#expression#Right , //#116 AST#expression#Left 0.7184658477802992 AST#expression#Right , //#117 AST#expression#Left 0.7044118555959447 AST#expression#Right , //#118 AST#expression#Left 0.6900761085987721 AST#expression#Right , //#119 AST#expression#Left 0.6754643408855032 AST#expression#Right , //#120 AST#expression#Left 0.660582396957255 AST#expression#Right , //#121 AST#expression#Left 0.6454362293818222 AST#expression#Right , //#122 AST#expression#Left 0.630031896412734 AST#expression#Right , //#123 AST#expression#Left 0.6143755595660381 AST#expression#Right , //#124 AST#expression#Left 0.5984734811557804 AST#expression#Right , //#125 AST#expression#Left 0.5823320217891688 AST#expression#Right , //#126 AST#expression#Left 0.5659576378224191 AST#expression#Right , //#127 AST#expression#Left 0.5493568787783043 AST#expression#Right , //#128 AST#expression#Left 0.5325363847264367 AST#expression#Right , //#129 AST#expression#Left 0.5155028836273348 AST#expression#Right , //#130 AST#expression#Left 0.498263188641333 AST#expression#Right , //#131 AST#expression#Left 0.48082419540341453 AST#expression#Right , //#132 AST#expression#Left 0.46319287926505354 AST#expression#Right , //#133 AST#expression#Left 0.44537629250417365 AST#expression#Right , //#134 AST#expression#Left 0.42738156150433587 AST#expression#Right , //#135 AST#expression#Left 0.4092158839042855 AST#expression#Right , //#136 AST#expression#Left 0.39088652571899846 AST#expression#Right , //#137 AST#expression#Left 0.37240081843337736 AST#expression#Right , //#138 AST#expression#Left 0.3537661560697612 AST#expression#Right , //#139 AST#expression#Left 0.33498999223042036 AST#expression#Right , //#140 AST#expression#Left 0.3160798371162209 AST#expression#Right , //#141 AST#expression#Left 0.29704325452265024 AST#expression#Right , //#142 AST#expression#Left 0.2778878588144052 AST#expression#Right , //#143 AST#expression#Left 0.25862131187975385 AST#expression#Right , //#144 AST#expression#Left 0.2392513200658879 AST#expression#Right , //#145 AST#expression#Left 0.21978563109649268 AST#expression#Right , //#146 AST#expression#Left 0.20023203097276676 AST#expression#Right , //#147 AST#expression#Left 0.1805983408591312 AST#expression#Right , //#148 AST#expression#Left 0.1608924139548741 AST#expression#Right , //#149 AST#expression#Left 0.1411221323529816 AST#expression#Right , //#150 AST#expression#Left 0.12129540388741163 AST#expression#Right , //#151 AST#expression#Left 0.10142015897007202 AST#expression#Right , //#152 AST#expression#Left 0.08150434741876739 AST#expression#Right , //#153 AST#expression#Left 0.06155593527738411 AST#expression#Right , //#154 AST#expression#Left 0.04158290162958502 AST#expression#Right , //#155 AST#expression#Left 0.02159323540728851 AST#expression#Right , //#156 AST#expression#Left 0.0015949321952082743 AST#expression#Right , //#157 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.01840400896726781 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#158 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.038395588785580706 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#159 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.05837181090960527 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#160 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.07832468513207759 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#161 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.09824623058456528 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#162 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.11812847892970231 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#163 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.13796347754841165 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#164 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.15774329272084087 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#165 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.1774600127997381 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#166 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.19710575137499955 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#167 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.2166726504281223 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#168 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.23615288347530097 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#169 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.2555386586979109 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#170 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.2748222220591258 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#171 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.29399586040542314 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#172 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.3130519045517368 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#173 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.33198273234902315 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#174 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.350780771733013 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#175 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.36943850375293075 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#176 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.38794846557896867 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#177 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.40630325348731355 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#178 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.42449552582153194 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#179 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.44251800592912927 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#180 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4603634850721081 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#181 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.47802482531036194 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#182 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.49549496235675056 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#183 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5127669084027151 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#184 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5298337549133033 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#185 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5466886753904862 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#186 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5633249281036602 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#187 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5797358587862456 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#188 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5959149032972986 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#189 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6118555902470753 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#190 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6275515435854963 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#191 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6429964851524771 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#192 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6581842371891036 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#193 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6731087248086483 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#194 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6877639784264394 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#195 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7021441361476113 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#196 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7162434461117786 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#197 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7300562687937001 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#198 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7435770792590093 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#199 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7568004693741099 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#200 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7697213021710452 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#201 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7823341014558161 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#202 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7946339781278204 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#203 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.806616012409769 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#204 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8182754116568484 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#205 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8296075122737109 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#206 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8406077815798478 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#207 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8512718196225969 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#208 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8615953609370618 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#209 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8715742762522378 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#210 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8812045741426621 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#211 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8904824026249275 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#212 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8994040506984219 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#213 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9079659498296758 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#214 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9161646753797257 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#215 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.923996947973921 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#216 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9314596348136281 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#217 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9385497509293057 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#218 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9452644603744499 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#219 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9516010773599336 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#220 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9575570673282837 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#221 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9631300479674688 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#222 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9683177901637904 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#223 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9731182188934963 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#224 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9775294140527618 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#225 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9815496112257037 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#226 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9851772023901216 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#227 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9884107365606845 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#228 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.991248920369304 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#229 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9936906185824641 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#230 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9957348545552975 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#231 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.997380810622231 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#232 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9986278284240393 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#233 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9994754091711795 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#234 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9999232138433003 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#235 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9999710633248452 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#236 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.999618938476696 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#237 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9988669801438286 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#238 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9977154890989762 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#239 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9961649259223255 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#240 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9942159108172903 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#241 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9918692233624392 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#242 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.989125802199675 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#243 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9859867446587918 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#244 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9824533063185572 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#245 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9785269005045 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#246 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9742090977235991 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#247 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9695016250361028 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#248 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9644063653647295 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#249 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9589253567415246 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#250 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.953060791492677 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#251 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9468150153616188 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#252 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.940190526570762 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#253 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9331899748222436 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#254 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9258161602380832 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#255 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9180720322401726 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#256 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9099606883705496 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#257 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.901485373052424 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#258 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8926494762924547 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#259 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8834565323247946 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#260 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8739102181974464 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#261 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.864014352301496 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#262 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8537728928438092 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#263 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8431899362638049 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#264 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8322697155949375 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#265 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8210165987715422 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#266 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8094350868817244 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#267 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7975298123669863 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#268 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7853055371693165 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#269 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7727671508264802 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#270 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7599196685162729 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#271 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7467682290505201 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#272 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7333180928196247 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#273 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7195746396884855 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#274 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7055433668446264 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#275 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6912298865993995 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#276 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6766399241431399 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#277 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6617793152551689 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#278 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.646654003969566 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#279 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6312700401976384 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#280 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6156335773080419 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#281 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5997508696655202 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#282 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5836282701292467 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#283 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5672722275117711 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#284 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5506892839995849 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#285 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5338860725363392 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#286 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5168693141697605 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#287 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4996458153633263 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#288 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.48222246527377605 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#289 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4646062329955453 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#290 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.44680416477322615 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#291 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.42882338118316876 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#292 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4106710742853512 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#293 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.392354504746657 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#294 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.37388099893671045 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#295 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.3552579459974321 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#296 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.33649279488748635 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#297 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.31759305140280275 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#298 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.2985662751743636 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#299 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.27942007664445806 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#300 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.2601621140226123 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#301 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.24080009022241405 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#302 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.22134174978045548 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#303 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.2017948757586277 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#304 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.18216728663100587 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#305 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.1624668331565697 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#306 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.1427013952390105 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#307 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.12287887877488078 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#308 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.10300721249134719 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#309 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.08309434477481123 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#310 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.06314824049166687 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#311 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.04317687780246621 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#312 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.02318824497076772 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#313 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.0031903371679434384 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#314 AST#expression#Left 0.016808846724776887 AST#expression#Right , //#315 AST#expression#Left 0.03680130731574554 AST#expression#Right , //#316 AST#expression#Left 0.056779047902540736 AST#expression#Right , //#317 AST#expression#Left 0.07673407767053486 AST#expression#Right , //#318 AST#expression#Left 0.09665841488910769 AST#expression#Right , //#319 AST#expression#Left 0.11654409010422613 AST#expression#Right , //#320 AST#expression#Left 0.13638314932611348 AST#expression#Right , //#321 AST#expression#Left 0.1561676572107332 AST#expression#Right , //#322 AST#expression#Left 0.17588970023381478 AST#expression#Right , //#323 AST#expression#Left 0.19554138985615177 AST#expression#Right , //#324 AST#expression#Left 0.21511486567890625 AST#expression#Right , //#325 AST#expression#Left 0.23460229858765777 AST#expression#Right , //#326 AST#expression#Left 0.2539958938839385 AST#expression#Right , //#327 AST#expression#Left 0.2732878944030029 AST#expression#Right , //#328 AST#expression#Left 0.2924705836165842 AST#expression#Right , //#329 AST#expression#Left 0.311536288719397 AST#expression#Right , //#330 AST#expression#Left 0.3304773836981512 AST#expression#Right , //#331 AST#expression#Left 0.3492862923818499 AST#expression#Right , //#332 AST#expression#Left 0.3679554914721506 AST#expression#Right , //#333 AST#expression#Left 0.38647751355257925 AST#expression#Right , //#334 AST#expression#Left 0.40484495007539084 AST#expression#Right , //#335 AST#expression#Left 0.42305045432488436 AST#expression#Right , //#336 AST#expression#Left 0.44108674435598566 AST#expression#Right , //#337 AST#expression#Left 0.45894660590692266 AST#expression#Right , //#338 AST#expression#Left 0.4766228952848283 AST#expression#Right , //#339 AST#expression#Left 0.49410854222311723 AST#expression#Right , //#340 AST#expression#Left 0.5113965527094926 AST#expression#Right , //#341 AST#expression#Left 0.5284800117834523 AST#expression#Right , //#342 AST#expression#Left 0.545352086302176 AST#expression#Right , //#343 AST#expression#Left 0.5620060276736858 AST#expression#Right , //#344 AST#expression#Left 0.5784351745561876 AST#expression#Right , //#345 AST#expression#Left 0.5946329555225146 AST#expression#Right , //#346 AST#expression#Left 0.6105928916886046 AST#expression#Right , //#347 AST#expression#Left 0.6263085993049634 AST#expression#Right , //#348 AST#expression#Left 0.6417737923100737 AST#expression#Right , //#349 AST#expression#Left 0.6569822848447313 AST#expression#Right , //#350 AST#expression#Left 0.6719279937263022 AST#expression#Right , //#351 AST#expression#Left 0.6866049408819089 AST#expression#Right , //#352 AST#expression#Left 0.7010072557395762 AST#expression#Right , //#353 AST#expression#Left 0.7151291775763766 AST#expression#Right , //#354 AST#expression#Left 0.7289650578226388 AST#expression#Right , //#355 AST#expression#Left 0.7425093623212952 AST#expression#Right , //#356 AST#expression#Left 0.7557566735414675 AST#expression#Right , //#357 AST#expression#Left 0.7687016927454025 AST#expression#Right , //#358 AST#expression#Left 0.781339242107892 AST#expression#Right , //#359 AST#expression#Left 0.7936642667873305 AST#expression#Right , //#360 AST#expression#Left 0.8056718369475803 AST#expression#Right , //#361 AST#expression#Left 0.8173571497298365 AST#expression#Right , //#362 AST#expression#Left 0.8287155311737031 AST#expression#Right , //#363 AST#expression#Left 0.8397424380867105 AST#expression#Right , //#364 AST#expression#Left 0.8504334598615295 AST#expression#Right , //#365 AST#expression#Left 0.8607843202401511 AST#expression#Right , //#366 AST#expression#Left 0.8707908790243301 AST#expression#Right , //#367 AST#expression#Left 0.8804491337316057 AST#expression#Right , //#368 AST#expression#Left 0.8897552211962383 AST#expression#Right , //#369 AST#expression#Left 0.8987054191144209 AST#expression#Right , //#370 AST#expression#Left 0.9072961475331487 AST#expression#Right , //#371 AST#expression#Left 0.9155239702821494 AST#expression#Right , //#372 AST#expression#Left 0.9233855963483032 AST#expression#Right , //#373 AST#expression#Left 0.9308778811920015 AST#expression#Right , //#374 AST#expression#Left 0.9379978280049185 AST#expression#Right , //#375 AST#expression#Left 0.9447425889086918 AST#expression#Right , //#376 AST#expression#Left 0.9511094660940346 AST#expression#Right , //#377 AST#expression#Left 0.9570959128998204 AST#expression#Right , //#378 AST#expression#Left 0.9626995348317123 AST#expression#Right , //#379 AST#expression#Left 0.9679180905199263 AST#expression#Right , //#380 AST#expression#Left 0.9727494926157481 AST#expression#Right , //#381 AST#expression#Left 0.977191808626443 AST#expression#Right , //#382 AST#expression#Left 0.9812432616882257 AST#expression#Right , //#383 AST#expression#Left 0.9849022312769813 AST#expression#Right , //#384 AST#expression#Left 0.988167253856451 AST#expression#Right , //#385 AST#expression#Left 0.991037023463627 AST#expression#Right , //#386 AST#expression#Left 0.9935103922311188 AST#expression#Right , //#387 AST#expression#Left 0.9955863708462842 AST#expression#Right , //#388 AST#expression#Left 0.9972641289469402 AST#expression#Right , //#389 AST#expression#Left 0.9985429954534961 AST#expression#Right , //#390 AST#expression#Left 0.9994224588373765 AST#expression#Right , //#391 AST#expression#Left 0.9999021673256246 AST#expression#Right , //#392 AST#expression#Left 0.9999819290416072 AST#expression#Right , //#393 AST#expression#Left 0.9996617120817624 AST#expression#Right , //#394 AST#expression#Left 0.9989416445283599 AST#expression#Right , //#395 AST#expression#Left 0.9978220143982713 AST#expression#Right , //#396 AST#expression#Left 0.9963032695277663 AST#expression#Right , //#397 AST#expression#Left 0.9943860173933846 AST#expression#Right , //#398 AST#expression#Left 0.9920710248689544 AST#expression#Right , //#399 AST#expression#Left 0.9893592179188533 AST#expression#Right , //#400 AST#expression#Left 0.986251602430098 AST#expression#Right , //#401 AST#expression#Left 0.9827494813924079 AST#expression#Right , //#402 AST#expression#Left 0.9788542556716259 AST#expression#Right , //#403 AST#expression#Left 0.9745674833774243 AST#expression#Right , //#404 AST#expression#Left 0.9698908792400535 AST#expression#Right , //#405 AST#expression#Left 0.9648263139244408 AST#expression#Right , //#406 AST#expression#Left 0.959375813281916 AST#expression#Right , //#407 AST#expression#Left 0.9535415575398596 AST#expression#Right , //#408 AST#expression#Left 0.947325880429602 AST#expression#Right , //#409 AST#expression#Left 0.9407312682529189 AST#expression#Right , //#410 AST#expression#Left 0.9337603588874981 AST#expression#Right , //#411 AST#expression#Left 0.9264159407317759 AST#expression#Right , //#412 AST#expression#Left 0.918700951589563 AST#expression#Right , //#413 AST#expression#Left 0.9106184774949092 AST#expression#Right , //#414 AST#expression#Left 0.9021717514776737 AST#expression#Right , //#415 AST#expression#Left 0.8933641522702975 AST#expression#Right , //#416 AST#expression#Left 0.8841992029562936 AST#expression#Right , //#417 AST#expression#Left 0.8746805695609958 AST#expression#Right , //#418 AST#expression#Left 0.8648120595851305 AST#expression#Right , //#419 AST#expression#Left 0.8545976204817978 AST#expression#Right , //#420 AST#expression#Left 0.8440413380774695 AST#expression#Right , //#421 AST#expression#Left 0.8331474349376399 AST#expression#Right , //#422 AST#expression#Left 0.8219202686777767 AST#expression#Right , //#423 AST#expression#Left 0.8103643302202548 AST#expression#Right , //#424 AST#expression#Left 0.7984842419979638 AST#expression#Right , //#425 AST#expression#Left 0.7862847561053125 AST#expression#Right , //#426 AST#expression#Left 0.7737707523973671 AST#expression#Right , //#427 AST#expression#Left 0.7609472365378854 AST#expression#Right , //#428 AST#expression#Left 0.7478193379970259 AST#expression#Right , //#429 AST#expression#Left 0.7343923079995343 AST#expression#Right , //#430 AST#expression#Left 0.7206715174242275 AST#expression#Right , //#431 AST#expression#Left 0.7066624546556156 AST#expression#Right , //#432 AST#expression#Left 0.6923707233885205 AST#expression#Right , //#433 AST#expression#Left 0.67780204038657 AST#expression#Right , //#434 AST#expression#Left 0.6629622331954643 AST#expression#Right , //#435 AST#expression#Left 0.6478572378119283 AST#expression#Right , //#436 AST#expression#Left 0.6324930963092836 AST#expression#Right , //#437 AST#expression#Left 0.6168759544205892 AST#expression#Right , //#438 AST#expression#Left 0.6010120590803173 AST#expression#Right , //#439 AST#expression#Left 0.5849077559255487 AST#expression#Right , //#440 AST#expression#Left 0.5685694867576866 AST#expression#Right , //#441 AST#expression#Left 0.5520037869657035 AST#expression#Right , //#442 AST#expression#Left 0.5352172829119535 AST#expression#Right , //#443 AST#expression#Left 0.5182166892815939 AST#expression#Right , //#444 AST#expression#Left 0.5010088063966786 AST#expression#Right , //#445 AST#expression#Left 0.48360051749599425 AST#expression#Right , //#446 AST#expression#Left 0.4659987859817315 AST#expression#Right , //#447 AST#expression#Left 0.44821065263408894 AST#expression#Right , //#448 AST#expression#Left 0.4302432327949262 AST#expression#Right , //#449 AST#expression#Left 0.4121037135215916 AST#expression#Right , //#450 AST#expression#Left 0.39379935071206357 AST#expression#Right , //#451 AST#expression#Left 0.3753374662025555 AST#expression#Right , //#452 AST#expression#Left 0.35672544483874447 AST#expression#Right , //#453 AST#expression#Left 0.3379707315217965 AST#expression#Right , //#454 AST#expression#Left 0.31908082823036904 AST#expression#Right , //#455 AST#expression#Left 0.30006329101978185 AST#expression#Right , //#456 AST#expression#Left 0.2809257269995578 AST#expression#Right , //#457 AST#expression#Left 0.2616757912905407 AST#expression#Right , //#458 AST#expression#Left 0.2423211839628092 AST#expression#Right , //#459 AST#expression#Left 0.2228696469556102 AST#expression#Right , //#460 AST#expression#Left 0.2033289609805449 AST#expression#Right , //#461 AST#expression#Left 0.18370694240924518 AST#expression#Right , //#462 AST#expression#Left 0.16401144014678615 AST#expression#Right , //#463 AST#expression#Left 0.14425033249208516 AST#expression#Right , //#464 AST#expression#Left 0.12443152398654284 AST#expression#Right , //#465 AST#expression#Left 0.10456294225218733 AST#expression#Right , //#466 AST#expression#Left 0.084652534820586 AST#expression#Right , //#467 AST#expression#Left 0.06470826595379324 AST#expression#Right , //#468 AST#expression#Left 0.04473811345860604 AST#expression#Right , //#469 AST#expression#Left 0.024750065495401534 AST#expression#Right , //#470 AST#expression#Left 0.004752117382833131 AST#expression#Right , //#471 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.015247731600336746 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#472 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.03524148141498798 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#473 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.05522113446169821 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#474 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.0751786987798224 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#475 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.09510619124431689 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#476 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.11499564075902909 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#477 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.13483909144517564 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#478 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.15462860582373356 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#479 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.17435626799047124 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#480 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.19401418678234966 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#481 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.21359449893402682 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#482 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.23308937222320295 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#483 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.25249100860354845 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#484 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.27179164732396127 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#485 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.290983568032906 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#486 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.3100590938665927 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#487 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.32901059451976084 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#488 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.3478304892978393 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#489 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.36651125014926184 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#490 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.3850454046767254 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#491 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.40342553912618595 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#492 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.42164430135239717 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#493 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4396944037598051 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#494 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4575686262176226 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#495 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4752598189479177 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#496 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.49276090538556006 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#497 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5100648850088826 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#498 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5271648361399248 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#499 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5440539187131385 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#500 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5607253770114478 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#501 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5771725423685697 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#502 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5933888358365144 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#503 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6093677708171961 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#504 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.625102955657105 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#505 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6405880962040014 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#506 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6558169983246062 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#507 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6707835703822864 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#508 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6854818256737397 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#509 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6999058848237054 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#510 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7140499781367439 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#511 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7279084479051434 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#512 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7414757506720319 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#513 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7547464594487863 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#514 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7677152658858558 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#515 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.780376982396128 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#516 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7927265442299892 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#517 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8047590115012498 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#518 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8164695711631232 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#519 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8278535389334684 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#520 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8389063611685262 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#521 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8496236166843997 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#522 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8600010185255492 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#523 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8700344156795967 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#524 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8797197947377503 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#525 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8890532815001886 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#526 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8980311425257598 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#527 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9066497866253763 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#528 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9149057662985087 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#529 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9227957791122028 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#530 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9303166690220693 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#531 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9374654276347177 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#532 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9442391954111279 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#533 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9506352628104804 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#534 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9566510713739863 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#535 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9622842147482832 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#536 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9675324396479887 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#537 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9723936467570258 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#538 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9768658915683597 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#539 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9809473851618101 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#540 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9846364949196288 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#541 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9879317451795541 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#542 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9908318178250837 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#543 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9933355528127273 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#544 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9954419486360307 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#545 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9971501627261821 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#546 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9984595117890447 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#547 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9993694720784776 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#548 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9998796796058368 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#549 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9999899302855721 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#550 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9997001800168633 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#551 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9990105447012596 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#552 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9979213001963191 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#553 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9964328822052644 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#554 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9945458861026987 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#555 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9922610666964535 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#556 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9895793379256616 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#557 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9865017724951763 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#558 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9830296014464852 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#559 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9791642136652865 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#560 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9749071553259283 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#561 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9702601292729311 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#562 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9652249943398415 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#563 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9598037646056896 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#564 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9539986085893469 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#565 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9478118483821087 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#566 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9412459587188456 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#567 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9343035659880974 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#568 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.926987447181504 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#569 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9193005287829963 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#570 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9112458855981864 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#571 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.9028267395244314 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#572 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8940464582620574 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#573 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8849085539672636 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#574 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8754166818472415 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#575 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8655746386980744 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#576 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8553863613859995 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#577 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8448559252726426 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#578 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8339875425848524 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#579 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8227855607297891 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#580 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.8112544605559403 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#581 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7993988545607584 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#582 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7872234850456398 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#583 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7747332222189794 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#584 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7619330622480646 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#585 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7488281252605818 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#586 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7354236532965415 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#587 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7217250082114348 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#588 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.7077376695314656 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#589 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6934672322617121 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#590 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6789194046480973 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#591 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6641000058940624 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#592 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6490149638328556 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#593 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6336703125563705 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#594 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6180721900014786 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#595 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.6022268354948238 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#596 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5861405872570615 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#597 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.569819879867538 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#598 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5532712416904271 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#599 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5365012922633521 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#600 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5195167396495373 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#601 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.5023243777545499 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#602 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4849310836087036 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#603 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4673438146162124 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#604 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.44956960577219424 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#605 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.43161556684863794 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#606 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.4134888795504591 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#607 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.3951967946427822 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#608 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.3767466290505987 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#609 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.3581457629319605 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#610 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.33940163672588003 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#611 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.32052174817611767 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#612 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.30151364933204683 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#613 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.28238494352779664 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#614 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.26314328234088047 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#615 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.24379636253152692 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#616 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.2243519229639374 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#617 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.20481774151070187 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#618 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.1852016319416111 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#619 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.16551144079810998 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#620 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.14575504425464175 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#621 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.12594034496813916 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#622 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.10607526891692229 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#623 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.08616776223026779 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#624 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.06622578800991763 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#625 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.04625732314479881 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#626 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.02627035512022804 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#627 AST#expression#Left AST#unary_expression#Left - AST#expression#Left 0.006272878822877913 AST#expression#Right AST#unary_expression#Right AST#expression#Right , //#628 AST#expression#Left 0.013727106657217596 AST#expression#Right , //#629 AST#expression#Left 0.03372160122633892 AST#expression#Right , //#630 AST#expression#Left 0.053702606987158195 AST#expression#Right , //#631 AST#expression#Left 0.07366213143793802 AST#expression#Right , //#632 AST#expression#Left 0.0935921906695719 AST#expression#Right , //#633 AST#expression#Left 0.11348481255918764 AST#expression#Right , //#634 AST#expression#Left 0.13333203995903614 AST#expression#Right , //#635 AST#expression#Left 0.1531259338793901 AST#expression#Right , //#636 AST#expression#Left 0.17285857666417945 AST#expression#Right , //#637 AST#expression#Left 0.19252207515809314 AST#expression#Right , //#638 AST#expression#Left 0.21210856386388055 AST#expression#Right , //#639 AST#expression#Left 0.2316102080885896 AST#expression#Right , //#640 AST#expression#Left 0.2510192070774827 AST#expression#Right , //#641 AST#expression#Left 0.2703277971343779 AST#expression#Right , //#642 AST#expression#Left 0.2895282547271654 AST#expression#Right , //#643 AST#expression#Left 0.3086128995772594 AST#expression#Right , //#644 AST#expression#Left 0.3275740977317474 AST#expression#Right , //#645 AST#expression#Left 0.34640426461700946 AST#expression#Right , //#646 AST#expression#Left 0.36509586807258537 AST#expression#Right , //#647 AST#expression#Left 0.38364143136407647 AST#expression#Right , //#648 AST#expression#Left 0.4020335361738763 AST#expression#Right , //#649 AST#expression#Left 0.4202648255685349 AST#expression#Right , //#650 AST#expression#Left 0.43832800694156854 AST#expression#Right , //#651 AST#expression#Left 0.45621585493053873 AST#expression#Right , //#652 AST#expression#Left 0.4739212143072332 AST#expression#Right , //#653 AST#expression#Left 0.49143700283979275 AST#expression#Right , //#654 AST#expression#Left 0.508756214125639 AST#expression#Right , //#655 AST#expression#Left 0.5258719203940706 AST#expression#Right , //#656 AST#expression#Left 0.5427772752774059 AST#expression#Right , //#657 AST#expression#Left 0.5594655165495643 AST#expression#Right , //#658 AST#expression#Left 0.5759299688309899 AST#expression#Right , //#659 AST#expression#Left 0.5921640462588365 AST#expression#Right , //#660 AST#expression#Left 0.6081612551213462 AST#expression#Right , //#661 AST#expression#Left 0.6239151964553658 AST#expression#Right , //#662 AST#expression#Left 0.6394195686059639 AST#expression#Right , //#663 AST#expression#Left 0.6546681697471249 AST#expression#Right , //#664 AST#expression#Left 0.6696549003625094 AST#expression#Right , //#665 AST#expression#Left 0.6843737656852915 AST#expression#Right , //#666 AST#expression#Left 0.6988188780960954 AST#expression#Right , //#667 AST#expression#Left 0.7129844594780727 AST#expression#Right , //#668 AST#expression#Left 0.7268648435281768 AST#expression#Right , //#669 AST#expression#Left 0.740454478023714 AST#expression#Right , //#670 AST#expression#Left 0.7537479270432587 AST#expression#Right , //#671 AST#expression#Left 0.7667398731410499 AST#expression#Right , //#672 AST#expression#Left 0.7794251194739955 AST#expression#Right , //#673 AST#expression#Left 0.7917985918804359 AST#expression#Right , //#674 AST#expression#Left 0.8038553409098333 AST#expression#Right , //#675 AST#expression#Left 0.8155905438025771 AST#expression#Right , //#676 AST#expression#Left 0.8269995064191112 AST#expression#Right , //#677 AST#expression#Left 0.8380776651176137 AST#expression#Right , //#678 AST#expression#Left 0.8488205885794762 AST#expression#Right , //#679 AST#expression#Left 0.8592239795818529 AST#expression#Right , //#680 AST#expression#Left 0.8692836767165718 AST#expression#Right , //#681 AST#expression#Left 0.878995656054718 AST#expression#Right , //#682 AST#expression#Left 0.8883560327562258 AST#expression#Right , //#683 AST#expression#Left 0.8973610626238337 AST#expression#Right , //#684 AST#expression#Left 0.9060071436007824 AST#expression#Right , //#685 AST#expression#Left 0.9142908172116547 AST#expression#Right , //#686 AST#expression#Left 0.9222087699457837 AST#expression#Right , //#687 AST#expression#Left 0.929757834582673 AST#expression#Right , //#688 AST#expression#Left 0.9369349914589009 AST#expression#Right , //#689 AST#expression#Left 0.9437373696760004 AST#expression#Right , //#690 AST#expression#Left 0.9501622482488337 AST#expression#Right , //#691 AST#expression#Left 0.9562070571939989 AST#expression#Right , //#692 AST#expression#Left 0.9618693785578367 AST#expression#Right , //#693 AST#expression#Left 0.9671469473836236 AST#expression#Right , //#694 AST#expression#Left 0.9720376526175663 AST#expression#Right , //#695 AST#expression#Left 0.976539537953233 AST#expression#Right , //#696 AST#expression#Left 0.9806508026140864 AST#expression#Right , //#697 AST#expression#Left 0.9843698020738031 AST#expression#Right , //#698 AST#expression#Left 0.9876950487140919 AST#expression#Right , //#699 AST#expression#Left 0.990625212419749 AST#expression#Right , //#700 AST#expression#Left 0.9931591211107106 AST#expression#Right , //#701 AST#expression#Left 0.9952957612108906 AST#expression#Right , //#702 AST#expression#Left 0.9970342780536162 AST#expression#Right , //#703 AST#expression#Left 0.9983739762234987 AST#expression#Right , //#704 AST#expression#Left 0.9993143198346034 AST#expression#Right , //#705 AST#expression#Left 0.9998549327448063 AST#expression#Right , //#706 AST#expression#Left 0.9999955987062531 AST#expression#Right , //#707 AST#expression#Left 0.999736261451859 AST#expression#Right , //#708 AST#expression#Left 0.9990770247178167 AST#expression#Right , //#709 AST#expression#Left 0.9980181522021 AST#expression#Right , //#710 AST#expression#Left 0.9965600674589848 AST#expression#Right , //#711 AST#expression#Left 0.9947033537296244 AST#expression#Right , //#712 AST#expression#Left 0.99244875370875 AST#expression#Right , //#713 AST#expression#Left 0.9897971692475899 AST#expression#Right , //#714 AST#expression#Left 0.9867496609931237 AST#expression#Right , //#715 AST#expression#Left 0.9833074479638189 AST#expression#Right , //#716 AST#expression#Left 0.9794719070620168 AST#expression#Right , //#717 AST#expression#Left 0.9752445725231655 AST#expression#Right , //#718 AST#expression#Left 0.9706271353021171 AST#expression#Right , //#719 AST#expression#Left 0.9656214423967383 AST#expression#Right , //#720 AST#expression#Left 0.9602294961091015 AST#expression#Right , //#721 AST#expression#Left 0.9544534532445539 AST#expression#Right , //#722 AST#expression#Left 0.9482956242489854 AST#expression#Right , //#723 AST#expression#Left 0.9417584722846377 AST#expression#Right , //#724 AST#expression#Left 0.934844612244828 AST#expression#Right , //#725 AST#expression#Left 0.9275568097079782 AST#expression#Right , //#726 AST#expression#Left 0.9198979798313699 AST#expression#Right , //#727 AST#expression#Left 0.911871186185067 AST#expression#Right , //#728 AST#expression#Left 0.9034796395264725 AST#expression#Right , //#729 AST#expression#Left 0.8947266965160092 AST#expression#Right , //#730 AST#expression#Left 0.8856158583744393 AST#expression#Right , //#731 AST#expression#Left 0.8761507694823586 AST#expression#Right , //#732 AST#expression#Left 0.8663352159224256 AST#expression#Right , //#733 AST#expression#Left 0.8561731239649102 AST#expression#Right , //#734 AST#expression#Left 0.8456685584971658 AST#expression#Right , //#735 AST#expression#Left 0.8348257213976545 AST#expression#Right , //#736 AST#expression#Left 0.8236489498551739 AST#expression#Right , //#737 AST#expression#Left 0.812142714633961 AST#expression#Right , //#738 AST#expression#Left 0.8003116182853636 AST#expression#Right , //#739 AST#expression#Left 0.7881603933067972 AST#expression#Right , //#740 AST#expression#Left 0.7756939002487224 AST#expression#Right , //#741 AST#expression#Left 0.7629171257704004 AST#expression#Right , //#742 AST#expression#Left 0.7498351806452045 AST#expression#Right , //#743 AST#expression#Left 0.7364532977162856 AST#expression#Right , //#744 AST#expression#Left 0.7227768298034087 AST#expression#Right , //#745 AST#expression#Left 0.7088112475617983 AST#expression#Right , //#746 AST#expression#Left 0.6945621372938487 AST#expression#Right , //#747 AST#expression#Left 0.6800351987145765 AST#expression#Right , //#748 AST#expression#Left 0.6652362426717048 AST#expression#Right //#749 ] AST#array_literal#Right AST#expression#Right AST#property_declaration#Right } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right
export default class Sine { public data: number[] = [ 0.0, 0.019998666246387648, 0.039989333293279646, 0.059964005140753354, 0.07991469218675235, 0.0998334181294999, 0.11971221202299985, 0.1395431152344512, 0.15931820308364608, 0.17902956580240917, 0.19866931911175714, 0 0.21822960737550368, 1 0.23770260674240787, 2 0.25708054267594205, 3 0.2763556497097811, 4 0.29552021804983797, 5 0.31456658211607685, 6 0.33348712360864613, 7 0.35227427455509996, 8 0.3709205203374898, 9 0.38941840269811434, 0 0.40776052272272667, 1 0.42593954380000415, 2 0.4439481945560986, 3 0.46177927176309164, 4 0.4794256432201933, 5 0.49688022474350485, 6 0.5141360611809643, 7 0.5311862504412359, 8 0.5480239726889556, 9 0.5646424930725696, 0 0.5810351644181799, 1 0.5971954298883201, 2 0.6131168256045979, 3 0.6287929832331555, 4 0.6442176325319131, 5 0.659384603858578, 6 0.6742878306384138, 7 0.6889213517907848, 8 0.7032793141135052, 9 0.7173559746240362, 0 0.7311457028565987, 1 0.7446429831142805, 2 0.7578424166752367, 3 0.7707387239521026, 4 0.7833267466037546, 5 0.795601449598573, 6 0.8075579232283849, 7 0.8191913850722774, 8 0.8304971819094986, 9 0.8414707915806806, 0 0.8521078247966395, 1 0.8624040268940288, 2 0.8723552795371456, 3 0.8819576023652057, 4 0.8912071545844327, 5 0.9001002365043209, 6 0.9086332910174598, 7 0.9168029050223264, 8 0.9246058107884779, 9 0.9320388872635981, 0 0.9390991613218737, 1 0.9457838089532035, 2 0.952090156392762, 3 0.9580156811904679, 4 0.9635580132199286, 5 0.9687149356264573, 6 0.9734843857137836, 7 0.9778644557691029, 8 0.9818533938261347, 9 0.9854496043658845, 0 0.9886516489548286, 1 0.9914582468202678, 2 0.9938682753626178, 3 0.9958807706044335, 4 0.9974949275759862, 5 0.9987101006372409, 6 0.9995258037361018, 7 0.9999417106028279, 8 0.9999576548805349, 9 0.9995736301917366, 0 0.9987897901408953, 1 0.9976064482529823, 2 0.9960240778480722, 3 0.9940433118520219, 4 0.9916649425433088, 5 0.988889921236131, 6 0.9857193578998942, 7 0.9821545207152407, 8 0.9781968355667943, 9 0.9738478854728265, 0 0.9691094099520721, 1 0.9639833043279455, 2 0.9584716189704385, 3 0.9525765584760014, 4 0.9463004807857347, 5 0.9396458962422467, 6 0.9326154665855515, 7 0.9252120038884106, 8 0.9174384694315432, 9 0.909297972519156, 00 0.9007937174689649, 01 0.8919292072378467, 02 0.8827079378965067, 03 0.8731335978226978, 04 0.8632100166174893, 05 0.85294116357348, 06 0.8423311460871373, 07 0.8313842080158964, 08 0.8201047279806774, 09 0.8084972176144982, 10 0.7965663197578854, 11 0.7843168066018031, 12 0.7717535777788443, 13 0.7588816584034461, 14 0.7457061970619157, 15 0.7322324637530676, 16 0.7184658477802992, 17 0.7044118555959447, 18 0.6900761085987721, 19 0.6754643408855032, 20 0.660582396957255, 21 0.6454362293818222, 22 0.630031896412734, 23 0.6143755595660381, 24 0.5984734811557804, 25 0.5823320217891688, 26 0.5659576378224191, 27 0.5493568787783043, 28 0.5325363847264367, 29 0.5155028836273348, 30 0.498263188641333, 31 0.48082419540341453, 32 0.46319287926505354, 33 0.44537629250417365, 34 0.42738156150433587, 35 0.4092158839042855, 36 0.39088652571899846, 37 0.37240081843337736, 38 0.3537661560697612, 39 0.33498999223042036, 40 0.3160798371162209, 41 0.29704325452265024, 42 0.2778878588144052, 43 0.25862131187975385, 44 0.2392513200658879, 45 0.21978563109649268, 46 0.20023203097276676, 47 0.1805983408591312, 48 0.1608924139548741, 49 0.1411221323529816, 50 0.12129540388741163, 51 0.10142015897007202, 52 0.08150434741876739, 53 0.06155593527738411, 54 0.04158290162958502, 55 0.02159323540728851, 56 0.0015949321952082743, 57 -0.01840400896726781, 58 -0.038395588785580706, 59 -0.05837181090960527, 60 -0.07832468513207759, 61 -0.09824623058456528, 62 -0.11812847892970231, 63 -0.13796347754841165, 64 -0.15774329272084087, 65 -0.1774600127997381, 66 -0.19710575137499955, 67 -0.2166726504281223, 68 -0.23615288347530097, 69 -0.2555386586979109, 70 -0.2748222220591258, 71 -0.29399586040542314, 72 -0.3130519045517368, 73 -0.33198273234902315, 74 -0.350780771733013, 75 -0.36943850375293075, 76 -0.38794846557896867, 77 -0.40630325348731355, 78 -0.42449552582153194, 79 -0.44251800592912927, 80 -0.4603634850721081, 81 -0.47802482531036194, 82 -0.49549496235675056, 83 -0.5127669084027151, 84 -0.5298337549133033, 85 -0.5466886753904862, 86 -0.5633249281036602, 87 -0.5797358587862456, 88 -0.5959149032972986, 89 -0.6118555902470753, 90 -0.6275515435854963, 91 -0.6429964851524771, 92 -0.6581842371891036, 93 -0.6731087248086483, 94 -0.6877639784264394, 95 -0.7021441361476113, 96 -0.7162434461117786, 97 -0.7300562687937001, 98 -0.7435770792590093, 99 -0.7568004693741099, 00 -0.7697213021710452, 01 -0.7823341014558161, 02 -0.7946339781278204, 03 -0.806616012409769, 04 -0.8182754116568484, 05 -0.8296075122737109, 06 -0.8406077815798478, 07 -0.8512718196225969, 08 -0.8615953609370618, 09 -0.8715742762522378, 10 -0.8812045741426621, 11 -0.8904824026249275, 12 -0.8994040506984219, 13 -0.9079659498296758, 14 -0.9161646753797257, 15 -0.923996947973921, 16 -0.9314596348136281, 17 -0.9385497509293057, 18 -0.9452644603744499, 19 -0.9516010773599336, 20 -0.9575570673282837, 21 -0.9631300479674688, 22 -0.9683177901637904, 23 -0.9731182188934963, 24 -0.9775294140527618, 25 -0.9815496112257037, 26 -0.9851772023901216, 27 -0.9884107365606845, 28 -0.991248920369304, 29 -0.9936906185824641, 30 -0.9957348545552975, 31 -0.997380810622231, 32 -0.9986278284240393, 33 -0.9994754091711795, 34 -0.9999232138433003, 35 -0.9999710633248452, 36 -0.999618938476696, 37 -0.9988669801438286, 38 -0.9977154890989762, 39 -0.9961649259223255, 40 -0.9942159108172903, 41 -0.9918692233624392, 42 -0.989125802199675, 43 -0.9859867446587918, 44 -0.9824533063185572, 45 -0.9785269005045, 46 -0.9742090977235991, 47 -0.9695016250361028, 48 -0.9644063653647295, 49 -0.9589253567415246, 50 -0.953060791492677, 51 -0.9468150153616188, 52 -0.940190526570762, 53 -0.9331899748222436, 54 -0.9258161602380832, 55 -0.9180720322401726, 56 -0.9099606883705496, 57 -0.901485373052424, 58 -0.8926494762924547, 59 -0.8834565323247946, 60 -0.8739102181974464, 61 -0.864014352301496, 62 -0.8537728928438092, 63 -0.8431899362638049, 64 -0.8322697155949375, 65 -0.8210165987715422, 66 -0.8094350868817244, 67 -0.7975298123669863, 68 -0.7853055371693165, 69 -0.7727671508264802, 70 -0.7599196685162729, 71 -0.7467682290505201, 72 -0.7333180928196247, 73 -0.7195746396884855, 74 -0.7055433668446264, 75 -0.6912298865993995, 76 -0.6766399241431399, 77 -0.6617793152551689, 78 -0.646654003969566, 79 -0.6312700401976384, 80 -0.6156335773080419, 81 -0.5997508696655202, 82 -0.5836282701292467, 83 -0.5672722275117711, 84 -0.5506892839995849, 85 -0.5338860725363392, 86 -0.5168693141697605, 87 -0.4996458153633263, 88 -0.48222246527377605, 89 -0.4646062329955453, 90 -0.44680416477322615, 91 -0.42882338118316876, 92 -0.4106710742853512, 93 -0.392354504746657, 94 -0.37388099893671045, 95 -0.3552579459974321, 96 -0.33649279488748635, 97 -0.31759305140280275, 98 -0.2985662751743636, 99 -0.27942007664445806, 00 -0.2601621140226123, 01 -0.24080009022241405, 02 -0.22134174978045548, 03 -0.2017948757586277, 04 -0.18216728663100587, 05 -0.1624668331565697, 06 -0.1427013952390105, 07 -0.12287887877488078, 08 -0.10300721249134719, 09 -0.08309434477481123, 10 -0.06314824049166687, 11 -0.04317687780246621, 12 -0.02318824497076772, 13 -0.0031903371679434384, 14 0.016808846724776887, 15 0.03680130731574554, 16 0.056779047902540736, 17 0.07673407767053486, 18 0.09665841488910769, 19 0.11654409010422613, 20 0.13638314932611348, 21 0.1561676572107332, 22 0.17588970023381478, 23 0.19554138985615177, 24 0.21511486567890625, 25 0.23460229858765777, 26 0.2539958938839385, 27 0.2732878944030029, 28 0.2924705836165842, 29 0.311536288719397, 30 0.3304773836981512, 31 0.3492862923818499, 32 0.3679554914721506, 33 0.38647751355257925, 34 0.40484495007539084, 35 0.42305045432488436, 36 0.44108674435598566, 37 0.45894660590692266, 38 0.4766228952848283, 39 0.49410854222311723, 40 0.5113965527094926, 41 0.5284800117834523, 42 0.545352086302176, 43 0.5620060276736858, 44 0.5784351745561876, 45 0.5946329555225146, 46 0.6105928916886046, 47 0.6263085993049634, 48 0.6417737923100737, 49 0.6569822848447313, 50 0.6719279937263022, 51 0.6866049408819089, 52 0.7010072557395762, 53 0.7151291775763766, 54 0.7289650578226388, 55 0.7425093623212952, 56 0.7557566735414675, 57 0.7687016927454025, 58 0.781339242107892, 59 0.7936642667873305, 60 0.8056718369475803, 61 0.8173571497298365, 62 0.8287155311737031, 63 0.8397424380867105, 64 0.8504334598615295, 65 0.8607843202401511, 66 0.8707908790243301, 67 0.8804491337316057, 68 0.8897552211962383, 69 0.8987054191144209, 70 0.9072961475331487, 71 0.9155239702821494, 72 0.9233855963483032, 73 0.9308778811920015, 74 0.9379978280049185, 75 0.9447425889086918, 76 0.9511094660940346, 77 0.9570959128998204, 78 0.9626995348317123, 79 0.9679180905199263, 80 0.9727494926157481, 81 0.977191808626443, 82 0.9812432616882257, 83 0.9849022312769813, 84 0.988167253856451, 85 0.991037023463627, 86 0.9935103922311188, 87 0.9955863708462842, 88 0.9972641289469402, 89 0.9985429954534961, 90 0.9994224588373765, 91 0.9999021673256246, 92 0.9999819290416072, 93 0.9996617120817624, 94 0.9989416445283599, 95 0.9978220143982713, 96 0.9963032695277663, 97 0.9943860173933846, 98 0.9920710248689544, 99 0.9893592179188533, 00 0.986251602430098, 01 0.9827494813924079, 02 0.9788542556716259, 03 0.9745674833774243, 04 0.9698908792400535, 05 0.9648263139244408, 06 0.959375813281916, 07 0.9535415575398596, 08 0.947325880429602, 09 0.9407312682529189, 10 0.9337603588874981, 11 0.9264159407317759, 12 0.918700951589563, 13 0.9106184774949092, 14 0.9021717514776737, 15 0.8933641522702975, 16 0.8841992029562936, 17 0.8746805695609958, 18 0.8648120595851305, 19 0.8545976204817978, 20 0.8440413380774695, 21 0.8331474349376399, 22 0.8219202686777767, 23 0.8103643302202548, 24 0.7984842419979638, 25 0.7862847561053125, 26 0.7737707523973671, 27 0.7609472365378854, 28 0.7478193379970259, 29 0.7343923079995343, 30 0.7206715174242275, 31 0.7066624546556156, 32 0.6923707233885205, 33 0.67780204038657, 34 0.6629622331954643, 35 0.6478572378119283, 36 0.6324930963092836, 37 0.6168759544205892, 38 0.6010120590803173, 39 0.5849077559255487, 40 0.5685694867576866, 41 0.5520037869657035, 42 0.5352172829119535, 43 0.5182166892815939, 44 0.5010088063966786, 45 0.48360051749599425, 46 0.4659987859817315, 47 0.44821065263408894, 48 0.4302432327949262, 49 0.4121037135215916, 50 0.39379935071206357, 51 0.3753374662025555, 52 0.35672544483874447, 53 0.3379707315217965, 54 0.31908082823036904, 55 0.30006329101978185, 56 0.2809257269995578, 57 0.2616757912905407, 58 0.2423211839628092, 59 0.2228696469556102, 60 0.2033289609805449, 61 0.18370694240924518, 62 0.16401144014678615, 63 0.14425033249208516, 64 0.12443152398654284, 65 0.10456294225218733, 66 0.084652534820586, 67 0.06470826595379324, 68 0.04473811345860604, 69 0.024750065495401534, 70 0.004752117382833131, 71 -0.015247731600336746, 72 -0.03524148141498798, 73 -0.05522113446169821, 74 -0.0751786987798224, 75 -0.09510619124431689, 76 -0.11499564075902909, 77 -0.13483909144517564, 78 -0.15462860582373356, 79 -0.17435626799047124, 80 -0.19401418678234966, 81 -0.21359449893402682, 82 -0.23308937222320295, 83 -0.25249100860354845, 84 -0.27179164732396127, 85 -0.290983568032906, 86 -0.3100590938665927, 87 -0.32901059451976084, 88 -0.3478304892978393, 89 -0.36651125014926184, 90 -0.3850454046767254, 91 -0.40342553912618595, 92 -0.42164430135239717, 93 -0.4396944037598051, 94 -0.4575686262176226, 95 -0.4752598189479177, 96 -0.49276090538556006, 97 -0.5100648850088826, 98 -0.5271648361399248, 99 -0.5440539187131385, 00 -0.5607253770114478, 01 -0.5771725423685697, 02 -0.5933888358365144, 03 -0.6093677708171961, 04 -0.625102955657105, 05 -0.6405880962040014, 06 -0.6558169983246062, 07 -0.6707835703822864, 08 -0.6854818256737397, 09 -0.6999058848237054, 10 -0.7140499781367439, 11 -0.7279084479051434, 12 -0.7414757506720319, 13 -0.7547464594487863, 14 -0.7677152658858558, 15 -0.780376982396128, 16 -0.7927265442299892, 17 -0.8047590115012498, 18 -0.8164695711631232, 19 -0.8278535389334684, 20 -0.8389063611685262, 21 -0.8496236166843997, 22 -0.8600010185255492, 23 -0.8700344156795967, 24 -0.8797197947377503, 25 -0.8890532815001886, 26 -0.8980311425257598, 27 -0.9066497866253763, 28 -0.9149057662985087, 29 -0.9227957791122028, 30 -0.9303166690220693, 31 -0.9374654276347177, 32 -0.9442391954111279, 33 -0.9506352628104804, 34 -0.9566510713739863, 35 -0.9622842147482832, 36 -0.9675324396479887, 37 -0.9723936467570258, 38 -0.9768658915683597, 39 -0.9809473851618101, 40 -0.9846364949196288, 41 -0.9879317451795541, 42 -0.9908318178250837, 43 -0.9933355528127273, 44 -0.9954419486360307, 45 -0.9971501627261821, 46 -0.9984595117890447, 47 -0.9993694720784776, 48 -0.9998796796058368, 49 -0.9999899302855721, 50 -0.9997001800168633, 51 -0.9990105447012596, 52 -0.9979213001963191, 53 -0.9964328822052644, 54 -0.9945458861026987, 55 -0.9922610666964535, 56 -0.9895793379256616, 57 -0.9865017724951763, 58 -0.9830296014464852, 59 -0.9791642136652865, 60 -0.9749071553259283, 61 -0.9702601292729311, 62 -0.9652249943398415, 63 -0.9598037646056896, 64 -0.9539986085893469, 65 -0.9478118483821087, 66 -0.9412459587188456, 67 -0.9343035659880974, 68 -0.926987447181504, 69 -0.9193005287829963, 70 -0.9112458855981864, 71 -0.9028267395244314, 72 -0.8940464582620574, 73 -0.8849085539672636, 74 -0.8754166818472415, 75 -0.8655746386980744, 76 -0.8553863613859995, 77 -0.8448559252726426, 78 -0.8339875425848524, 79 -0.8227855607297891, 80 -0.8112544605559403, 81 -0.7993988545607584, 82 -0.7872234850456398, 83 -0.7747332222189794, 84 -0.7619330622480646, 85 -0.7488281252605818, 86 -0.7354236532965415, 87 -0.7217250082114348, 88 -0.7077376695314656, 89 -0.6934672322617121, 90 -0.6789194046480973, 91 -0.6641000058940624, 92 -0.6490149638328556, 93 -0.6336703125563705, 94 -0.6180721900014786, 95 -0.6022268354948238, 96 -0.5861405872570615, 97 -0.569819879867538, 98 -0.5532712416904271, 99 -0.5365012922633521, 00 -0.5195167396495373, 01 -0.5023243777545499, 02 -0.4849310836087036, 03 -0.4673438146162124, 04 -0.44956960577219424, 05 -0.43161556684863794, 06 -0.4134888795504591, 07 -0.3951967946427822, 08 -0.3767466290505987, 09 -0.3581457629319605, 10 -0.33940163672588003, 11 -0.32052174817611767, 12 -0.30151364933204683, 13 -0.28238494352779664, 14 -0.26314328234088047, 15 -0.24379636253152692, 16 -0.2243519229639374, 17 -0.20481774151070187, 18 -0.1852016319416111, 19 -0.16551144079810998, 20 -0.14575504425464175, 21 -0.12594034496813916, 22 -0.10607526891692229, 23 -0.08616776223026779, 24 -0.06622578800991763, 25 -0.04625732314479881, 26 -0.02627035512022804, 27 -0.006272878822877913, 28 0.013727106657217596, 29 0.03372160122633892, 30 0.053702606987158195, 31 0.07366213143793802, 32 0.0935921906695719, 33 0.11348481255918764, 34 0.13333203995903614, 35 0.1531259338793901, 36 0.17285857666417945, 37 0.19252207515809314, 38 0.21210856386388055, 39 0.2316102080885896, 40 0.2510192070774827, 41 0.2703277971343779, 42 0.2895282547271654, 43 0.3086128995772594, 44 0.3275740977317474, 45 0.34640426461700946, 46 0.36509586807258537, 47 0.38364143136407647, 48 0.4020335361738763, 49 0.4202648255685349, 50 0.43832800694156854, 51 0.45621585493053873, 52 0.4739212143072332, 53 0.49143700283979275, 54 0.508756214125639, 55 0.5258719203940706, 56 0.5427772752774059, 57 0.5594655165495643, 58 0.5759299688309899, 59 0.5921640462588365, 60 0.6081612551213462, 61 0.6239151964553658, 62 0.6394195686059639, 63 0.6546681697471249, 64 0.6696549003625094, 65 0.6843737656852915, 66 0.6988188780960954, 67 0.7129844594780727, 68 0.7268648435281768, 69 0.740454478023714, 70 0.7537479270432587, 71 0.7667398731410499, 72 0.7794251194739955, 73 0.7917985918804359, 74 0.8038553409098333, 75 0.8155905438025771, 76 0.8269995064191112, 77 0.8380776651176137, 78 0.8488205885794762, 79 0.8592239795818529, 80 0.8692836767165718, 81 0.878995656054718, 82 0.8883560327562258, 83 0.8973610626238337, 84 0.9060071436007824, 85 0.9142908172116547, 86 0.9222087699457837, 87 0.929757834582673, 88 0.9369349914589009, 89 0.9437373696760004, 90 0.9501622482488337, 91 0.9562070571939989, 92 0.9618693785578367, 93 0.9671469473836236, 94 0.9720376526175663, 95 0.976539537953233, 96 0.9806508026140864, 97 0.9843698020738031, 98 0.9876950487140919, 99 0.990625212419749, 00 0.9931591211107106, 01 0.9952957612108906, 02 0.9970342780536162, 03 0.9983739762234987, 04 0.9993143198346034, 05 0.9998549327448063, 06 0.9999955987062531, 07 0.999736261451859, 08 0.9990770247178167, 09 0.9980181522021, 10 0.9965600674589848, 11 0.9947033537296244, 12 0.99244875370875, 13 0.9897971692475899, 14 0.9867496609931237, 15 0.9833074479638189, 16 0.9794719070620168, 17 0.9752445725231655, 18 0.9706271353021171, 19 0.9656214423967383, 20 0.9602294961091015, 21 0.9544534532445539, 22 0.9482956242489854, 23 0.9417584722846377, 24 0.934844612244828, 25 0.9275568097079782, 26 0.9198979798313699, 27 0.911871186185067, 28 0.9034796395264725, 29 0.8947266965160092, 30 0.8856158583744393, 31 0.8761507694823586, 32 0.8663352159224256, 33 0.8561731239649102, 34 0.8456685584971658, 35 0.8348257213976545, 36 0.8236489498551739, 37 0.812142714633961, 38 0.8003116182853636, 39 0.7881603933067972, 40 0.7756939002487224, 41 0.7629171257704004, 42 0.7498351806452045, 43 0.7364532977162856, 44 0.7227768298034087, 45 0.7088112475617983, 46 0.6945621372938487, 47 0.6800351987145765, 48 0.665236242671704849 ] }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/entry/src/main/ets/pages/scrollingCharts/data/Sine.ets#L16-L769
8a4da31c5bebd47833c44c7a054a2fc53319bd4f
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imagecomment/src/main/ets/components/view/CommentItemView.ets
arkts
CommentView
单个评论组件,用于显示评论
@Component export struct CommentView { // 评论 private comment: Comment = new Comment('', '', '', [], ''); build() { Column() { Row() { Image(this.comment.avatar) .width($r('app.integer.image_comment_image_avatar_width')) .height($r('app.integer.image_comment_image_avatar_height')) .borderRadius($r('app.integer.image_comment_image_avatar_border_radius')) Column() { Text(this.comment.name) Text(this.comment.time) } .alignItems(HorizontalAlign.Start) .margin({ left: $r('app.integer.image_comment_comment_column_info_margin_left') }) } .width($r('app.string.image_comment_percent_100')) Text(this.comment.comment) .width($r('app.string.image_comment_percent_100')) .margin({ top: $r('app.integer.image_comment_text_comment_margin_top') }) // 如果评论中有图片,则显示List组件 if (this.comment.images.length > 0) { ImageListView({ selectedImages: this.comment.images }) .margin({ top: $r('app.integer.image_comment_list_comment_image_margin_top') }) } } .width($r('app.string.image_comment_percent_100')) .padding($r('app.integer.image_comment_view_comment_padding')) } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CommentView AST#component_body#Left { // 评论 AST#property_declaration#Left private comment : AST#type_annotation#Left AST#primary_type#Left Comment AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Comment AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left '' AST#expression#Right , AST#expression#Left '' AST#expression#Right , AST#expression#Left '' AST#expression#Right , AST#expression#Left AST#array_literal#Left [ ] AST#array_literal#Right AST#expression#Right , AST#expression#Left '' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#property_declaration#Right 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 Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . comment AST#member_expression#Right AST#expression#Right . avatar AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.image_comment_image_avatar_width' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.image_comment_image_avatar_height' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.image_comment_image_avatar_border_radius' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right 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#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . comment AST#member_expression#Right AST#expression#Right . name AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . comment AST#member_expression#Right AST#expression#Right . time AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . alignItems ( AST#expression#Left AST#member_expression#Left AST#expression#Left HorizontalAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left left AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.image_comment_comment_column_info_margin_left' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.image_comment_percent_100' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . comment AST#member_expression#Right AST#expression#Right . comment AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.image_comment_percent_100' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.image_comment_text_comment_margin_top' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right // 如果评论中有图片,则显示List组件 AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . comment AST#member_expression#Right AST#expression#Right . images AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right > AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ImageListView ( AST#component_parameters#Left { AST#component_parameter#Left selectedImages : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . comment AST#member_expression#Right AST#expression#Right . images AST#member_expression#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.image_comment_list_comment_image_margin_top' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.image_comment_percent_100' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.image_comment_view_comment_padding' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#build_body#Right AST#build_method#Right } AST#component_body#Right AST#decorated_export_declaration#Right
@Component export struct CommentView { private comment: Comment = new Comment('', '', '', [], ''); build() { Column() { Row() { Image(this.comment.avatar) .width($r('app.integer.image_comment_image_avatar_width')) .height($r('app.integer.image_comment_image_avatar_height')) .borderRadius($r('app.integer.image_comment_image_avatar_border_radius')) Column() { Text(this.comment.name) Text(this.comment.time) } .alignItems(HorizontalAlign.Start) .margin({ left: $r('app.integer.image_comment_comment_column_info_margin_left') }) } .width($r('app.string.image_comment_percent_100')) Text(this.comment.comment) .width($r('app.string.image_comment_percent_100')) .margin({ top: $r('app.integer.image_comment_text_comment_margin_top') }) if (this.comment.images.length > 0) { ImageListView({ selectedImages: this.comment.images }) .margin({ top: $r('app.integer.image_comment_list_comment_image_margin_top') }) } } .width($r('app.string.image_comment_percent_100')) .padding($r('app.integer.image_comment_view_comment_padding')) } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagecomment/src/main/ets/components/view/CommentItemView.ets#L20-L59
c3ae8fde0e2a8cec621c742822f4596e49824144
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/WebSocket_case/entry/src/main/ets/pages/Index.ets
arkts
closeWebSocket
关闭WebSocket连接
closeWebSocket() { if (!this.ws) { this.closeConnectionResult = 'WebSocket not connected'; Logger.error(`${LOG_TAG} WebSocket not connected`); return; } this.ws.close((err: BusinessError) => { if (!err) { this.closeConnectionResult = 'Connection closed successfully'; this.connectionStatus = 'Not connected'; Logger.info(`${LOG_TAG} WebSocket closed successfully`); } else { this.closeConnectionResult = 'Connection closing failed'; Logger.error(`${LOG_TAG} WebSocket closing failed: ` + JSON.stringify(err)); } }); this.ws.off('open'); this.ws.off('close'); this.ws.off('error'); this.ws = null; }
AST#method_declaration#Left closeWebSocket AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_expression#Right AST#expression#Right . ws AST#member_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . closeConnectionResult AST#member_expression#Right = AST#expression#Left 'WebSocket not connected' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left LOG_TAG AST#expression#Right } AST#template_substitution#Right WebSocket not connected ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left return AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ws AST#member_expression#Right AST#expression#Right . close AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left err : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left err AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . closeConnectionResult AST#member_expression#Right = AST#expression#Left 'Connection closed successfully' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . connectionStatus AST#member_expression#Right = AST#expression#Left 'Not connected' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left LOG_TAG AST#expression#Right } AST#template_substitution#Right WebSocket closed successfully ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . closeConnectionResult AST#member_expression#Right = AST#expression#Left 'Connection closing failed' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left LOG_TAG AST#expression#Right } AST#template_substitution#Right WebSocket closing failed: ` AST#template_literal#Right AST#expression#Right + AST#expression#Left JSON AST#expression#Right AST#binary_expression#Right AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left err AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ws AST#member_expression#Right AST#expression#Right . off AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'open' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ws AST#member_expression#Right AST#expression#Right . off AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'close' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ws AST#member_expression#Right AST#expression#Right . off AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'error' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ws AST#member_expression#Right = AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
closeWebSocket() { if (!this.ws) { this.closeConnectionResult = 'WebSocket not connected'; Logger.error(`${LOG_TAG} WebSocket not connected`); return; } this.ws.close((err: BusinessError) => { if (!err) { this.closeConnectionResult = 'Connection closed successfully'; this.connectionStatus = 'Not connected'; Logger.info(`${LOG_TAG} WebSocket closed successfully`); } else { this.closeConnectionResult = 'Connection closing failed'; Logger.error(`${LOG_TAG} WebSocket closing failed: ` + JSON.stringify(err)); } }); this.ws.off('open'); this.ws.off('close'); this.ws.off('error'); this.ws = null; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/WebSocket_case/entry/src/main/ets/pages/Index.ets#L196-L217
91d2e66efcbfb70a2b43578def2302b667343426
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildBanRemove.ets
arkts
handle
应用约束10:显式声明参数类型(使用Object代替any)
handle(data: Object): void { const client = this.client; // 应用约束21:使用Map的get方法进行属性访问 const guild = client.guilds.get(data['guild_id']); // 应用约束21:使用Map的get方法进行属性访问 const user = client.dataManager.newUser(data['user']); if (guild && user) { // 应用约束21:使用字符串常量访问属性 client.emit(Constants.Events.GUILD_BAN_REMOVE, guild, user); } }
AST#method_declaration#Left handle AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left client = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . client AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 应用约束21:使用Map的get方法进行属性访问 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left guild = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left client AST#expression#Right . guilds AST#member_expression#Right AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#subscript_expression#Left AST#expression#Left data AST#expression#Right [ AST#expression#Left 'guild_id' AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right // 应用约束21:使用Map的get方法进行属性访问 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left user = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left client AST#expression#Right . dataManager AST#member_expression#Right AST#expression#Right . newUser AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#subscript_expression#Left AST#expression#Left data AST#expression#Right [ AST#expression#Left 'user' AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left guild AST#expression#Right && AST#expression#Left user AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { // 应用约束21:使用字符串常量访问属性 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left client AST#expression#Right . emit AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Constants AST#expression#Right . Events AST#member_expression#Right AST#expression#Right . GUILD_BAN_REMOVE AST#member_expression#Right AST#expression#Right , AST#expression#Left guild AST#expression#Right , AST#expression#Left user AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
handle(data: Object): void { const client = this.client; const guild = client.guilds.get(data['guild_id']); const user = client.dataManager.newUser(data['user']); if (guild && user) { client.emit(Constants.Events.GUILD_BAN_REMOVE, guild, user); } }
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildBanRemove.ets#L7-L17
72561e5c729bf204217bfc2762244cf35bda90f6
github
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/common/url.ets
arkts
forEach
values(): IterableIterator<string> { const params = this._params; let index = 0; const iterator: IterableIterator<string> = { next(): IteratorResult<string> { if (index < params.length) { const value = params[index].value; index++; return { value: value, done: false }; } return { value: '', done: true }; }, [Symbol.iterator](): IterableIterator<string> { return this; } }; return iterator; }
forEach(callback: (value: string, key: string, parent: URLSearchParams) => void): void { for (let i = 0; i < this._params.length; i++) { const param = this._params[i]; callback(param.value, param.key, this); } }
AST#method_declaration#Left forEach AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left 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#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 parent : AST#type_annotation#Left AST#primary_type#Left URLSearchParams AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left i AST#expression#Right < AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . _params AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ; AST#expression#Left AST#update_expression#Left AST#expression#Left i AST#expression#Right ++ AST#update_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left param = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . _params AST#member_expression#Right AST#expression#Right [ AST#expression#Left i AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left callback AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left param AST#expression#Right . value AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left param AST#expression#Right . key AST#member_expression#Right AST#expression#Right , AST#expression#Left this AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#for_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
forEach(callback: (value: string, key: string, parent: URLSearchParams) => void): void { for (let i = 0; i < this._params.length; i++) { const param = this._params[i]; callback(param.value, param.key, this); } }
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/common/url.ets#L252-L257
5c7590cdc620717ab6034d913be410cdce7423ce
github
openharmony-sig/knowledge_demo_smart_home
6cdf5d81ef84217f386c4200bfc4124a0ded5a0d
FA/DistScheduleEts/entry/src/main/ets/addDevice/pages/index.ets
arkts
getCurrentSsid
获取当前连接的wifi名称 @return name
private async getCurrentSsid() { let wifiSsid = '' // 调用WLAN连接状态接口,判断当前设备是否已连接到WLAN if (wifi.isConnected ) { // 获取wifi连接信息 let data = await wifi.getLinkedInfo() wifiSsid = data.ssid; }else{ wifiSsid = "" } return wifiSsid }
AST#method_declaration#Left private async getCurrentSsid AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left wifiSsid = AST#expression#Left '' AST#expression#Right AST#variable_declarator#Right // 调用WLAN连接状态接口,判断当前设备是否已连接到WLAN AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left wifi AST#expression#Right . isConnected AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { // 获取wifi连接信息 AST#ERROR#Left let AST#variable_declarator#Left data = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left wifi AST#expression#Right AST#await_expression#Right AST#expression#Right . getLinkedInfo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right w AST#ERROR#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left ifiSsid = AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . ssid AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right else AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left wifiSsid = AST#expression#Left "" AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left wifiSsid AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
private async getCurrentSsid() { let wifiSsid = '' if (wifi.isConnected ) { let data = await wifi.getLinkedInfo() wifiSsid = data.ssid; }else{ wifiSsid = "" } return wifiSsid }
https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/addDevice/pages/index.ets#L116-L127
26f45ea525d21fa77944754e76601b5ef93901cc
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
validator/acts_validator/entry/src/main/ets/pages/Notification/CustomNotification/model/NotificationOperations.ets
arkts
在初始化函数初始化基本通知类型的参数
constructor(context: Context) { this.context = context; let notificationTitle = ''; let notificationText = '通知内容'; let notificationAdditional = '通知次要内容'; this.basicContent = { title: notificationTitle, text: notificationText, additionalText: notificationAdditional }; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . context AST#member_expression#Right = AST#expression#Left context AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left notificationTitle = AST#expression#Left '' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left notificationText = AST#expression#Left '通知内容' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left notificationAdditional = AST#expression#Left '通知次要内容' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . basicContent AST#member_expression#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left notificationTitle AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left text AST#property_name#Right : AST#expression#Left notificationText AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left additionalText AST#property_name#Right : AST#expression#Left notificationAdditional AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#constructor_declaration#Right
constructor(context: Context) { this.context = context; let notificationTitle = ''; let notificationText = '通知内容'; let notificationAdditional = '通知次要内容'; this.basicContent = { title: notificationTitle, text: notificationText, additionalText: notificationAdditional }; }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/validator/acts_validator/entry/src/main/ets/pages/Notification/CustomNotification/model/NotificationOperations.ets#L62-L72
fc24280609069ce5b0efa0f5af016734443a3e08
gitee
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/casesfeature/advertisingpage/src/main/ets/components/AdvertisingPage.ets
arkts
timerInterval
控制页面显示倒计时
timerInterval() { this.timer = setInterval(() => { this.pageCountDown--; if (this.pageCountDown === 0) { router.pushUrl({url:"pages/home"}) this.changeFullScreen(false); clearInterval(this.timer); this.isShow = false; } }, 1000) }
AST#method_declaration#Left timerInterval AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . timer AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left setInterval AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#update_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . pageCountDown AST#member_expression#Right AST#expression#Right -- AST#update_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right 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 . pageCountDown AST#member_expression#Right AST#expression#Right === AST#expression#Left 0 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left router AST#expression#Right . pushUrl AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left url AST#property_name#Right : AST#expression#Left "pages/home" AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#statement#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 . changeFullScreen AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left clearInterval AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . timer AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isShow AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right , AST#expression#Left 1000 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
timerInterval() { this.timer = setInterval(() => { this.pageCountDown--; if (this.pageCountDown === 0) { router.pushUrl({url:"pages/home"}) this.changeFullScreen(false); clearInterval(this.timer); this.isShow = false; } }, 1000) }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/casesfeature/advertisingpage/src/main/ets/components/AdvertisingPage.ets#L59-L69
d97bceb72896f7560e0cb08ebe823aa5b7f1359e
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/database/GreetingHistoryDAO.ets
arkts
insertGreetingHistory
插入新祝福记录 @param greetingHistory 祝福历史实体 @returns 插入的记录ID
async insertGreetingHistory(greetingHistory: GreetingHistoryEntity): Promise<number> { const rdbStore = this.dbManager.getRdbStore(); if (!rdbStore) { throw new Error('Database not initialized'); } try { const currentTime = new Date().toISOString(); const valueBucket: relationalStore.ValuesBucket = { contact_id: greetingHistory.contact_id, greeting_content: greetingHistory.greeting_content, occasion: greetingHistory.occasion, sent_at: greetingHistory.sent_at, created_at: currentTime }; const rowId = await rdbStore.insert('greeting_history', valueBucket); console.info(`[GreetingHistoryDAO] Greeting history inserted with ID: ${rowId}`); return rowId; } catch (error) { const err = error as Error; throw new Error(`Failed to insert greeting history: ${err.message}`); } }
AST#method_declaration#Left async insertGreetingHistory AST#parameter_list#Left ( AST#parameter#Left greetingHistory : AST#type_annotation#Left AST#primary_type#Left GreetingHistoryEntity AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left rdbStore = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dbManager AST#member_expression#Right AST#expression#Right . getRdbStore AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#unary_expression#Left ! AST#expression#Left rdbStore AST#expression#Right AST#unary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'Database not initialized' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left currentTime = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Date AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . toISOString AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left valueBucket : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . ValuesBucket AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left contact_id AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left greetingHistory AST#expression#Right . contact_id AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left greeting_content AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left greetingHistory AST#expression#Right . greeting_content AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left occasion AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left greetingHistory AST#expression#Right . occasion AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left sent_at AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left greetingHistory AST#expression#Right . sent_at AST#member_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left created_at AST#property_name#Right : AST#expression#Left currentTime AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left rowId = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left rdbStore AST#expression#Right AST#await_expression#Right AST#expression#Right . insert AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'greeting_history' AST#expression#Right , AST#expression#Left valueBucket AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` [GreetingHistoryDAO] Greeting history inserted with ID: AST#template_substitution#Left $ { AST#expression#Left rowId AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left rowId AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left err = AST#expression#Left AST#as_expression#Left AST#expression#Left error AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left Error AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` Failed to insert greeting history: AST#template_substitution#Left $ { AST#expression#Left AST#member_expression#Left AST#expression#Left err AST#expression#Right . message AST#member_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async insertGreetingHistory(greetingHistory: GreetingHistoryEntity): Promise<number> { const rdbStore = this.dbManager.getRdbStore(); if (!rdbStore) { throw new Error('Database not initialized'); } try { const currentTime = new Date().toISOString(); const valueBucket: relationalStore.ValuesBucket = { contact_id: greetingHistory.contact_id, greeting_content: greetingHistory.greeting_content, occasion: greetingHistory.occasion, sent_at: greetingHistory.sent_at, created_at: currentTime }; const rowId = await rdbStore.insert('greeting_history', valueBucket); console.info(`[GreetingHistoryDAO] Greeting history inserted with ID: ${rowId}`); return rowId; } catch (error) { const err = error as Error; throw new Error(`Failed to insert greeting history: ${err.message}`); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/database/GreetingHistoryDAO.ets#L63-L86
9f8c36f4665cd03b7aa393212071a32e6594f2b6
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/blocks/modules/meowScratchingBoard.ets
arkts
copy_text
Copies a text into system pasteboard. @param text the text
copy_text(text: string) { copy(text); this.copied = true; clearTimeout(this.copied_timeout_id); this.copied_timeout_id = setTimeout(() => { this.copied = false; }, animation_popup_duration()) }
AST#method_declaration#Left copy_text AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#Left copy ( AST#expression#Left text AST#expression#Right ) ; AST#ui_custom_component_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . copied AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#ui_custom_component_statement#Left clearTimeout ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . copied_timeout_id AST#member_expression#Right AST#expression#Right ) ; AST#ui_custom_component_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . copied_timeout_id AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left setTimeout AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . copied AST#member_expression#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left animation_popup_duration AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
copy_text(text: string) { copy(text); this.copied = true; clearTimeout(this.copied_timeout_id); this.copied_timeout_id = setTimeout(() => { this.copied = false; }, animation_popup_duration()) }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/blocks/modules/meowScratchingBoard.ets#L380-L387
d2dcae28fc6b4e4ac7544e6cb0885f2f79bede95
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/main/sub/report/RadarView.ets
arkts
clone
深拷贝方法
clone(): ChartPart { return new ChartPart(this.partName, this.allCount, this.curCount, this.color); }
AST#method_declaration#Left clone AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ChartPart 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_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ChartPart AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . partName AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . allCount AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . curCount AST#member_expression#Right AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . color AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
clone(): ChartPart { return new ChartPart(this.partName, this.allCount, this.curCount, this.color); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/main/sub/report/RadarView.ets#L398-L400
12eb4a1c34cadacc05f3bd1b9c1a850685bd9c2f
github
wuyuanwuhui999/harmony-arkts-chat-app-ui.git
128861bc002adae9c34c6ce8fbf12686c26e51ec
entry/src/main/ets/utils/PreferenceModel.ets
arkts
getToken
获取 token
async getToken() { return this.getPreference('token'); }
AST#method_declaration#Left async getToken AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getPreference AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left 'token' AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async getToken() { return this.getPreference('token'); }
https://github.com/wuyuanwuhui999/harmony-arkts-chat-app-ui.git/blob/128861bc002adae9c34c6ce8fbf12686c26e51ec/entry/src/main/ets/utils/PreferenceModel.ets#L85-L87
c17d38f35e1556b4a395f0119370cdecd2901b89
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/CommonRepository.ets
arkts
getDictData
获取字典数据 @param request 字典数据请求参数 @returns 字典数据结果
async getDictData(request: DictDataRequest): Promise<NetworkResponse<DictDataResponse>> { return this.networkDataSource.getDictData(request); }
AST#method_declaration#Left async getDictData AST#parameter_list#Left ( AST#parameter#Left request : AST#type_annotation#Left AST#primary_type#Left DictDataRequest AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left NetworkResponse AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left DictDataResponse AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right 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_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . networkDataSource AST#member_expression#Right AST#expression#Right . getDictData AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left request AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
async getDictData(request: DictDataRequest): Promise<NetworkResponse<DictDataResponse>> { return this.networkDataSource.getDictData(request); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/CommonRepository.ets#L44-L46
5006c57494dbd3a3d0efcfb4391a1a715e295c51
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imageviewer/Index.ets
arkts
CommonLazyDataSourceModel
model
export { CommonLazyDataSourceModel } from './src/main/ets/model/CommonLazyDataSourceModel'
AST#export_declaration#Left export { CommonLazyDataSourceModel } from './src/main/ets/model/CommonLazyDataSourceModel' AST#export_declaration#Right
export { CommonLazyDataSourceModel } from './src/main/ets/model/CommonLazyDataSourceModel'
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imageviewer/Index.ets#L27-L27
a40aa26ab3969224dbbdddee0143d70811abbf06
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
getCenterText
returns the text that is drawn in the center of the pie-chart @return
public getCenterText(): string /*CharSequence*/ { return this.mCenterText; }
AST#method_declaration#Left public getCenterText 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 /*CharSequence*/ AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . mCenterText AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public getCenterText(): string { return this.mCenterText; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L492-L495
46ad58d784c9275b376a777f8ea3f06336f71cb3
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/view/OrderCommentPage.ets
arkts
ImagePickerSection
图片选择区域 @returns {void} 无返回值
@Builder private ImagePickerSection(): void { IBestUploader({ fileList: this.vm.imageList!!, max: 9, previewSize: 90, cornerRadius: 8, uploaderBgColor: $r("app.color.bg_content"), onChange: (list: IBestUploaderFile[], _allList: IBestUploaderFile[]): void => this.vm.updateImageList(list) }); }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private ImagePickerSection 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_component_statement#Left IBestUploader ( AST#component_parameters#Left { AST#component_parameter#Left fileList : AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#non_null_assertion_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . imageList AST#member_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right ! AST#non_null_assertion_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left max : AST#expression#Left 9 AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left previewSize : AST#expression#Left 90 AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left cornerRadius : AST#expression#Left 8 AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left uploaderBgColor : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.color.bg_content" AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#component_parameter#Right , AST#component_parameter#Left onChange : AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left list : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left IBestUploaderFile [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left _allList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left IBestUploaderFile [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right => AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . vm AST#member_expression#Right AST#expression#Right . updateImageList AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left list AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right ) ; AST#ui_custom_component_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder private ImagePickerSection(): void { IBestUploader({ fileList: this.vm.imageList!!, max: 9, previewSize: 90, cornerRadius: 8, uploaderBgColor: $r("app.color.bg_content"), onChange: (list: IBestUploaderFile[], _allList: IBestUploaderFile[]): void => this.vm.updateImageList(list) }); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderCommentPage.ets#L148-L158
10b5409f978d811d95bf0673be11433e2d808da2
github
Neptune-EX/OS_System_Design.git
c728a82d48079ae0c52d50c4a2e2586b69f4ce55
entry/src/main/ets/common/utils/SavingAndSelectUserFile.ets
arkts
readUserFile. Reads the contents of a user directory file. @return Promise<string>.
export async function readUserFile(): Promise<string> { try { let DocumentSelectOptions = new picker.DocumentSelectOptions(); let documentPicker = new picker.DocumentViewPicker(); await documentPicker.select(DocumentSelectOptions).then((DocumentSelectResult: Array<string>) => { Logger.info('DocumentViewPicker.select successfully, uri: ' + JSON.stringify(DocumentSelectResult)); uri = DocumentSelectResult[0]; let file = fileIo.openSync(uri, fileIo.OpenMode.READ_WRITE); let stat = fileIo.statSync(file.fd); let size = stat.size; let buf = new ArrayBuffer(size); fileIo.readSync(file.fd, buf); let con = buffer.from(buf, 0); message = con.toString(); Logger.info('DocumentViewPicker.select successfully, message: ' + message); return message; }).catch((err: BusinessError) => { Logger.error('DocumentViewPicker.select failed with err: ' + JSON.stringify(err)); }); } catch (error) { let err = error as BusinessError; Logger.error('DocumentViewPicker.select failed with err: ' + err.message); } return message; }
AST#export_declaration#Left export AST#function_declaration#Left async function readUserFile AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left DocumentSelectOptions = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left picker AST#expression#Right AST#new_expression#Right AST#expression#Right . DocumentSelectOptions AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left documentPicker = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left picker AST#expression#Right AST#new_expression#Right AST#expression#Right . DocumentViewPicker AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left documentPicker AST#expression#Right AST#await_expression#Right AST#expression#Right . select AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left DocumentSelectOptions AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . then AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left DocumentSelectResult : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 'DocumentViewPicker.select successfully, uri: ' AST#expression#Right + AST#expression#Left JSON AST#expression#Right AST#binary_expression#Right AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left DocumentSelectResult AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left uri = AST#expression#Left AST#subscript_expression#Left AST#expression#Left DocumentSelectResult AST#expression#Right [ AST#expression#Left 0 AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left file = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . openSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left uri AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . OpenMode AST#member_expression#Right AST#expression#Right . READ_WRITE AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left stat = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . statSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left file AST#expression#Right . fd AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left size = AST#expression#Left AST#member_expression#Left AST#expression#Left stat AST#expression#Right . size AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left buf = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ArrayBuffer AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left size AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fileIo AST#expression#Right . readSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left file AST#expression#Right . fd AST#member_expression#Right AST#expression#Right , AST#expression#Left buf AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left con = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left buffer AST#expression#Right . from AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left buf AST#expression#Right , AST#expression#Left 0 AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left message = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left con AST#expression#Right . toString AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left 'DocumentViewPicker.select successfully, message: ' AST#expression#Right + AST#expression#Left message AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left message AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right . catch AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left err : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 'DocumentViewPicker.select failed with err: ' AST#expression#Right + AST#expression#Left JSON AST#expression#Right AST#binary_expression#Right AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left err AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left err = AST#expression#Left AST#as_expression#Left AST#expression#Left error AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 'DocumentViewPicker.select failed with err: ' AST#expression#Right + AST#expression#Left err AST#expression#Right AST#binary_expression#Right AST#expression#Right . message AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left message AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
export async function readUserFile(): Promise<string> { try { let DocumentSelectOptions = new picker.DocumentSelectOptions(); let documentPicker = new picker.DocumentViewPicker(); await documentPicker.select(DocumentSelectOptions).then((DocumentSelectResult: Array<string>) => { Logger.info('DocumentViewPicker.select successfully, uri: ' + JSON.stringify(DocumentSelectResult)); uri = DocumentSelectResult[0]; let file = fileIo.openSync(uri, fileIo.OpenMode.READ_WRITE); let stat = fileIo.statSync(file.fd); let size = stat.size; let buf = new ArrayBuffer(size); fileIo.readSync(file.fd, buf); let con = buffer.from(buf, 0); message = con.toString(); Logger.info('DocumentViewPicker.select successfully, message: ' + message); return message; }).catch((err: BusinessError) => { Logger.error('DocumentViewPicker.select failed with err: ' + JSON.stringify(err)); }); } catch (error) { let err = error as BusinessError; Logger.error('DocumentViewPicker.select failed with err: ' + err.message); } return message; }
https://github.com/Neptune-EX/OS_System_Design.git/blob/c728a82d48079ae0c52d50c4a2e2586b69f4ce55/entry/src/main/ets/common/utils/SavingAndSelectUserFile.ets#L56-L80
2447039233b7ad15b5df4821034464dd4054e0c6
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/YAxis.ets
arkts
isDrawTopYLabelEntryEnabled
returns true if drawing the top y-axis label entry is enabled @return
public isDrawTopYLabelEntryEnabled(): boolean { return this.mDrawTopYLabelEntry; }
AST#method_declaration#Left public isDrawTopYLabelEntryEnabled 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#member_expression#Left AST#expression#Left this AST#expression#Right . mDrawTopYLabelEntry AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
public isDrawTopYLabelEntryEnabled(): boolean { return this.mDrawTopYLabelEntry; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/YAxis.ets#L261-L263
8bd25805f66fe4e6839b558844b0cafc443424b9
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/services/CartService.ets
arkts
addListener
添加监听器
addListener(listener: (count: number) => void): void { this.listeners.push(listener); }
AST#method_declaration#Left addListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left count : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#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#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . listeners AST#member_expression#Right AST#expression#Right . push AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left listener AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
addListener(listener: (count: number) => void): void { this.listeners.push(listener); }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/services/CartService.ets#L33-L35
264d0b56ccb1722117907b77932c6d3793237a26
github
Active-hue/ArkTS-Accounting.git
c432916d305b407557f08e35017c3fd70668e441
entry/src/main/ets/pages/AboutUs.ets
arkts
FeatureItem
功能项组件
@Builder FeatureItem(icon: string, title: string, description: string) { Row() { Text(icon) .fontSize(32) .width(48) .height(48) .textAlign(TextAlign.Center) .borderRadius(12) .backgroundColor('#F5F7FF') .margin({ right: 16 }) Column() { Text(title) .fontSize(16) .fontColor('#333333') .fontWeight(FontWeight.Medium) .margin({ bottom: 4 }) Text(description) .fontSize(13) .fontColor('#999999') .lineHeight(20) } .alignItems(HorizontalAlign.Start) .layoutWeight(1) } .width('100%') .alignItems(VerticalAlign.Top) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right FeatureItem AST#parameter_list#Left ( AST#parameter#Left icon : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left description : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left icon AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 32 AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left 48 AST#expression#Right ) AST#modifier_chain_expression#Left . height ( AST#expression#Left 48 AST#expression#Right ) AST#modifier_chain_expression#Left . textAlign ( AST#expression#Left AST#member_expression#Left AST#expression#Left TextAlign AST#expression#Right . Center AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left 12 AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left '#F5F7FF' AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left right AST#property_name#Right : AST#expression#Left 16 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right 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 title AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 16 AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left '#333333' AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left FontWeight AST#expression#Right . Medium AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left bottom AST#property_name#Right : AST#expression#Left 4 AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left description AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left 13 AST#expression#Right ) AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left '#999999' AST#expression#Right ) AST#modifier_chain_expression#Left . lineHeight ( AST#expression#Left 20 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . alignItems ( AST#expression#Left AST#member_expression#Left AST#expression#Left HorizontalAlign AST#expression#Right . Start AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . layoutWeight ( AST#expression#Left 1 AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . alignItems ( AST#expression#Left AST#member_expression#Left AST#expression#Left VerticalAlign AST#expression#Right . Top AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#builder_function_body#Right AST#method_declaration#Right
@Builder FeatureItem(icon: string, title: string, description: string) { Row() { Text(icon) .fontSize(32) .width(48) .height(48) .textAlign(TextAlign.Center) .borderRadius(12) .backgroundColor('#F5F7FF') .margin({ right: 16 }) Column() { Text(title) .fontSize(16) .fontColor('#333333') .fontWeight(FontWeight.Medium) .margin({ bottom: 4 }) Text(description) .fontSize(13) .fontColor('#999999') .lineHeight(20) } .alignItems(HorizontalAlign.Start) .layoutWeight(1) } .width('100%') .alignItems(VerticalAlign.Top) }
https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/AboutUs.ets#L216-L245
6c68de890ef6f195b5eb888b3a640a6ff034e097
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets
arkts
setAndRef
Returns an alias to the AppStorage property with given name. If property does not exist in AppStorage, create it with the given value. @param propName - a property name @param defaultValue - a value used to create property if it does not exist @returns an AbstractProperty for the given name
static setAndRef<T>(propName: string, defaultValue: T): AbstractProperty<T> { return StorageMap.shared.entryOrCreate(propName, defaultValue) }
AST#method_declaration#Left static setAndRef AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left defaultValue : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left AbstractProperty AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right 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_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left StorageMap AST#expression#Right . shared AST#member_expression#Right AST#expression#Right . entryOrCreate AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left propName AST#expression#Right , AST#expression#Left defaultValue AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static setAndRef<T>(propName: string, defaultValue: T): AbstractProperty<T> { return StorageMap.shared.entryOrCreate(propName, defaultValue) }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L44-L46
cb5f867904bcae9a6a585669a690bd63b178145f
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/DialogHub.ets
arkts
getToast
【系统】显示吐司(该方法可设置样式) @param options @returns
static getToast(message: ResourceStr): ToastDialog { return new ToastDialog(message) }
AST#method_declaration#Left static getToast AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ToastDialog 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_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left ToastDialog AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left message AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static getToast(message: ResourceStr): ToastDialog { return new ToastDialog(message) }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogHub.ets#L85-L87
28f89d87bd2f270d0ceeb6c4cc0131e75087559e
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
entry/src/main/ets/pages/lineCharts/MultiplePage.ets
arkts
menuCallback
标题栏菜单回调
@Monitor("titleModel.index") menuCallback() { if (this.titleModel === null || this.titleModel === undefined) { return } let index: number = this.titleModel.getIndex() if (index === undefined || index === null || index === -1) { return } let data = this.model.getData(); let sets: JArrayList<ILineDataSet> | null = null; if (data) { sets = data.getDataSets(); } switch (this.menuItemArr[index]) { case Constants.TOGGLE_VALUES: this.toggleValues(data, sets) break;
AST#method_declaration#Left AST#decorator#Left @ Monitor ( AST#expression#Left "titleModel.index" AST#expression#Right ) AST#decorator#Right menuCallback AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left { AST#ERROR#Left AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . titleModel AST#member_expression#Right AST#expression#Right === AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left this AST#expression#Right AST#binary_expression#Right AST#expression#Right . titleModel AST#member_expression#Right AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#object_literal#Left { AST#ERROR#Left return AST#ERROR#Right } AST#object_literal#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . titleModel AST#member_expression#Right AST#expression#Right . getIndex AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left undefined AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right || AST#expression#Left AST#binary_expression#Left AST#expression#Left index AST#expression#Right === AST#expression#Left AST#unary_expression#Left - AST#expression#Left 1 AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#object_literal#Left { AST#ERROR#Left return AST#ERROR#Right } AST#object_literal#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left data = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . model AST#member_expression#Right AST#expression#Right . getData AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left sets : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#generic_type#Left JArrayList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ILineDataSet AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left data AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left sets = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left data AST#expression#Right . getDataSets AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left switch AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . menuItemArr AST#member_expression#Right AST#expression#Right [ AST#expression#Left index AST#expression#Right ] AST#subscript_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#expression_statement#Right AST#statement#Right { AST#property_name#Left case AST#property_name#Right Constants AST#ERROR#Right AST#modifier_chain_expression#Left . TOGGLE_VALUES AST#modifier_chain_expression#Right AST#ERROR#Right : AST#ERROR#Left AST#qualified_type#Left this . toggleValues AST#qualified_type#Right AST#parameter_list#Left ( AST#parameter#Left data AST#parameter#Right , AST#parameter#Left sets AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Right AST#type_annotation#Left AST#primary_type#Left break AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right
@Monitor("titleModel.index") menuCallback() { if (this.titleModel === null || this.titleModel === undefined) { return } let index: number = this.titleModel.getIndex() if (index === undefined || index === null || index === -1) { return } let data = this.model.getData(); let sets: JArrayList<ILineDataSet> | null = null; if (data) { sets = data.getDataSets(); } switch (this.menuItemArr[index]) { case Constants.TOGGLE_VALUES: this.toggleValues(data, sets) break;
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/entry/src/main/ets/pages/lineCharts/MultiplePage.ets#L176-L193
c590afc8687da44918af6b045fb4a18a05c0945e
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/Plan.ets
arkts
dayOfFor
/ 获取指定日期的dayOf
dayOfFor(date: Date): DayOf | null { if (this.startDate !== null) { let num = this.daysTo(this.startDate, date); return this.dayOfs.find((d) => d.num === num) ?? null; } return null; }
AST#method_declaration#Left dayOfFor AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left DayOf AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#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 . startDate AST#member_expression#Right AST#expression#Right !== AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left num = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . daysTo AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . startDate AST#member_expression#Right AST#expression#Right , AST#expression#Left date AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dayOfs AST#member_expression#Right AST#expression#Right . find AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left d AST#parameter#Right ) AST#parameter_list#Right => AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left d AST#expression#Right . num AST#member_expression#Right AST#expression#Right === AST#expression#Left num AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#arrow_function#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ?? AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#null_literal#Left null AST#null_literal#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
dayOfFor(date: Date): DayOf | null { if (this.startDate !== null) { let num = this.daysTo(this.startDate, date); return this.dayOfs.find((d) => d.num === num) ?? null; } return null; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L145-L151
3c26a9a274c1d7b27bf981e5e67bcd302af51e37
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
AvoidTimeComsume/entry/src/main/ets/views/WaterFlowDataSource.ets
arkts
addLastItem
Add an element to the tail of the data
public addLastItem(): void { this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length); this.notifyDataAdd(this.dataArray.length - 1); }
AST#method_declaration#Left public addLastItem 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#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dataArray AST#member_expression#Right AST#expression#Right . splice AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dataArray AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right , AST#expression#Left 0 AST#expression#Right , AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dataArray AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right 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 . notifyDataAdd AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . dataArray AST#member_expression#Right AST#expression#Right . length AST#member_expression#Right AST#expression#Right - AST#expression#Left 1 AST#expression#Right AST#binary_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
public addLastItem(): void { this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length); this.notifyDataAdd(this.dataArray.length - 1); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/AvoidTimeComsume/entry/src/main/ets/views/WaterFlowDataSource.ets#L100-L103
044f35a3992a8c7fb31ecc3fc627d6da433d4721
gitee
huangwei021230/HarmonyFlow.git
427f918873b0c9efdc975ff4889726b1bfccc546
entry/src/main/ets/lib/io/FsFile.ets
arkts
subDir
Helper function to get a subdirectory of a directory. @param relPath The relative path of the subdirectory. @returns The subdirectory.
function subDir(dir: FsDir, relPath: string): FsDir { return fs.dir(dir, relPath); }
AST#function_declaration#Left function subDir AST#parameter_list#Left ( AST#parameter#Left dir : AST#type_annotation#Left AST#primary_type#Left FsDir AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left relPath : 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 FsDir 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_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left fs AST#expression#Right . dir AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left dir AST#expression#Right , AST#expression#Left relPath AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right
function subDir(dir: FsDir, relPath: string): FsDir { return fs.dir(dir, relPath); }
https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/lib/io/FsFile.ets#L18-L20
c3be503ea226a0fa8cd2922b789cfc97a3cfae15
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/mapthumbtack/src/main/ets/components/ThumbTackComponent.ets
arkts
createRingAnimation
创建帧帽波纹动画
createRingAnimation() { // 创建帽檐宽度变化动画 this.hatBrimWidthAnimator = animator.create({ // 400, 大头针帽檐动画持续400ms duration: 400, easing: 'linear', delay: 0, fill: 'forwards', direction: 'normal', iterations: -1, begin: 0, end: this.thumbTackWidth * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO }) this.hatBrimWidthAnimator.onRepeat = () => { let tmp: number = this.greenHatZIdx; this.greenHatZIdx = this.whiteHatZIdx; this.whiteHatZIdx = tmp; } this.hatBrimWidthAnimator.onCancel = () => { this.whiteTackHatWidth = this.thumbTackWidth * ThumbTackCommonConstants.TACK_HAT_ANIMATION_HEIGHT_RATIO; this.whiteHatZIdx = ThumbTackCommonConstants.ICON_DOWN_LAYER_RING_Z_IDX; this.greenHatZIdx = ThumbTackCommonConstants.ICON_UP_LAYER_RING_Z_IDX; this.greenTackHatBrimWidth = this.thumbTackWidth * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO; this.greenTackHatWidth = this.thumbTackWidth; } this.hatBrimWidthAnimator.onFrame = (value) => { if (this.greenHatZIdx === ThumbTackCommonConstants.ICON_UP_LAYER_RING_Z_IDX) { this.greenTackHatBrimWidth = value; this.greenTackHatWidth = this.thumbTackWidth * (1 - 2 * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO) + 2 * value; } if (this.whiteHatZIdx === ThumbTackCommonConstants.ICON_UP_LAYER_RING_Z_IDX) { this.whiteTackHatBrimWidth = value; this.whiteTackHatWidth = this.thumbTackWidth * (1 - 2 * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO) + 2 * value; } } }
AST#method_declaration#Left createRingAnimation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 创建帽檐宽度变化动画 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . hatBrimWidthAnimator AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left animator AST#expression#Right . create AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#object_literal#Left { // 400, 大头针帽檐动画持续400ms AST#property_assignment#Left AST#property_name#Left duration AST#property_name#Right : AST#expression#Left 400 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left easing AST#property_name#Right : AST#expression#Left 'linear' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left delay AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left fill AST#property_name#Right : AST#expression#Left 'forwards' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left direction AST#property_name#Right : AST#expression#Left 'normal' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left iterations AST#property_name#Right : AST#expression#Left AST#unary_expression#Left - AST#expression#Left 1 AST#expression#Right AST#unary_expression#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left begin AST#property_name#Right : AST#expression#Left 0 AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left end AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . thumbTackWidth AST#member_expression#Right AST#expression#Right * AST#expression#Left ThumbTackCommonConstants AST#expression#Right AST#binary_expression#Right AST#expression#Right . TACK_HAT_BRIM_WIDTH_RATIO AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . hatBrimWidthAnimator AST#member_expression#Right AST#expression#Right . onRepeat AST#member_expression#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left tmp : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . greenHatZIdx AST#member_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . greenHatZIdx AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . whiteHatZIdx AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . whiteHatZIdx AST#member_expression#Right = AST#expression#Left tmp AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . hatBrimWidthAnimator AST#member_expression#Right AST#expression#Right . onCancel AST#member_expression#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . whiteTackHatWidth AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . thumbTackWidth AST#member_expression#Right AST#expression#Right * AST#expression#Left ThumbTackCommonConstants AST#expression#Right AST#binary_expression#Right AST#expression#Right . TACK_HAT_ANIMATION_HEIGHT_RATIO AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . whiteHatZIdx AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left ThumbTackCommonConstants AST#expression#Right . ICON_DOWN_LAYER_RING_Z_IDX AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . greenHatZIdx AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left ThumbTackCommonConstants AST#expression#Right . ICON_UP_LAYER_RING_Z_IDX AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . greenTackHatBrimWidth AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . thumbTackWidth AST#member_expression#Right AST#expression#Right * AST#expression#Left ThumbTackCommonConstants AST#expression#Right AST#binary_expression#Right AST#expression#Right . TACK_HAT_BRIM_WIDTH_RATIO AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . greenTackHatWidth AST#member_expression#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . thumbTackWidth AST#member_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . hatBrimWidthAnimator AST#member_expression#Right AST#expression#Right . onFrame AST#member_expression#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( AST#parameter#Left value AST#parameter#Right ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . greenHatZIdx AST#member_expression#Right AST#expression#Right === AST#expression#Left ThumbTackCommonConstants AST#expression#Right AST#binary_expression#Right AST#expression#Right . ICON_UP_LAYER_RING_Z_IDX AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . greenTackHatBrimWidth AST#member_expression#Right = AST#expression#Left value AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . greenTackHatWidth AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . thumbTackWidth AST#member_expression#Right AST#expression#Right * AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 1 AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left 2 AST#expression#Right * AST#expression#Left ThumbTackCommonConstants AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . TACK_HAT_BRIM_WIDTH_RATIO AST#member_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left 2 AST#expression#Right * AST#expression#Left value AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . whiteHatZIdx AST#member_expression#Right AST#expression#Right === AST#expression#Left ThumbTackCommonConstants AST#expression#Right AST#binary_expression#Right AST#expression#Right . ICON_UP_LAYER_RING_Z_IDX AST#member_expression#Right AST#expression#Right ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . whiteTackHatBrimWidth AST#member_expression#Right = AST#expression#Left value AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . whiteTackHatWidth AST#member_expression#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . thumbTackWidth AST#member_expression#Right AST#expression#Right * AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 1 AST#expression#Right - AST#expression#Left AST#binary_expression#Left AST#expression#Left 2 AST#expression#Right * AST#expression#Left ThumbTackCommonConstants AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right . TACK_HAT_BRIM_WIDTH_RATIO AST#member_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right + AST#expression#Left AST#binary_expression#Left AST#expression#Left 2 AST#expression#Right * AST#expression#Left value AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#binary_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#if_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
createRingAnimation() { this.hatBrimWidthAnimator = animator.create({ duration: 400, easing: 'linear', delay: 0, fill: 'forwards', direction: 'normal', iterations: -1, begin: 0, end: this.thumbTackWidth * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO }) this.hatBrimWidthAnimator.onRepeat = () => { let tmp: number = this.greenHatZIdx; this.greenHatZIdx = this.whiteHatZIdx; this.whiteHatZIdx = tmp; } this.hatBrimWidthAnimator.onCancel = () => { this.whiteTackHatWidth = this.thumbTackWidth * ThumbTackCommonConstants.TACK_HAT_ANIMATION_HEIGHT_RATIO; this.whiteHatZIdx = ThumbTackCommonConstants.ICON_DOWN_LAYER_RING_Z_IDX; this.greenHatZIdx = ThumbTackCommonConstants.ICON_UP_LAYER_RING_Z_IDX; this.greenTackHatBrimWidth = this.thumbTackWidth * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO; this.greenTackHatWidth = this.thumbTackWidth; } this.hatBrimWidthAnimator.onFrame = (value) => { if (this.greenHatZIdx === ThumbTackCommonConstants.ICON_UP_LAYER_RING_Z_IDX) { this.greenTackHatBrimWidth = value; this.greenTackHatWidth = this.thumbTackWidth * (1 - 2 * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO) + 2 * value; } if (this.whiteHatZIdx === ThumbTackCommonConstants.ICON_UP_LAYER_RING_Z_IDX) { this.whiteTackHatBrimWidth = value; this.whiteTackHatWidth = this.thumbTackWidth * (1 - 2 * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO) + 2 * value; } } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/mapthumbtack/src/main/ets/components/ThumbTackComponent.ets#L114-L151
6799a843a54788e3ad2f81fe1c08375ebc48a7b1
gitee
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/common/SettingsStorage.ets
arkts
主题设置(如果需要存储主题)
export async function getThemeColor(): Promise<string> { const settings = getSettingsInstance(); return (await settings.get("themeColor", "blue")) as string; }
AST#export_declaration#Left export AST#function_declaration#Left async function getThemeColor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left settings = AST#expression#Left AST#call_expression#Left AST#expression#Left getSettingsInstance AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#as_expression#Left AST#expression#Left AST#parenthesized_expression#Left ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left settings AST#expression#Right AST#await_expression#Right AST#expression#Right . get AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "themeColor" AST#expression#Right , AST#expression#Left "blue" AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#parenthesized_expression#Right AST#expression#Right as AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#as_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#function_declaration#Right AST#export_declaration#Right
export async function getThemeColor(): Promise<string> { const settings = getSettingsInstance(); return (await settings.get("themeColor", "blue")) as string; }
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/common/SettingsStorage.ets#L71-L74
3aa10e2c53501dcf711691de8a31fd26667d6cf6
github
L1rics06/arkTS-.git
991fd131bfdb11e2933152133c97453d86092ac0
entry/src/main/ets/pages/NetworkUtil.ets
arkts
getNoticeList
获取通知列表
static async getNoticeList(userId: string): Promise<ResponseDao<NoticeListResponse>> { try { const params: NoticeListParams = { id: userId }; const response: AxiosResponse<ResponseDao<NoticeListResponse>> = await axios.post( `${BASE_URL}/ddchat/notice/getList`, params, { headers: NetworkUtil.mergeHeaders("application/json") } ); return response.data; } catch (error) { console.error("Get notice list error:", JSON.stringify(error)); throw new Error(`Failed to get notice list: ${JSON.stringify(error)}`); } }
AST#method_declaration#Left static async getNoticeList 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_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 ResponseDao AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left NoticeListResponse AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left params : AST#type_annotation#Left AST#primary_type#Left NoticeListParams AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left id AST#property_name#Right : AST#expression#Left userId AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left response : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left AxiosResponse AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ResponseDao AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left NoticeListResponse AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right AST#generic_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#expression#Left axios AST#expression#Right AST#await_expression#Right AST#expression#Right . post AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` AST#template_substitution#Left $ { AST#expression#Left BASE_URL AST#expression#Right } AST#template_substitution#Right /ddchat/notice/getList ` AST#template_literal#Right AST#expression#Right , AST#expression#Left params AST#expression#Right , AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left headers AST#property_name#Right : AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left NetworkUtil AST#expression#Right . mergeHeaders AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "application/json" AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left response AST#expression#Right . data AST#member_expression#Right AST#expression#Right ; AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Left catch ( error ) AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . error AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left "Get notice list error:" AST#expression#Right , AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right AST#statement#Left AST#throw_statement#Left throw AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Error AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left AST#template_literal#Left ` Failed to get notice list: AST#template_substitution#Left $ { AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left JSON AST#expression#Right . stringify AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left error AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right } AST#template_substitution#Right ` AST#template_literal#Right AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right ; AST#throw_statement#Right AST#statement#Right } AST#block_statement#Right AST#catch_clause#Right AST#try_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static async getNoticeList(userId: string): Promise<ResponseDao<NoticeListResponse>> { try { const params: NoticeListParams = { id: userId }; const response: AxiosResponse<ResponseDao<NoticeListResponse>> = await axios.post( `${BASE_URL}/ddchat/notice/getList`, params, { headers: NetworkUtil.mergeHeaders("application/json") } ); return response.data; } catch (error) { console.error("Get notice list error:", JSON.stringify(error)); throw new Error(`Failed to get notice list: ${JSON.stringify(error)}`); } }
https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L475-L491
9b43b5d5bb469390320735a208e407e707c1973f
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/etswrapper/src/main/cpp/types/libetswrapper/index.d.ets
arkts
注册封装后的select与save方法,全局仅需调用一次
export const registryDocumentViewPickerFn: ( select: ( uiContext: UIContext, options: picker.DocumentSelectOptions, thenWrapper: StringArrayCbWrapper, catchWrapper: CatchCbWrapper ) => void, save: ( uiContext: UIContext, options: picker.DocumentSaveOptions, thenWrapper: StringArrayCbWrapper, catchWrapper: CatchCbWrapper ) => void ) => void;
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left registryDocumentViewPickerFn : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left select : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left picker . DocumentSelectOptions AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left thenWrapper : AST#type_annotation#Left AST#primary_type#Left StringArrayCbWrapper AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left catchWrapper : AST#type_annotation#Left AST#primary_type#Left CatchCbWrapper AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left save : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left picker . DocumentSaveOptions AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left thenWrapper : AST#type_annotation#Left AST#primary_type#Left StringArrayCbWrapper AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left catchWrapper : AST#type_annotation#Left AST#primary_type#Left CatchCbWrapper AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right AST#type_annotation#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const registryDocumentViewPickerFn: ( select: ( uiContext: UIContext, options: picker.DocumentSelectOptions, thenWrapper: StringArrayCbWrapper, catchWrapper: CatchCbWrapper ) => void, save: ( uiContext: UIContext, options: picker.DocumentSaveOptions, thenWrapper: StringArrayCbWrapper, catchWrapper: CatchCbWrapper ) => void ) => void;
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/etswrapper/src/main/cpp/types/libetswrapper/index.d.ets#L8-L21
7f1fb19987c129ffff01a34d58f6dbf9241bef0e
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/PreferencesUtils.ets
arkts
getAllSync
static init(preferenceName: string = defaultPreferenceName) { PreferencesUtils.preferenceName = preferenceName } 获取所有 数据缓存 @param preferenceName @returns
static getAllSync(preferenceName: string = defaultPreferenceName) { let preferences = PreferencesUtils.getPreferencesSync(preferenceName); //获取实例 return preferences.getAllSync() }
AST#method_declaration#Left static getAllSync AST#parameter_list#Left ( AST#parameter#Left preferenceName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left defaultPreferenceName AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left preferences = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left PreferencesUtils AST#expression#Right . getPreferencesSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( AST#expression#Left preferenceName AST#expression#Right ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#statement#Right //获取实例 AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left preferences AST#expression#Right . getAllSync AST#member_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#return_statement#Right AST#statement#Right } AST#block_statement#Right AST#method_declaration#Right
static getAllSync(preferenceName: string = defaultPreferenceName) { let preferences = PreferencesUtils.getPreferencesSync(preferenceName); return preferences.getAllSync() }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/PreferencesUtils.ets#L27-L30
d43d65e095eb7eddf962144b3c2797e36bf8bf50
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/servercfg/AppCfgManager.ets
arkts
get
获取单例实例
static get shared(): AppCfgManager { if (!AppCfgManager.instance) { AppCfgManager.instance = new AppCfgManager(); } return AppCfgManager.instance; }
AST#method_declaration#Left static get AST#ERROR#Left shared AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AppCfgManager AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left AppCfgManager AST#expression#Right AST#unary_expression#Right AST#expression#Right . instance AST#member_expression#Right AST#expression#Right ) { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AppCfgManager AST#expression#Right . instance AST#member_expression#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left AppCfgManager AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST#call_expression#Right AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#ui_if_statement#Right AST#ui_control_flow#Right AST#expression_statement#Left AST#expression#Left return AST#expression#Right AST#expression_statement#Right AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AppCfgManager AST#expression#Right . instance AST#member_expression#Right AST#expression#Right ; AST#expression_statement#Right } AST#builder_function_body#Right AST#method_declaration#Right
static get shared(): AppCfgManager { if (!AppCfgManager.instance) { AppCfgManager.instance = new AppCfgManager(); } return AppCfgManager.instance; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/servercfg/AppCfgManager.ets#L87-L92
1682b36a398eb6bd9b13e9337edf0da939796c4a
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkUI/orientationDevelopment/entry/src/main/ets/pages/Index.ets
arkts
[StartExclude enable_nfc]
build() { RelativeContainer() { Text(this.message) .id('HelloWorld') .fontSize($r('app.float.page_text_font_size')) .fontWeight(FontWeight.Bold) .alignRules({ center: { anchor: '__container__', align: VerticalAlign.Center }, middle: { anchor: '__container__', align: HorizontalAlign.Center } }) .onClick(() => { this.message = 'Welcome'; }) } .height('100%') .width('100%') }
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left RelativeContainer ( ) 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#member_expression#Left AST#expression#Left this AST#expression#Right . message AST#member_expression#Right AST#expression#Right ) AST#ui_component#Right AST#modifier_chain_expression#Left . id ( AST#expression#Left 'HelloWorld' AST#expression#Right ) AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.float.page_text_font_size' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . fontWeight ( AST#expression#Left AST#member_expression#Left AST#expression#Left FontWeight AST#expression#Right . Bold AST#member_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . alignRules ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left center AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left anchor AST#property_name#Right : AST#expression#Left '__container__' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left align AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left VerticalAlign AST#expression#Right . Center AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left middle AST#property_name#Right : AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left anchor AST#property_name#Right : AST#expression#Left '__container__' AST#expression#Right AST#property_assignment#Right , AST#property_assignment#Left AST#property_name#Left align AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left HorizontalAlign AST#expression#Right . Center AST#member_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . onClick ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . message AST#member_expression#Right = AST#expression#Left 'Welcome' AST#expression#Right AST#assignment_expression#Right AST#expression#Right ; AST#expression_statement#Right AST#statement#Right } AST#block_statement#Right AST#arrow_function#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#container_content_body#Right AST#ui_component#Right AST#modifier_chain_expression#Left . height ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#ui_element_with_modifiers#Right AST#arkts_ui_element#Right } AST#build_body#Right AST#build_method#Right
build() { RelativeContainer() { Text(this.message) .id('HelloWorld') .fontSize($r('app.float.page_text_font_size')) .fontWeight(FontWeight.Bold) .alignRules({ center: { anchor: '__container__', align: VerticalAlign.Center }, middle: { anchor: '__container__', align: HorizontalAlign.Center } }) .onClick(() => { this.message = 'Welcome'; }) } .height('100%') .width('100%') }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/orientationDevelopment/entry/src/main/ets/pages/Index.ets#L52-L68
5b6469a6a934a1bd1a6ea1f153616697d19cce38
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/slidetohideanddisplace/src/main/ets/view/SlideToHideAndDisplace.ets
arkts
rowStyles
订单与互动栏的通用样式
@Styles rowStyles() { .width($r('app.string.slidetohideanddisplace_size_full')) .padding($r('app.integer.slidetohideanddisplace_padding_small')) .margin({ top: $r('app.integer.slidetohideanddisplace_margin_small') }) .backgroundColor($r('app.color.slidetohideanddisplace_color_transparent_aa')) .borderRadius($r('app.integer.slidetohideanddisplace_border_radius')) }
AST#method_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right rowStyles AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.slidetohideanddisplace_size_full' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . padding ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.slidetohideanddisplace_padding_small' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left top AST#property_name#Right : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.slidetohideanddisplace_margin_small' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right AST#property_assignment#Right } AST#object_literal#Right AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.color.slidetohideanddisplace_color_transparent_aa' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Left . borderRadius ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.integer.slidetohideanddisplace_border_radius' AST#expression#Right ) AST#resource_expression#Right AST#expression#Right ) AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right AST#modifier_chain_expression#Right } AST#extend_function_body#Right AST#method_declaration#Right
@Styles rowStyles() { .width($r('app.string.slidetohideanddisplace_size_full')) .padding($r('app.integer.slidetohideanddisplace_padding_small')) .margin({ top: $r('app.integer.slidetohideanddisplace_margin_small') }) .backgroundColor($r('app.color.slidetohideanddisplace_color_transparent_aa')) .borderRadius($r('app.integer.slidetohideanddisplace_border_radius')) }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/slidetohideanddisplace/src/main/ets/view/SlideToHideAndDisplace.ets#L114-L121
ba37fe3c55edd2d5dd9f44fb6cffa60821b60a80
gitee