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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_json/src/main/ets/json/JSONArray.ets | arkts | parse | json字符串转换为JSONArray对象
@param bean 实体对象
@returns JSON 对象 | public static parse(jsonStr: string): JSONArray {
let json = new JSONArray();
const replaceStr = jsonStr.replace(/\r\n/g, '\\r\\n').replace(/\r/g, '\\r').replace(/\n/g, '\\n');
//转换成json对象
let jVal: Record<string, JSONValue> = JSON.parse(replaceStr);
//循环赋值
Object.entries(jVal).forEach((item) =>... | AST#method_declaration#Left public static parse AST#parameter_list#Left ( AST#parameter#Left jsonStr : 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 JSONArray AST#prim... | public static parse(jsonStr: string): JSONArray {
let json = new JSONArray();
const replaceStr = jsonStr.replace(/\r\n/g, '\\r\\n').replace(/\r/g, '\\r').replace(/\n/g, '\\n');
let jVal: Record<string, JSONValue> = JSON.parse(replaceStr);
Object.entries(jVal).forEach((item) => {
if (item... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_json/src/main/ets/json/JSONArray.ets#L37-L59 | a1ac2dd6447f47f4236fa93daf4b10ccdf6c312b | gitee |
kaina404/HarmonyStock.git | 99233a46fb0dfb21e02294c730fd80e2fb404f9b | entry/src/main/ets/network/RequestFiveDayMinuteApi.ets | arkts | 请求五日分钟线数据。分钟里面,每个数据之间是间隔5分钟。例如第一条时间是10:00,下一条数据就是10:05
返回的数据是前四个交易日的数据+今日的实时交易日的数据
前四个交易日的数据可能足够,但是今日的实时交易日数据根据当前交易时长来确定。例如:
1号 23条数据,2号 48条数据,3号48条数据,4号48条数据,5号25条数据。总计为count=240条数据。 | export class RequestFiveDayMinuteApi {
/**
* sina新浪全周期获取函数,分钟线 5m,15m,30m,60m 日线1d=240m 周线1w=1200m 1月=7200m
* @param code
* @param end_date
* @param count
* @param frequency
* @param callback
*/
public requestData(code: string, {
end_date = null,
count = 240,
frequency = '5m'
... | AST#export_declaration#Left export AST#ERROR#Left class RequestFiveDayMinuteApi AST#ERROR#Left { /**
* sina新浪全周期获取函数,分钟线 5m,15m,30m,60m 日线1d=240m 周线1w=1200m 1月=7200m
* @param code
* @param end_date
* @param count
* @param frequency
* @param callback
*/ public requestData ( AST#parameter#Left co... | export class RequestFiveDayMinuteApi {
public requestData(code: string, {
end_date = null,
count = 240,
frequency = '5m'
}, callback?: Callback<FiveDayData>) {
var market = code.startsWith('0') ? 'sz' : 'sh'
code = market + code
frequency = frequency.replace('1d', '240m').replace('1w', '... | https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/network/RequestFiveDayMinuteApi.ets#L12-L31 | 28d2426af3e8296257920ac8986d7a25b54b5d80 | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/view/CategoryPage.ets | arkts | onSideBarChange | 侧边栏切换事件
@param {number} index - 选中的索引
@returns {void} 无返回值 | private onSideBarChange(index: number): void {
const targetIndex: number = this.vm.onSideBarSelected(index);
this.rightListScroller.scrollToIndex(targetIndex, true);
} | AST#method_declaration#Left private onSideBarChange 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... | private onSideBarChange(index: number): void {
const targetIndex: number = this.vm.onSideBarSelected(index);
this.rightListScroller.scrollToIndex(targetIndex, true);
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/view/CategoryPage.ets#L200-L203 | 9ec16c4fa68adc0940f75c86e06eddd611b2448d | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/analytics/AnalyticsPage.ets | arkts | buildOverviewTab | 构建总览标签页 | @Builder
buildOverviewTab(overview: OverviewStats) {
Scroll() {
Column({ space: UIConstants.DEFAULT_PADDING }) {
// 核心指标卡片
this.buildStatsCard('核心数据', [
{ label: '总联系人', value: overview.totalContacts.toString(), icon: $r('app.media.ic_contacts') },
{ label: '总祝福语', value:... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildOverviewTab AST#parameter_list#Left ( AST#parameter#Left overview : AST#type_annotation#Left AST#primary_type#Left OverviewStats AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_f... | @Builder
buildOverviewTab(overview: OverviewStats) {
Scroll() {
Column({ space: UIConstants.DEFAULT_PADDING }) {
this.buildStatsCard('核心数据', [
{ label: '总联系人', value: overview.totalContacts.toString(), icon: $r('app.media.ic_contacts') },
{ label: '总祝福语', value: overview... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/analytics/AnalyticsPage.ets#L200-L272 | 7c0f93a81f9a39b3d26212793f0594a2ac547d0f | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/SimpleBirthdayApp.ets | arkts | getCurrentDateString | 获取当前日期字符串 | private getCurrentDateString(): string {
const today = new Date();
const month = today.getMonth() + 1;
const day = today.getDate();
return `${month}月${day}日`;
} | AST#method_declaration#Left private getCurrentDateString AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator... | private getCurrentDateString(): string {
const today = new Date();
const month = today.getMonth() + 1;
const day = today.getDate();
return `${month}月${day}日`;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SimpleBirthdayApp.ets#L755-L760 | 7043445b032a32460478d1cb13828b360b7e4b06 | github |
openharmony/bundlemanager_bundle_framework | 89882654172b6bfba2a4a1ebfacdd6c9296f6f21 | interfaces/kits/ani/launcher_bundle_manager/ets/bundleManager/ElementName.ets | arkts | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export interface ElementName {
deviceId?: string;
bundleName: string;
moduleName?: string;
abilityName: string;
uri?: string;
shortName?: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ElementName AST#object_type#Left { AST#type_member#Left deviceId ? : 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 bundleName : AST#type_annot... | export interface ElementName {
deviceId?: string;
bundleName: string;
moduleName?: string;
abilityName: string;
uri?: string;
shortName?: string;
} | https://github.com/openharmony/bundlemanager_bundle_framework/blob/89882654172b6bfba2a4a1ebfacdd6c9296f6f21/interfaces/kits/ani/launcher_bundle_manager/ets/bundleManager/ElementName.ets#L16-L23 | bf953419a88b6ceb2655a80195ce59875b974f1c | gitee | |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/entry/src/main/ets/pages/class.ets | arkts | trainMusic | **************************训练音乐**************************// | @Builder
trainMusic() {
Row() {
Column() {
Text('训练音乐')
.fontSize(25)
.fontWeight(FontWeight.Bold)
.margin({ top: 25, bottom: 10 })
.width('100%')
Text('Bright FUtures')
.fontColor('#C4A699')
.fontSize(25)
.margin({ bottom... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right trainMusic 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 Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#... | @Builder
trainMusic() {
Row() {
Column() {
Text('训练音乐')
.fontSize(25)
.fontWeight(FontWeight.Bold)
.margin({ top: 25, bottom: 10 })
.width('100%')
Text('Bright FUtures')
.fontColor('#C4A699')
.fontSize(25)
.margin({ bottom... | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/class.ets#L204-L237 | 2c2fbe2bdffe30f50829043682d6d6de23a8da40 | github |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.ToolBar.d.ets | arkts | Declare enum ItemState
@enum { ItemState }
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Declare enum ItemState
@enum { ItemState }
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11 | export declare enum ItemState {
/**
* Enable type.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Enable type.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
*/
ENABLE = 1,
/**
* Disable type.
* @syscap Sy... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ItemState AST#enum_body#Left { /**
* Enable type.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/ /**
* Enable type.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomi... | export declare enum ItemState {
ENABLE = 1,
DISABLE = 2,
ACTIVATE = 3
} | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.ToolBar.d.ets#L34-L71 | 1c2be8cb71d8b4f4e447f7ecd27023addd5b4246 | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/ListBeExchange/ListExchange/src/main/ets/view/ListExchangeView.ets | arkts | deductionView | ListItem自定义组件(开发者可以根据自己的需求设置列表项的UI) | @Builder
deductionView(listItemInfo: ListInfo) {
Row() {
Image(listItemInfo.icon)
.width($r('app.integer.list_exchange_icon_size'))
.height($r('app.integer.list_exchange_icon_size'))
.draggable(false) // TODO:知识点:保持默认值true时,图片有默认拖拽效果,会影响Grid子组件拖拽判断,所以修改为false
Text(listItemInfo.... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right deductionView AST#parameter_list#Left ( AST#parameter#Left listItemInfo : AST#type_annotation#Left AST#primary_type#Left ListInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_funct... | @Builder
deductionView(listItemInfo: ListInfo) {
Row() {
Image(listItemInfo.icon)
.width($r('app.integer.list_exchange_icon_size'))
.height($r('app.integer.list_exchange_icon_size'))
.draggable(false)
Text(listItemInfo.name)
.margin({ left: $r('app.string.ohos_id_eleme... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ListBeExchange/ListExchange/src/main/ets/view/ListExchangeView.ets#L132-L155 | 16daa6c05668184a668fb77ea471f0112a0ef8a8 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/VerifyCode/casesfeature/verifycode/src/main/ets/constants/VerifyCodeConstants.ets | arkts | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class VerifyCodeConstants {
public static readonly VERIFY_CODE_FONTWEIGHT: number = 60;
} | AST#export_declaration#Left export AST#class_declaration#Left class VerifyCodeConstants AST#class_body#Left { AST#property_declaration#Left public static readonly VERIFY_CODE_FONTWEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 60 AST#... | export class VerifyCodeConstants {
public static readonly VERIFY_CODE_FONTWEIGHT: number = 60;
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/VerifyCode/casesfeature/verifycode/src/main/ets/constants/VerifyCodeConstants.ets#L16-L18 | 26182563bd153a18f47a3dfec4a19dd42225f567 | gitee | |
tobias910903/komue-harmonyapp.git | cd4dd4e7859ec5b33a5140bdd1d050377f13175b | entry/src/main/ets/config.ets | arkts | 导出 | export default GLOBAL_CONFIG | AST#export_declaration#Left export default AST#expression#Left GLOBAL_CONFIG AST#expression#Right AST#export_declaration#Right | export default GLOBAL_CONFIG | https://github.com/tobias910903/komue-harmonyapp.git/blob/cd4dd4e7859ec5b33a5140bdd1d050377f13175b/entry/src/main/ets/config.ets#L54-L54 | 6a20d7575992cff8bbbc6d3e54fa592a50f6b90f | github | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/BarDataSet.ets | arkts | setGradientColors | This method is deprecated.
Use setFills(...) instead.
@param gradientColors | public setGradientColors(gradientColors: JArrayList<Fill>): void {
this.mFills = gradientColors;
} | AST#method_declaration#Left public setGradientColors AST#parameter_list#Left ( AST#parameter#Left gradientColors : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left JArrayList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left Fill AST#primary_type#Right AST#type_annotation#Righ... | public setGradientColors(gradientColors: JArrayList<Fill>): void {
this.mFills = gradientColors;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L126-L128 | 4685a5021b0af41affbae88aa843f507fb42b1bb | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/Index.ets | arkts | buildUpcomingBirthdays | 构建即将到来的生日模块 | @Builder
buildUpcomingBirthdays() {
Column({ space: 12 }) {
Row() {
Text('即将到来')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.layoutWeight(1)
Text('查看更多')
.fontSize(14)
.fontColor('#007AFF')
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildUpcomingBirthdays 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#compon... | @Builder
buildUpcomingBirthdays() {
Column({ space: 12 }) {
Row() {
Text('即将到来')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.layoutWeight(1)
Text('查看更多')
.fontSize(14)
.fontColor('#007AFF')
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/Index.ets#L237-L279 | 5e846b78b592b2f725339dae36fd29bdccfa96c7 | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | ArkWebrenderingframework/entry/src/main/ets/pages/proxy.ets | arkts | [End call] [Start build_web] | build() {
Web({ src: this.webUrl, controller: this.webController })
.javaScriptProxy({
object: {
nativeMethod: (channelType: string, objectJson: string) => {
return ChannelInstance.call(channelType, objectJson) as object
},
},
name: 'JSBridge',
m... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Web ( AST#component_parameters#Left { AST#component_parameter#Left src : AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . webUrl AST#memb... | build() {
Web({ src: this.webUrl, controller: this.webController })
.javaScriptProxy({
object: {
nativeMethod: (channelType: string, objectJson: string) => {
return ChannelInstance.call(channelType, objectJson) as object
},
},
name: 'JSBridge',
m... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkWebrenderingframework/entry/src/main/ets/pages/proxy.ets#L110-L122 | 577b64f93743f35f26d3325d47f2a0d59f17e6a6 | gitee | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/Wechat_Arkts-master/entry/src/main/ets/pages/contact/label/LabelCreatedPage.ets | arkts | aboutToAppear | 聊天记录 | aboutToAppear() {
this.statusBarHeight = AppStorage.Get<number>(STATUS_BAR_HEIGHT) || 0;
StatusBarManager.immerseColor('#f1f1f1', false);
// 获取从TagPage传递过来的名字表示
const params = router.getParams() as LabelCreatedPageParams;
if (params.labelName) {
this.labelName = params.labelName;
}
} | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . statusBarHeight AST#member_expressio... | aboutToAppear() {
this.statusBarHeight = AppStorage.Get<number>(STATUS_BAR_HEIGHT) || 0;
StatusBarManager.immerseColor('#f1f1f1', false);
const params = router.getParams() as LabelCreatedPageParams;
if (params.labelName) {
this.labelName = params.labelName;
}
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/Wechat_Arkts-master/entry/src/main/ets/pages/contact/label/LabelCreatedPage.ets#L24-L33 | 13c1108eb2b1bce61a75e4c039b22d68ddaab587 | github |
openharmony/multimedia_camera_framework | 9873dd191f59efda885bc06897acf9b0660de8f2 | frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets | arkts | takePicture | 以指定参数触发一次拍照 | async takePicture(): Promise<void> {
Logger.info(TAG, 'takePicture start');
let cameraDeviceIndex = GlobalContext.get().getT<number>('cameraDeviceIndex');
let photoSettings: camera.PhotoCaptureSetting = {
quality: camera.QualityLevel.QUALITY_LEVEL_HIGH,
mirror: cameraDeviceIndex ? true : false
... | AST#method_declaration#Left async takePicture 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_argu... | async takePicture(): Promise<void> {
Logger.info(TAG, 'takePicture start');
let cameraDeviceIndex = GlobalContext.get().getT<number>('cameraDeviceIndex');
let photoSettings: camera.PhotoCaptureSetting = {
quality: camera.QualityLevel.QUALITY_LEVEL_HIGH,
mirror: cameraDeviceIndex ? true : false
... | https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets#L299-L308 | 7e624ec1a94683aaf12e51e432a82d9289e796e2 | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/Load.ets | arkts | initCpuFre7Data | CPUFre7 | private initCpuFre7Data(): LineData {
let values = new JArrayList<EntryOhos>();
for (let index: number = 0; index < this.gpData.length; index++) {
const gpDataCur = this.gpData[index];
if (gpDataCur.cpu7Frequency == '') {
continue
}
values.add(new EntryOhos(Number(index).valueOf... | AST#method_declaration#Left private initCpuFre7Data AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left LineData AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left... | private initCpuFre7Data(): LineData {
let values = new JArrayList<EntryOhos>();
for (let index: number = 0; index < this.gpData.length; index++) {
const gpDataCur = this.gpData[index];
if (gpDataCur.cpu7Frequency == '') {
continue
}
values.add(new EntryOhos(Number(index).valueOf... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/Load.ets#L890-L924 | 51408eb7e634ef59d5e3283dd5febcc70221baeb | gitee |
zl3624/harmonyos_network_samples | b8664f8bf6ef5c5a60830fe616c6807e83c21f96 | code/tls/Tls2Way/entry/src/main/ets/pages/Index.ets | arkts | selectCA | 选择CA证书文件 | selectCA() {
let documentPicker = new picker.DocumentViewPicker();
documentPicker.select().then((result) => {
if (result.length > 0) {
caFileUri = result[0]
this.msgHistory += "select file: " + caFileUri + "\r\n";
this.caCanLoad = true
}
}).catch((e) => {
this.msgHi... | AST#method_declaration#Left selectCA AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { 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#expressi... | selectCA() {
let documentPicker = new picker.DocumentViewPicker();
documentPicker.select().then((result) => {
if (result.length > 0) {
caFileUri = result[0]
this.msgHistory += "select file: " + caFileUri + "\r\n";
this.caCanLoad = true
}
}).catch((e) => {
this.msgHi... | https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/tls/Tls2Way/entry/src/main/ets/pages/Index.ets#L267-L278 | e0d2c89ea0902691ef3c7d7c772a7c09f23ebdde | gitee |
openharmony/xts_tools | 784a2e99d894e6bc2aba8c38f6bb68032442b1c8 | sample/AppSampleE/entry/src/main/ets/pages/buy/SelfPickUp.ets | arkts | aboutToAppear | 纬度 | aboutToAppear() {
Logger.info(TAG, 'aboutToAppear begin');
this.groupBuyController.getGroupBuyList(this.longitude, this.latitude).then((res: SelfPickUpInfo[]) => {
Logger.info(TAG, `aboutToAppear then res= ${JSON.stringify(res)}`);
this.selfPickUpList = res;
Logger.info(TAG, `aboutToAppear for... | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info AST#member_expr... | aboutToAppear() {
Logger.info(TAG, 'aboutToAppear begin');
this.groupBuyController.getGroupBuyList(this.longitude, this.latitude).then((res: SelfPickUpInfo[]) => {
Logger.info(TAG, `aboutToAppear then res= ${JSON.stringify(res)}`);
this.selfPickUpList = res;
Logger.info(TAG, `aboutToAppear for... | https://github.com/openharmony/xts_tools/blob/784a2e99d894e6bc2aba8c38f6bb68032442b1c8/sample/AppSampleE/entry/src/main/ets/pages/buy/SelfPickUp.ets#L33-L42 | 8a191c7e5c06890622ccb2cb5f668a387b1fff00 | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildMemberGet.ets | arkts | handle | 应用约束18:在类中声明字段,但本例中无需额外字段 应用约束1:避免any类型,需为参数和返回值指定具体类型,假设Guild和Member为已定义的类型 | handle(guild: Guild, data: Object): { member: Member } {
// 应用约束29:禁止修改对象方法布局,保持标准方法调用
const member = guild._addMember(data, false);
return { member };
} | AST#method_declaration#Left handle AST#parameter_list#Left ( AST#parameter#Left guild : AST#type_annotation#Left AST#primary_type#Left Guild AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#t... | handle(guild: Guild, data: Object): { member: Member } {
const member = guild._addMember(data, false);
return { member };
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildMemberGet.ets#L7-L11 | ab2bf6c36fb6e4bf75568e18d6d56b3823686822 | github |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets | arkts | persistProps | Called when multiple persistence properties are stored.
@since 10 | static persistProps(properties: PersistPropsOptions[]): void {
for (const prop of properties) PersistentStorage.persistProp(prop.key, prop.defaultValue)
} | AST#method_declaration#Left static persistProps AST#parameter_list#Left ( AST#parameter#Left properties : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left PersistPropsOptions [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#... | static persistProps(properties: PersistPropsOptions[]): void {
for (const prop of properties) PersistentStorage.persistProp(prop.key, prop.defaultValue)
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L404-L406 | d02a0c9d668229f26d1df8b329fc7621e0b1bff4 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/arkweb/ArkWebHelper.ets | arkts | clearAllCookies | 异步promise方式清除所有cookie。
@returns | static async clearAllCookies(): Promise<void> {
return await webview.WebCookieManager.clearAllCookies();
} | AST#method_declaration#Left static async clearAllCookies 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 > AS... | static async clearAllCookies(): Promise<void> {
return await webview.WebCookieManager.clearAllCookies();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/arkweb/ArkWebHelper.ets#L198-L200 | 4db9604271aa43624def47975fc5844fb631c6aa | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.util.d.ets | arkts | isZero | Checks whether the current RationalNumber object represents the value 0.
@returns { boolean } If the value represented by the current object is 0, true is returned.
Otherwise, false is returned.
@syscap SystemCapability.Utils.Lang
@crossplatform
@atomicservice
@since 20 | isZero(): boolean; | AST#method_declaration#Left isZero AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right | isZero(): boolean; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1026-L1026 | 4cfe3448869dee44d38ec4ee012a3035d76d5342 | gitee |
langwudong/browser.git | f44fff759c50c162739c1585149018e6f0277471 | entry/src/main/ets/utils/RdbUtils.ets | arkts | deleteById | 根据 id 删除对应数据表中的记录 | static async deleteById(date: string, id: number) {
let predicates = new relationalStore.RdbPredicates(date);
predicates.equalTo("id", id)
return RdbUtils.getStore().delete(predicates);
} | AST#method_declaration#Left static async deleteById AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_t... | static async deleteById(date: string, id: number) {
let predicates = new relationalStore.RdbPredicates(date);
predicates.equalTo("id", id)
return RdbUtils.getStore().delete(predicates);
} | https://github.com/langwudong/browser.git/blob/f44fff759c50c162739c1585149018e6f0277471/entry/src/main/ets/utils/RdbUtils.ets#L148-L152 | 668761136517175793d9287e2a3b85cb7232590a | github |
robotzzh/AgricultureApp.git | 7b12c588dd1d07cc07a8b25577d785d30bd838f6 | entry/src/main/ets/common/History_Info.ets | arkts | FarmBean_to_History | ----------------将farmBean转化为一个历史数据------------------// | async FarmBean_to_History(farm_bean:FarmBean){
try {
this.history_temperature.add(farm_bean.temperature);
this.history_humidity.add(farm_bean.humidity)
this.history_conductivity.add(farm_bean.conductivity);
this.history_PH.add(farm_bean.PH);
this.history_co2.add(farm_bean.c... | AST#method_declaration#Left async FarmBean_to_History AST#parameter_list#Left ( AST#parameter#Left farm_bean : AST#type_annotation#Left AST#primary_type#Left FarmBean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_sta... | async FarmBean_to_History(farm_bean:FarmBean){
try {
this.history_temperature.add(farm_bean.temperature);
this.history_humidity.add(farm_bean.humidity)
this.history_conductivity.add(farm_bean.conductivity);
this.history_PH.add(farm_bean.PH);
this.history_co2.add(farm_bean.c... | https://github.com/robotzzh/AgricultureApp.git/blob/7b12c588dd1d07cc07a8b25577d785d30bd838f6/entry/src/main/ets/common/History_Info.ets#L67-L88 | 81c704de66ea66211c3f86b9f5d23f2fa36d7d72 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/listexchange/src/main/ets/model/AttributeModifier.ets | arkts | 通过实现AttributeModifier接口,自定义属性修改器
将拖拽排序相关样式封装成属性修改器,可以方便移植 | export class ListItemModifier implements AttributeModifier<ListItemAttribute> {
// 阴影
public hasShadow: boolean = false;
// 缩放
public scale: number = 1;
// 纵轴偏移量
public offsetY: number = 0;
// 横轴偏移量
public offsetX: number = 0;
// 透明度
public opacity: number = 1;
// 是否被删除
public isDeleted: boolean... | AST#export_declaration#Left export AST#class_declaration#Left class ListItemModifier AST#implements_clause#Left implements AST#generic_type#Left AttributeModifier AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ListItemAttribute AST#primary_type#Right AST#type_annotation#Right > AST#type_argume... | export class ListItemModifier implements AttributeModifier<ListItemAttribute> {
public hasShadow: boolean = false;
public scale: number = 1;
public offsetY: number = 0;
public offsetX: number = 0;
public opacity: number = 1;
public isDeleted: boolean = false;
public static instance: List... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/listexchange/src/main/ets/model/AttributeModifier.ets#L20-L57 | 5a42e06bee1bb23ab0d84f989a7ca570e4f2e14f | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/widgets/BirthdayWidget.ets | arkts | onRemoveForm | 删除卡片实例 | onRemoveForm(formId: string): void {
try {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `BirthdayWidget onRemoveForm: ${formId}`);
// 清理卡片相关资源
this.clearWidgetResources(formId);
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to re... | AST#method_declaration#Left onRemoveForm AST#parameter_list#Left ( AST#parameter#Left formId : 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#Righ... | onRemoveForm(formId: string): void {
try {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `BirthdayWidget onRemoveForm: ${formId}`);
this.clearWidgetResources(formId);
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to remove form: ... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/widgets/BirthdayWidget.ets#L42-L51 | 44dc7b2637c84db35f3df42944c4f4e7edc983af | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_ui/src/main/ets/ui/base/ImgLayerUtil.ets | arkts | getLayerImg | 获取分层图片图片
@param ctx 上下文
@param fg 分层前景图
@param bg 分层背景图 | public static async getLayerImg(ctx: UIContext, fg: Resource, bg: Resource) {
// 创建分层图标
const foreground = await ImgLayerUtil.getDrawableDescriptor(ctx, fg);
const background = await ImgLayerUtil.getDrawableDescriptor(ctx, bg);
return new LayeredDrawableDescriptor(foreground, background);
} | AST#method_declaration#Left public static async getLayerImg AST#parameter_list#Left ( AST#parameter#Left ctx : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fg : AST#type_annotation#Left AST#primary_type#Left Resource A... | public static async getLayerImg(ctx: UIContext, fg: Resource, bg: Resource) {
const foreground = await ImgLayerUtil.getDrawableDescriptor(ctx, fg);
const background = await ImgLayerUtil.getDrawableDescriptor(ctx, bg);
return new LayeredDrawableDescriptor(foreground, background);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/base/ImgLayerUtil.ets#L29-L34 | 99320a02ffae78e4dbc20aebe698097762445605 | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildEmojiCreate.ets | arkts | 注意:根据实际类型替换any为具体类型 应用约束18: 构造函数参数需要在类字段中声明 | constructor() {
super();
// 初始化client,具体逻辑根据父类实现调整
this.client = (this as any).client;
} | AST#constructor_declaration#Left constructor 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 super AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST... | constructor() {
super();
this.client = (this as any).client;
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildEmojiCreate.ets#L9-L13 | ef86cb0b99cbad5054207dec29c3b4cb2cafe371 | github | |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/api/Router.ets | arkts | popToName | @deprecated
@see {ZRouter.getInstance().popToName}
@param name
@param animated | public static popToName(name: string, animated: boolean = true) {
ZRouter.getRouterMgr().popToName(name, animated)
} | AST#method_declaration#Left public static popToName 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 animated : AST#type_annotation#Left AST#primary_type#Left boolean AST#pr... | public static popToName(name: string, animated: boolean = true) {
ZRouter.getRouterMgr().popToName(name, animated)
} | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/api/Router.ets#L438-L440 | 9855be84eef89fefb55b9f09e49a024f95dd8b03 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/SHA1.ets | arkts | @Author csx
@DateTime 2024/3/20 21:43
@TODO SHA1 工具类 源码来自官方库 https://ohpm.openharmony.cn/#/cn/detail/@ohos%2Fchecksum
@Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_crypto | export class SHA1 {
hexcase = 0;
/* hex output format. 0 - lowercase; 1 - uppercase */
chrsz = 8;
/* bits per input character. 8 - ASCII; 16 - Unicode */
/**
* 散列哈希算法
* @param value
* @returns
*/
static hash(value: string): string {
let hash = new SHA1();
return hash.hex_sha1(value);
... | AST#export_declaration#Left export AST#class_declaration#Left class SHA1 AST#class_body#Left { AST#property_declaration#Left hexcase = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right /* hex output format. 0 - lowercase; 1 - uppercase */ AST#property_declaration#Left chrsz = AST#expression#Le... | export class SHA1 {
hexcase = 0;
chrsz = 8;
static hash(value: string): string {
let hash = new SHA1();
return hash.hex_sha1(value);
}
hex_sha1(s: string): string {
return this.binb2hex(this.core_sha1(this.AlignSHA1(s)));
}
core_sha1(blockArray: number[]) {
let x: number[] =... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/SHA1.ets#L23-L228 | c5eec826233112216c96dcaa1f65ce648ca8766e | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/myData/WordUserDbAccess.ets | arkts | clearFavorites | ====== 清空收藏等级 ====== | async clearFavorites(): Promise<void> {
if (!this.db) return;
const sql = `UPDATE ${Tables.Learn.NAME} SET ${Tables.Learn.Col.FAVORITE_LEVEL} = ?`;
await this.db.updateDb(sql, [SearchConstants.FAVORITE_LEVEL_0]);
} | AST#method_declaration#Left async clearFavorites 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_a... | async clearFavorites(): Promise<void> {
if (!this.db) return;
const sql = `UPDATE ${Tables.Learn.NAME} SET ${Tables.Learn.Col.FAVORITE_LEVEL} = ?`;
await this.db.updateDb(sql, [SearchConstants.FAVORITE_LEVEL_0]);
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/myData/WordUserDbAccess.ets#L509-L514 | 7e1ad02c120b170cf60a1c54ca80c0045718120a | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/Recorder/entry/src/main/ets/common/TitleBar.ets | arkts | TitleBar | Copyright (c) 2022-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,... | @Component
export struct TitleBar {
private title: Resource = $r("app.string.entry_MainAbility")
build() {
Row() {
Text(this.title)
.fontColor(Color.Black)
.fontWeight(FontWeight.Bold)
.fontSize(30)
.layoutWeight(1)
}
.width('100%')
.height('8%')
.constrain... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TitleBar AST#component_body#Left { AST#property_declaration#Left private title : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resou... | @Component
export struct TitleBar {
private title: Resource = $r("app.string.entry_MainAbility")
build() {
Row() {
Text(this.title)
.fontColor(Color.Black)
.fontWeight(FontWeight.Bold)
.fontSize(30)
.layoutWeight(1)
}
.width('100%')
.height('8%')
.constrain... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/Recorder/entry/src/main/ets/common/TitleBar.ets#L16-L33 | a3a600b30b4b550e72329c09513008a85f08bdd3 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | NetworkManagement/NewsDataArkTS/entry/src/main/ets/viewmodel/NewsViewModel.ets | arkts | CustomRefreshLoadLayoutClass | Custom refresh load layout data. | @Observed
export class CustomRefreshLoadLayoutClass {
/**
* Custom refresh load layout isVisible.
*/
isVisible: boolean;
/**
* Custom refresh load layout imageSrc.
*/
imageSrc: Resource;
/**
* Custom refresh load layout textValue.
*/
textValue: Resource;
/**
* Custom refresh load l... | AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class CustomRefreshLoadLayoutClass AST#class_body#Left { /**
* Custom refresh load layout isVisible.
*/ AST#property_declaration#Left isVisible : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#R... | @Observed
export class CustomRefreshLoadLayoutClass {
isVisible: boolean;
imageSrc: Resource;
textValue: Resource;
heightValue: number;
constructor(isVisible: boolean, imageSrc: Resource, textValue: Resource, heightValue: number) {
this.isVisible = isVisible;
this.imageSrc = imageSrc;
... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/NetworkManagement/NewsDataArkTS/entry/src/main/ets/viewmodel/NewsViewModel.ets#L131-L159 | 6399c88cd10d8644d149eb36483e92696cd1f291 | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildDelete.ets | arkts | handle | 应用约束10: 显式指定参数类型 | handle(data: any): { guild: any } {
const client = this.client;
// 应用约束21: 使用Map.get方法代替属性访问
let guild = client.guilds.get(data.id);
if (guild) {
// 应用约束26: 使用箭头函数
guild.channels.values().forEach((channel: any) => {
if (channel.type === 'text') ch... | AST#method_declaration#Left handle AST#parameter_list#Left ( AST#parameter#Left data : 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#ERROR#Left : AST#ERROR#Right AST#block_statement#Left { AST#statement#Left AST#exp... | handle(data: any): { guild: any } {
const client = this.client;
let guild = client.guilds.get(data.id);
if (guild) {
guild.channels.values().forEach((channel: any) => {
if (channel.type === 'text') channel.stopTyping(true);
});
... | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildDelete.ets#L20-L56 | 43a53bced43ae6a2904293fa32b5bcead0e82521 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | getMaxWidth | @return the maximum width that the axis can take (in dp). | public getMaxWidth(): number {
return this.mMaxWidth;
} | AST#method_declaration#Left public getMaxWidth 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_expre... | public getMaxWidth(): number {
return this.mMaxWidth;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L158-L160 | a3dc53655482228a6c70deb36fef97ae84935790 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Ability/StageAbilityDemo/entry/src/main/ets/viewmodel/GoodsServiceData.ets | arkts | GoodsData is used to initialize ServicesComponent. | export default class GoodsServiceData {
id: number = 0;
name: Resource | null = null;
description: Resource = $r('app.string.goods_service_1_desc');
} | AST#export_declaration#Left export default AST#class_declaration#Left class GoodsServiceData 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 0 AST#expression#Right ; AST#property_declara... | export default class GoodsServiceData {
id: number = 0;
name: Resource | null = null;
description: Resource = $r('app.string.goods_service_1_desc');
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Ability/StageAbilityDemo/entry/src/main/ets/viewmodel/GoodsServiceData.ets#L19-L23 | 6614ddbe235fca718a65fb97ddbc2f99dbd50ab7 | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/charts/CombinedChartModel.ets | arkts | getLineData | @Override | public getLineData(): LineData | null {
if (this.mData == null)
return null;
return this.mData.getLineData();
} | AST#method_declaration#Left public getLineData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left LineData AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#... | public getLineData(): LineData | null {
if (this.mData == null)
return null;
return this.mData.getLineData();
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/CombinedChartModel.ets#L133-L137 | b3efdc9bd2b0328bb0a9532921213aadf66f2922 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/analytics/AdvancedAnalyticsService.ets | arkts | 漏斗步骤接口 | export interface FunnelStep {
id: string;
name: string;
eventType: string;
userCount: number;
conversionRate: number;
averageTimeToNext?: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface FunnelStep AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#Left AST#... | export interface FunnelStep {
id: string;
name: string;
eventType: string;
userCount: number;
conversionRate: number;
averageTimeToNext?: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/analytics/AdvancedAnalyticsService.ets#L159-L166 | 42f926291e9e41922b67ffa8670a18e2f1bb5104 | github | |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets | arkts | envProp | Called when a property value is checked.
@since 10 | static envProp<T>(key: string, value: T): boolean {
throw new Error("Environment.EnvProp is not implemented")
} | AST#method_declaration#Left static envProp AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Rig... | static envProp<T>(key: string, value: T): boolean {
throw new Error("Environment.EnvProp is not implemented")
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L305-L307 | 657b95c19cafaa15ae705e109caf7a67c6bee777 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/PrizeData.ets | arkts | Prize data. | export default class PrizeData {
/**
* The prize message.
*/
message?: Resource;
/**
* Image src.
*/
imageSrc?: string;
} | AST#export_declaration#Left export default AST#class_declaration#Left class PrizeData AST#class_body#Left { /**
* The prize message.
*/ AST#property_declaration#Left message ? : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Righ... | export default class PrizeData {
message?: Resource;
imageSrc?: string;
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/PrizeData.ets#L19-L29 | f9e651ed024959bd0f8bbc1d4d64ea0ea1ceef10 | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/formatter/DefaultFillFormatter.ets | arkts | Default formatter that calculates the position of the filled line. | export default class DefaultFillFormatter implements IFillFormatter {
public getFillLinePosition(dataSet: ILineDataSet, dataProvider: LineDataProvider): number {
let fillMin: number = 0;
let chartMaxY: number = dataProvider.getYChartMax();
let chartMinY: number = dataProvider.getYChartMin();
let dat... | AST#export_declaration#Left export default AST#class_declaration#Left class DefaultFillFormatter AST#implements_clause#Left implements IFillFormatter AST#implements_clause#Right AST#class_body#Left { AST#method_declaration#Left public getFillLinePosition AST#parameter_list#Left ( AST#parameter#Left dataSet : AST#type_a... | export default class DefaultFillFormatter implements IFillFormatter {
public getFillLinePosition(dataSet: ILineDataSet, dataProvider: LineDataProvider): number {
let fillMin: number = 0;
let chartMaxY: number = dataProvider.getYChartMax();
let chartMinY: number = dataProvider.getYChartMin();
let dat... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/formatter/DefaultFillFormatter.ets#L26-L59 | 13c5644f511e5ea385e4e3afeb07cd4e2d785101 | gitee | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/network/src/main/ets/datasource/goods/GoodsNetworkDataSource.ets | arkts | @file 商品相关数据源接口
定义商品模块所需的所有网络请求操作
@author Joker.X | export interface GoodsNetworkDataSource {
/**
* 分页查询商品
* @param params 商品搜索请求参数
* @returns 商品分页数据响应
*/
getGoodsPage(params: GoodsSearchRequest): Promise<NetworkResponse<NetworkPageData<Goods>>>;
/**
* 获取商品信息
* @param id 商品ID
* @returns 商品信息响应
*/
getGoodsInfo(id: string): Promise<Network... | AST#export_declaration#Left export AST#interface_declaration#Left interface GoodsNetworkDataSource AST#object_type#Left { /**
* 分页查询商品
* @param params 商品搜索请求参数
* @returns 商品分页数据响应
*/ AST#type_member#Left getGoodsPage AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_... | export interface GoodsNetworkDataSource {
getGoodsPage(params: GoodsSearchRequest): Promise<NetworkResponse<NetworkPageData<Goods>>>;
getGoodsInfo(id: string): Promise<NetworkResponse<Goods>>;
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/network/src/main/ets/datasource/goods/GoodsNetworkDataSource.ets#L10-L24 | ce883824e1e2ac357dfc8bd73e7fa07f83c8b0aa | github | |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/commons/utils/PhotoPickerUtils.ets | arkts | 相机相册访问工具
@author www.icheny.cn | export class PhotoPickerUtils {
static async openGallery(onSuccess: (uri: string) => void, onFailed: (error: string) => void) {
try {
const granted = await PermissionUtils.request(['ohos.permission.WRITE_MEDIA', 'ohos.permission.READ_MEDIA'])
if (!granted) {
setTimeout(() => {
Alert... | AST#export_declaration#Left export AST#class_declaration#Left class PhotoPickerUtils AST#class_body#Left { AST#method_declaration#Left static async openGallery AST#parameter_list#Left ( AST#parameter#Left onSuccess : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left uri : AST#... | export class PhotoPickerUtils {
static async openGallery(onSuccess: (uri: string) => void, onFailed: (error: string) => void) {
try {
const granted = await PermissionUtils.request(['ohos.permission.WRITE_MEDIA', 'ohos.permission.READ_MEDIA'])
if (!granted) {
setTimeout(() => {
Alert... | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/utils/PhotoPickerUtils.ets#L11-L145 | 628450a1f6c103d02a7e0206e7c9c4c74069f4a1 | gitee | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/entity/SystemEntity.ets | arkts | Copyright (C) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export interface ProcessRunningInfo {
/**
* @default process id
* @since 8
* @syscap SystemCapability.Ability.AbilityRuntime.Mission
*/
pid: number;
/**
* @default user id
* @since 8
* @syscap SystemCapability.Ability.AbilityRuntime.Mission
*/
uid: number;
/**
* @default the name ... | AST#export_declaration#Left export AST#interface_declaration#Left interface ProcessRunningInfo AST#object_type#Left { /**
* @default process id
* @since 8
* @syscap SystemCapability.Ability.AbilityRuntime.Mission
*/ AST#type_member#Left pid : AST#type_annotation#Left AST#primary_type#Left number AST#primary... | export interface ProcessRunningInfo {
pid: number;
uid: number;
processName: string;
bundleNames: Array<string>;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/entity/SystemEntity.ets#L15-L43 | 7657d37cc8bc5a371d391d099fc5cbf8c874b2a1 | gitee | |
tomorrowKreswell/Ledger.git | 1f2783ae70b8540d677af8a27f29db1b4089ea69 | ledger/entry/src/main/ets/viewmodel/AccountList.ets | arkts | 定义测试用的账单数据 | export const testAccounts: Account[] =
[
new Account(0, '吃饭', 100, new Date(), generateRandomString()),
new Account(0, '零食', 99, new Date(), generateRandomString()),
new Account(0, '汽车加油', 97, new Date(), generateRandomString()),
new Account(0, '旅游', 96, new Date(), generateRandomString()),
new Ac... | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left testAccounts : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Account [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expre... | export const testAccounts: Account[] =
[
new Account(0, '吃饭', 100, new Date(), generateRandomString()),
new Account(0, '零食', 99, new Date(), generateRandomString()),
new Account(0, '汽车加油', 97, new Date(), generateRandomString()),
new Account(0, '旅游', 96, new Date(), generateRandomString()),
new Ac... | https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/viewmodel/AccountList.ets#L78-L99 | 213076a5020f95775ebb463585b7027d30757037 | github | |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_platform/ace_ets_module_platform_api13/entry/src/main/ets/MainAbility/pages/XComponent/interface/XcomponentContext.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export default interface | AST#export_declaration#Left export default AST#expression#Left interface AST#expression#Right AST#export_declaration#Right | export default interface | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_platform/ace_ets_module_platform_api13/entry/src/main/ets/MainAbility/pages/XComponent/interface/XcomponentContext.ets#L15-L15 | ac1c0453091a096359ed9dfab5408a446b67b619 | gitee | |
openharmony/applications_settings | aac607310ec30e30d1d54db2e04d055655f72730 | common/component/src/main/ets/default/textComponent.ets | arkts | TitleText | Single title text with round corner. | @Component
export struct TitleText {
@State isTouched: boolean = false;
private title: string | Resource = '';
private color: ResourceColor = $r('app.color.font_color_182431');
private visible: Visibility = Visibility.Visible;
build() {
Row() {
Row() {
Text(this.title)
.fontSize($... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TitleText AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right isTouched : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annot... | @Component
export struct TitleText {
@State isTouched: boolean = false;
private title: string | Resource = '';
private color: ResourceColor = $r('app.color.font_color_182431');
private visible: Visibility = Visibility.Visible;
build() {
Row() {
Row() {
Text(this.title)
.fontSize($... | https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/common/component/src/main/ets/default/textComponent.ets#L48-L100 | 5f5b259549486a5350ccaaa8025dda0f64759c31 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/SecondaryLinkExample.ets | arkts | aboutToAppear | 是否点击一级列表
生命周期函数 | aboutToAppear(): void {
// 构造数据
for (let i = 0; i < TAG_LIST_LENGTH; i++) {
this.tagLists.push(`类别${i + 1}`);
const tempData: Array<CustomDataType> = new Array(CONTENT_PER_TAG).fill({
desc: '内容数据',
tag: `类别${i + 1}`
});
this.records.push(i * CONTENT_PER_TAG);
this.c... | 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#block_statement#Left { // 构造数据 AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#v... | aboutToAppear(): void {
for (let i = 0; i < TAG_LIST_LENGTH; i++) {
this.tagLists.push(`类别${i + 1}`);
const tempData: Array<CustomDataType> = new Array(CONTENT_PER_TAG).fill({
desc: '内容数据',
tag: `类别${i + 1}`
});
this.records.push(i * CONTENT_PER_TAG);
this.contentD... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/SecondaryLinkExample.ets#L49-L61 | e1c36e5fa6ddb12ea1d978aac83e2160520deef2 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/entity/AuthOptions.ets | arkts | 查询认证能力是否支持的 返回参数类 | export interface StatusResult {
status: boolean;
errorCode?: number;
errorMsg?: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface StatusResult AST#object_type#Left { AST#type_member#Left status : 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 errorCode ? : AST#type_annota... | export interface StatusResult {
status: boolean;
errorCode?: number;
errorMsg?: string;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/entity/AuthOptions.ets#L19-L23 | 1df7f9668719a578d7edac6853144991e944faee | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets | arkts | getData | Return the data of index
@param index - 集合 index
@returns: 集合index项数据 | getData(index: number): CardInfo {
return this.list[index];
} | AST#method_declaration#Left getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CardInfo AST#primary_type#Right ... | getData(index: number): CardInfo {
return this.list[index];
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets#L44-L46 | 94585a782a70a616ec593ea55da781fe8862cb3d | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/cuberotateanimation/src/main/ets/model/BasicDataSource.ets | arkts | updateData | 更新指定索引位置的元素
@param index 数组索引 | public updateData(index: number, data: ESObject): void {
this.originDataArray.splice(index, 1, data);
this.notifyDataChange(index);
} | 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 ESObject AST#primary_ty... | public updateData(index: number, data: ESObject): void {
this.originDataArray.splice(index, 1, data);
this.notifyDataChange(index);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cuberotateanimation/src/main/ets/model/BasicDataSource.ets#L61-L64 | 10986ec7de9fb8c944e25bc2411eea01bd6b0ef9 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | UseSendable/entry/src/main/ets/pages/ConcurrentTaskManagement5.ets | arkts | ConcurrentTaskManagement5 | [End quick_start] | @Component
export struct ConcurrentTaskManagement5 {
@Styles
buttonStyles() {
.width('100%')
.height(40)
}
build() {
NavDestination() {
Column() {
Button($r('app.string.task_delay_scheduling_title'))
.buttonStyles()
.margin({
bottom: 16
})
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ConcurrentTaskManagement5 AST#component_body#Left { AST#method_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right buttonStyles AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_bod... | @Component
export struct ConcurrentTaskManagement5 {
@Styles
buttonStyles() {
.width('100%')
.height(40)
}
build() {
NavDestination() {
Column() {
Button($r('app.string.task_delay_scheduling_title'))
.buttonStyles()
.margin({
bottom: 16
})
... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/UseSendable/entry/src/main/ets/pages/ConcurrentTaskManagement5.ets#L48-L79 | b8b98f741b2306b46c16855a50f5e7aff6836e38 | gitee |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/common/GlobalThemeState.ets | arkts | 主题状态Hook for 组件使用 | export function useThemeState(): ThemeStateResult {
const globalState = GlobalThemeState.getInstance();
const result: ThemeStateResult = {
themeVersion: globalState.getThemeVersion(),
currentTheme: AppThemeManager.getInstance().getCurrentTheme(),
refreshTheme: () => globalState.forceRefresh()
};
ret... | AST#export_declaration#Left export AST#function_declaration#Left function useThemeState AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ThemeStateResult AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_decla... | export function useThemeState(): ThemeStateResult {
const globalState = GlobalThemeState.getInstance();
const result: ThemeStateResult = {
themeVersion: globalState.getThemeVersion(),
currentTheme: AppThemeManager.getInstance().getCurrentTheme(),
refreshTheme: () => globalState.forceRefresh()
};
ret... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/GlobalThemeState.ets#L72-L80 | 1bde07fc772857c083fd0e9a02caf4065567ccd3 | github | |
azhuge233/ASFShortcut-HN.git | d1669c920c56317611b5b0375aa5315c1b91211b | entry/src/main/ets/pages/Index.ets | arkts | sendTestCommand | 发送测试指令 | private async sendTestCommand(address: string, password: string, command: string): Promise<void> {
try {
const resp = await this.asf.sendTest(address, password, command);
this.isProcessing = false;
this.handleResponse(this.context.resourceManager.getStringSync($r("app.string... | AST#method_declaration#Left private async sendTestCommand AST#parameter_list#Left ( AST#parameter#Left address : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left password : AST#type_annotation#Left AST#primary_type#Left strin... | private async sendTestCommand(address: string, password: string, command: string): Promise<void> {
try {
const resp = await this.asf.sendTest(address, password, command);
this.isProcessing = false;
this.handleResponse(this.context.resourceManager.getStringSync($r("app.string... | https://github.com/azhuge233/ASFShortcut-HN.git/blob/d1669c920c56317611b5b0375aa5315c1b91211b/entry/src/main/ets/pages/Index.ets#L115-L127 | 4494c65e1496f8786424496693a08efde090c14e | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.TreeView.d.ets | arkts | addNode | Initialize the interface of the tree view. This interface is used to generate ListNodeDataSource data.
addNode is only designed for initialization. It can only be invoked during initialization.
A maximum of 50 directory levels can be added.
@param nodeParam Configuration information of the newly added node.
For deta... | addNode(nodeParam?: NodeParam): TreeController; | AST#method_declaration#Left addNode AST#parameter_list#Left ( AST#parameter#Left nodeParam ? : AST#type_annotation#Left AST#primary_type#Left NodeParam AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left TreeController AST#prim... | addNode(nodeParam?: NodeParam): TreeController; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.TreeView.d.ets#L557-L557 | 562b8c7ddd2bbda908b2d1d264a78f226abca9a1 | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_tabs.ets | arkts | callRestore | Calls a tab to restore if possible.
@param target The target index. | callRestore(context: UIContext, target: number = this.main_tab_idx) {
let t0 = Date.now();
console.log(`[callRestore] Call of Restore! target: ${target}, this.Tabs[target].pre_restoration_stage: ${this.Tabs[target]?.pre_restoration_stage}`);
if (target > this.Tabs.length - 1) {
target = this.Tabs.leng... | AST#method_declaration#Left callRestore AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left target : AST#type_annotation#Left AST#primary_type#Left number AST#primary_typ... | callRestore(context: UIContext, target: number = this.main_tab_idx) {
let t0 = Date.now();
console.log(`[callRestore] Call of Restore! target: ${target}, this.Tabs[target].pre_restoration_stage: ${this.Tabs[target]?.pre_restoration_stage}`);
if (target > this.Tabs.length - 1) {
target = this.Tabs.leng... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L278-L301 | de39ff434bc37eead5badd257b90b5bad1357b21 | gitee |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/view/Detail/dialog/RepeatDialog.ets | arkts | 构建组件 | build() {
Column() {
CommonDialog({
title: $r('app.string.repeat_name'), // 设置弹窗标题
controller: this.controller,
// 确认按钮点击时的回调
onConfirm: () => {
if (this.selects.length === 0 && this.repeatType === RepeatType.Custom) {
this.repeatType = RepeatType.NoRepeat... | 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 CommonDialog ( AST#component_parameters#Left { AST#comp... | build() {
Column() {
CommonDialog({
title: $r('app.string.repeat_name'),
controller: this.controller,
onConfirm: () => {
if (this.selects.length === 0 && this.repeatType === RepeatType.Custom) {
this.repeatType = RepeatType.NoRepeat;
}
... | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/view/Detail/dialog/RepeatDialog.ets#L52-L127 | 05dedb6d957d7a5487dadd3842edcd9e253a8192 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/services/settings/SettingsService.ets | arkts | updateSettings | 更新应用设置
@param params 更新参数
@returns 更新后的设置 | async updateSettings(params: UpdateAppSettingsParams): Promise<AppSettings> {
try {
const currentSettings = await this.getSettings();
// 更新设置对象
const updatedSettings: AppSettings = {
version: currentSettings.version,
language: params.language ? this.mergeLanguageSettings(currentSe... | AST#method_declaration#Left async updateSettings AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left UpdateAppSettingsParams AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left A... | async updateSettings(params: UpdateAppSettingsParams): Promise<AppSettings> {
try {
const currentSettings = await this.getSettings();
const updatedSettings: AppSettings = {
version: currentSettings.version,
language: params.language ? this.mergeLanguageSettings(currentSettings.la... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/settings/SettingsService.ets#L126-L159 | 4c071354b858ef81bf116579daefac632c3be59f | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets | arkts | refreshRegionDisplay | 刷新省市区展示文本
@returns {void} 无返回值 | private refreshRegionDisplay(): void {
if (this.province && this.city && this.district) {
this.regionDisplay = `${this.province} ${this.city} ${this.district}`;
return;
}
this.regionDisplay = "";
} | AST#method_declaration#Left private refreshRegionDisplay AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_exp... | private refreshRegionDisplay(): void {
if (this.province && this.city && this.district) {
this.regionDisplay = `${this.province} ${this.city} ${this.district}`;
return;
}
this.regionDisplay = "";
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets#L320-L326 | 88befa60e00525838e8a9a43f898219f7bd9c7b4 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/pipwindow/src/main/ets/model/AVPlayer.ets | arkts | changeVolume | 设置媒体播放音量 | changeVolume(volume: number) {
this.avPlayer.setVolume(volume)
} | AST#method_declaration#Left changeVolume AST#parameter_list#Left ( AST#parameter#Left volume : 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#expression_statement#Left AST#expressi... | changeVolume(volume: number) {
this.avPlayer.setVolume(volume)
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pipwindow/src/main/ets/model/AVPlayer.ets#L107-L109 | 9b509e7a682d1cca114ca40617a806c2a80cbc14 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/AppUtility.ets | arkts | ============================================================ 数据模型定义 ============================================================
每一个翻译包含:词性 + 单字翻译 | export class TitleItem {
public pos: string | null = null; // 词性 nullable
public title: string = ""; // 单字翻译
equals(obj: Object): boolean {
if (obj instanceof TitleItem) {
const other = obj as TitleItem;
if (this.pos === null && other.pos === null) {
return true;
}
if (this.... | AST#export_declaration#Left export AST#class_declaration#Left class TitleItem AST#class_body#Left { AST#property_declaration#Left public pos : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#typ... | export class TitleItem {
public pos: string | null = null;
public title: string = "";
equals(obj: Object): boolean {
if (obj instanceof TitleItem) {
const other = obj as TitleItem;
if (this.pos === null && other.pos === null) {
return true;
}
if (this.pos !== null) {
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/AppUtility.ets#L25-L43 | c63acb732ba6dfbab1da542b32b1d50114430810 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/containernestedslide/src/main/ets/view/CommentPage.ets | arkts | showToast | 弹窗函数 | showToast() {
promptAction.showToast({
message: $r('app.string.container_nested_only_show_for_ux')
})
} | AST#method_declaration#Left showToast 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 promptAction AST#expression#Right . showToast AST#memb... | showToast() {
promptAction.showToast({
message: $r('app.string.container_nested_only_show_for_ux')
})
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/containernestedslide/src/main/ets/view/CommentPage.ets#L41-L45 | 8deb9168cb719c81a46f93192d48a437bc33d7ed | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/model/src/main/ets/request/MessagePageRequest.ets | arkts | @param {Partial<MessagePageRequest>} init - 初始化数据 | constructor(init?: Partial<MessagePageRequest>) {
if (!init) return;
this.sessionId = init.sessionId ?? this.sessionId;
this.page = init.page ?? this.page;
this.size = init.size ?? this.size;
this.order = init.order ?? this.order;
this.sort = init.sort ?? this.sort;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left init ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left MessagePageRequest AST#primary_type#Right AST#type_annotation#Right > A... | constructor(init?: Partial<MessagePageRequest>) {
if (!init) return;
this.sessionId = init.sessionId ?? this.sessionId;
this.page = init.page ?? this.page;
this.size = init.size ?? this.size;
this.order = init.order ?? this.order;
this.sort = init.sort ?? this.sort;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/request/MessagePageRequest.ets#L30-L37 | b2c1fcb1b1b91c931bfc668e4bf01e2f899ca5f1 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/user/User.ets | arkts | SNS用户信息模型 | export class SnsOneUser {
userId: string | null = null;
userName: string | null = null;
avatarAddress: string | null = null;
accessToken: string | null = null;
expireIn: string | null = null;
} | AST#export_declaration#Left export AST#class_declaration#Left class SnsOneUser AST#class_body#Left { AST#property_declaration#Left userId : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_a... | export class SnsOneUser {
userId: string | null = null;
userName: string | null = null;
avatarAddress: string | null = null;
accessToken: string | null = null;
expireIn: string | null = null;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/user/User.ets#L111-L117 | 6d54198c820c3b0f24bd70621da4c3c57d16469f | github | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | WebDevelopOptimizationRender/entry/src/main/ets/pages/common.ets | arkts | initWeb | 此函数为自定义函数,可作为初始化函数使用 通过UIContext初始化BuilderNode,再通过BuilderNode中的build接口初始化@Builder中的内容 | initWeb(url: string, uiContext: UIContext, control: WebviewController) {
if (this.rootnode != null) {
return;
}
// 绑定预创建的WebviewController
this.rootWebviewController = control;
// 创建节点,需要uiContext
this.rootnode = new BuilderNode(uiContext);
// 创建动态Web组件
this.rootnode.build(wrap, { ... | AST#method_declaration#Left initWeb AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Rig... | initWeb(url: string, uiContext: UIContext, control: WebviewController) {
if (this.rootnode != null) {
return;
}
this.rootWebviewController = control;
this.rootnode = new BuilderNode(uiContext);
this.rootnode.build(wrap, { url: url, controller: control });
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/WebDevelopOptimizationRender/entry/src/main/ets/pages/common.ets#L77-L87 | b3ce848d28a8c7014d38ec0f888344c6ae4affeb | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/BarEntry.ets | arkts | calcSum | Calculates the sum across all values of the given stack.
@param vals
@return | public static calcSum(vals: number[]): number {
if (vals == null)
return 0;
let sum: number = 0;
for (let f of vals)
sum += f;
return sum;
} | AST#method_declaration#Left public static calcSum AST#parameter_list#Left ( AST#parameter#Left vals : 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#L... | public static calcSum(vals: number[]): number {
if (vals == null)
return 0;
let sum: number = 0;
for (let f of vals)
sum += f;
return sum;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarEntry.ets#L147-L155 | 0defc08e0d99af726ca4e8b1bbd725698eba3132 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | 完整农历系统设计.ets | arkts | 🔄 全新农历计算系统设计
基于权威天文台数据,从头重新设计的完整公历农历转换系统
设计原则:
1. 数据驱动 - 使用权威机构的精确数据
2. 算法简化 - 避免复杂的累加计算
3. 直接对应 - 基于查表和配置的精确转换
4. 完整验证 - 每个日期都经过验证
公历日期接口 | export interface SolarDate {
year: number;
month: number;
day: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface SolarDate AST#object_type#Left { AST#type_member#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left month : AST#type_annotation#Left AS... | export interface SolarDate {
year: number;
month: number;
day: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/完整农历系统设计.ets#L15-L19 | e6c1537cac5f16ff6bf2efc1d1260a4c0264e0e4 | github | |
EL233/WeChat-HarmonyOS.git | b5fa65556eb5f5698a92ec289ffd9ebe4cc5bb3e | entry/src/main/ets/view/PersonalInformation.ets | arkts | NavDestinationTitle | 导航栏标题构建器 | @Builder
NavDestinationTitle() {
Column() {
Row() {
Image($r('app.media.dot_grid'))
.width(24)
.height(24)
}
.width(40)
.height(40)
.borderRadius(36)
.backgroundColor('#E9E9E9')
.justifyContent(FlexAlign.Center)
.o... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right NavDestinationTitle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts... | @Builder
NavDestinationTitle() {
Column() {
Row() {
Image($r('app.media.dot_grid'))
.width(24)
.height(24)
}
.width(40)
.height(40)
.borderRadius(36)
.backgroundColor('#E9E9E9')
.justifyContent(FlexAlign.Center)
.o... | https://github.com/EL233/WeChat-HarmonyOS.git/blob/b5fa65556eb5f5698a92ec289ffd9ebe4cc5bb3e/entry/src/main/ets/view/PersonalInformation.ets#L235-L261 | 7f9d6b9276ab7eba219d74647672bd60a2eb48ab | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/DetailTitle.ets | arkts | DetailTitle | Large picture title, including primary date title and secondary time and place title | @Component
export struct DetailTitle {
private TAG: string = 'DetailTitle';
@Consume('dateTitle') title: string;
@Consume('timeLocationTitle') subTitle: string;
isVideoPage: boolean = false;
private onBuildDone(): void {
Log.debug(this.TAG, 'onBuildDone, title: ' + this.title + ', subTitle: ' + this.subT... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct DetailTitle AST#component_body#Left { AST#property_declaration#Left private TAG : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'DetailTit... | @Component
export struct DetailTitle {
private TAG: string = 'DetailTitle';
@Consume('dateTitle') title: string;
@Consume('timeLocationTitle') subTitle: string;
isVideoPage: boolean = false;
private onBuildDone(): void {
Log.debug(this.TAG, 'onBuildDone, title: ' + this.title + ', subTitle: ' + this.subT... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/DetailTitle.ets#L20-L55 | 54d680c1f292a7293fd04170e4d540f298d19d51 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/view/OrderDetailPage.ets | arkts | PriceDetailCard | 价格明细卡片
@returns {void} 无返回值 | @Builder
private PriceDetailCard(order: Order) {
Card() {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
hasBorder: true,
titleBuilder: (): void => this.PriceDetailTitle()
});
IBe... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private PriceDetailCard AST#parameter_list#Left ( AST#parameter#Left order : AST#type_annotation#Left AST#primary_type#Left Order AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_funct... | @Builder
private PriceDetailCard(order: Order) {
Card() {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
hasBorder: true,
titleBuilder: (): void => this.PriceDetailTitle()
});
IBe... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderDetailPage.ets#L177-L212 | 06bb71494c90635e13774b407074263327108690 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/router/AppRouter.ets | arkts | goGreetings | 跳转到祝福语页面 | async goGreetings(): Promise<void> {
await this.push(RoutePaths.GREETINGS);
} | AST#method_declaration#Left async goGreetings 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_argu... | async goGreetings(): Promise<void> {
await this.push(RoutePaths.GREETINGS);
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/router/AppRouter.ets#L257-L259 | 54ed3c6cd1e92d42d17f6dd3e473cfad30b25bb5 | github |
Rayawa/dashboard.git | 9107efe7fb69a58d799a378b79ea8ffa4041cec8 | entry/src/main/ets/pages/user/settings.ets | arkts | loadSettings | 加载所有设置 | private async loadSettings() {
try {
this.defaultSiteT = await getDefaultSite();
this.vibrationON = await getVibrationEnabled();
this.holdCheckON = await getHoldCheckEnabled();
this.buttonPositionRIGHT = await getButtonPosition();
this.themeColor = awa... | AST#method_declaration#Left private async loadSettings AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_e... | private async loadSettings() {
try {
this.defaultSiteT = await getDefaultSite();
this.vibrationON = await getVibrationEnabled();
this.holdCheckON = await getHoldCheckEnabled();
this.buttonPositionRIGHT = await getButtonPosition();
this.themeColor = awa... | https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/pages/user/settings.ets#L124-L135 | 07c1f895226421f009f196a0d755758beaab5978 | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/accuracy/flow_sensitive/loop_stmt/dowhile_body_001_T.ets | arkts | Introduction 循环结构-dowhile | export function dowhile_body_001_T(taint_src : string) {
let res = ""
do {
res = taint_src
taint.Sink(res)
} | AST#export_declaration#Left export AST#function_declaration#Left function dowhile_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#... | export function dowhile_body_001_T(taint_src : string) {
let res = ""
do {
res = taint_src
taint.Sink(res)
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/flow_sensitive/loop_stmt/dowhile_body_001_T.ets#L6-L11 | cd6ea68645a07feb56d761fe658b855c566bb99c | github | |
softfatgay/harmony-netease.git | 5f3d226b72ba8579cacfbd229e4eb0054d63abef | entry/src/main/ets/utils/TimeUtil.ets | arkts | 时间戳转时间 YYYY-YY-DD HH-MM-ss 格式
@params timestamp: 13位时间戳 | new Date() | Date()
console.log(dateFormat(1714528800000, 'YY-MM-DD HH:mm:ss'))
@params format => YY:年,M:月,D:日,H:时,m:分钟,s:秒,SSS:毫秒 | export function dateFormat(timestamp: number | string | Date, format = 'YYYY-MM-DD HH:mm:ss'): string {
var date = new Date(timestamp)
function fixedTwo(value: number): string {
return value < 10 ? '0' + value : String(value)
}
var showTime = format
if (showTime.includes('SSS')) {
const S = date.get... | AST#export_declaration#Left export AST#function_declaration#Left function dateFormat AST#parameter_list#Left ( AST#parameter#Left timestamp : 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 Dat... | export function dateFormat(timestamp: number | string | Date, format = 'YYYY-MM-DD HH:mm:ss'): string {
var date = new Date(timestamp)
function fixedTwo(value: number): string {
return value < 10 ? '0' + value : String(value)
}
var showTime = format
if (showTime.includes('SSS')) {
const S = date.get... | https://github.com/softfatgay/harmony-netease.git/blob/5f3d226b72ba8579cacfbd229e4eb0054d63abef/entry/src/main/ets/utils/TimeUtil.ets#L7-L53 | beb73677f6de16b71e96368845a7e8e3dbc58843 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/sns/hw/HWLoginManager.ets | arkts | silentLogin | 静默登录实现 | private async silentLogin(): Promise<SnsOneUser> {
const request: authentication.LoginWithHuaweiIDRequest =
new authentication.HuaweiIDProvider().createLoginWithHuaweiIDRequest();
request.forceLogin = false; // 关键参数:false 表示静默登录
request.state = util.generateRandomUUID(); // 生成防伪标识
const controll... | AST#method_declaration#Left private async silentLogin 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 SnsOneUser AST#primary_type#Right AST#type_annotation#Right >... | private async silentLogin(): Promise<SnsOneUser> {
const request: authentication.LoginWithHuaweiIDRequest =
new authentication.HuaweiIDProvider().createLoginWithHuaweiIDRequest();
request.forceLogin = false;
request.state = util.generateRandomUUID();
const controller = new authentication.Authe... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/sns/hw/HWLoginManager.ets#L34-L50 | ba96094d7b4e683f948441508980f31278585466 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Performance/PerformanceLibrary/feature/staticImport/Index.ets | arkts | StaticEntryView | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export { StaticEntryView } from './src/main/ets/pages/StaticEntryView' | AST#export_declaration#Left export { StaticEntryView } from './src/main/ets/pages/StaticEntryView' AST#export_declaration#Right | export { StaticEntryView } from './src/main/ets/pages/StaticEntryView' | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Performance/PerformanceLibrary/feature/staticImport/Index.ets#L15-L15 | 1209653c463d6cf11ee4ceb318f43393c5d06b14 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | AppColdStart/library/Index.ets | arkts | SubPage | Cold start strong related files | export { SubPage } from './src/main/ets/components/mainpage/SubPage'; | AST#export_declaration#Left export { SubPage } from './src/main/ets/components/mainpage/SubPage' ; AST#export_declaration#Right | export { SubPage } from './src/main/ets/components/mainpage/SubPage'; | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/AppColdStart/library/Index.ets#L18-L18 | e4c8fab697803d10f0cfe99dc52ce8dceb5854fa | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/proxy/TextPickerBuilderProxy.ets | arkts | selectedRightText | 右边标题(固定在当前选项的右侧,注意:当二维数组时,为第二维数组的选中项左侧)
@param selectedRightText
@returns | selectedRightText(selectedRightText: string) {
this.builderOptions.selectedRightText = selectedRightText
return this
} | AST#method_declaration#Left selectedRightText AST#parameter_list#Left ( AST#parameter#Left selectedRightText : 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#expressio... | selectedRightText(selectedRightText: string) {
this.builderOptions.selectedRightText = selectedRightText
return this
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/TextPickerBuilderProxy.ets#L49-L52 | 66f1451cd47f652fa8a64a58529b32ba99929458 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/calendar/LunarSolarMappingService.ets | arkts | getLunarDayName | 获取农历日期名称 | private getLunarDayName(day: number): string {
const dayNames = ['', '初一', '初二', '初三', '初四', '初五', '初六', '初七', '初八', '初九', '初十',
'十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '二十',
'廿一', '廿二', '廿三', '廿四', '廿五', '廿六', '廿七', '廿八', '廿九', '三十'];
return dayNames[da... | AST#method_declaration#Left private getLunarDayName AST#parameter_list#Left ( AST#parameter#Left day : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary... | private getLunarDayName(day: number): string {
const dayNames = ['', '初一', '初二', '初三', '初四', '初五', '初六', '初七', '初八', '初九', '初十',
'十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '二十',
'廿一', '廿二', '廿三', '廿四', '廿五', '廿六', '廿七', '廿八', '廿九', '三十'];
return dayNames[da... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/calendar/LunarSolarMappingService.ets#L302-L307 | eac9e43cb52abedb3294dc79f4bd353092459b08 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/multiplescreening/src/main/ets/model/SiteItemModel.ets | arkts | 场地套餐 | constructor(siteImage: ResourceStr, siteName: string, siteAddress: string, siteDiscount: string,
siteBale: Array<TimeList>) {
this.siteImage = siteImage;
this.siteName = siteName;
this.siteAddress = siteAddress;
this.siteDiscount = siteDiscount;
this.siteBale = siteBale;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left siteImage : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left siteName : AST#type_annotation#Left AST#primary_type#Left string AST#... | constructor(siteImage: ResourceStr, siteName: string, siteAddress: string, siteDiscount: string,
siteBale: Array<TimeList>) {
this.siteImage = siteImage;
this.siteName = siteName;
this.siteAddress = siteAddress;
this.siteDiscount = siteDiscount;
this.siteBale = siteBale;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/multiplescreening/src/main/ets/model/SiteItemModel.ets#L36-L43 | 68ee662f58a21f4df2de6a9f893caccab7834749 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/lunar/LunarService.ets | arkts | getZodiac | 获取生肖信息
@param year 农历年份
@returns 生肖名称 | getZodiac(year: number): string {
return LunarUtils.getZodiac(year);
} | AST#method_declaration#Left getZodiac AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right A... | getZodiac(year: number): string {
return LunarUtils.getZodiac(year);
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/lunar/LunarService.ets#L392-L394 | 04a086469baecb43fb8d1e02ee7ff992eff461db | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/Wechat_Arkts-master/entry/src/main/ets/pages/contact/label/LabelCreatedPage.ets | arkts | buf2String | 将 ArrayBuffer 转换为字符串 | private buf2String(buf: ArrayBuffer): string {
const msgArray = new Uint8Array(buf);
const textDecoder = new util.TextDecoder('utf-8');
return textDecoder.decode(msgArray);
} | AST#method_declaration#Left private buf2String AST#parameter_list#Left ( AST#parameter#Left buf : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary... | private buf2String(buf: ArrayBuffer): string {
const msgArray = new Uint8Array(buf);
const textDecoder = new util.TextDecoder('utf-8');
return textDecoder.decode(msgArray);
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/Wechat_Arkts-master/entry/src/main/ets/pages/contact/label/LabelCreatedPage.ets#L90-L94 | 04e0c187bc5e23fbf0742748c853a904ebcd47cc | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/data/DataImportExportService.ets | arkts | importFromFile | 从文件导入联系人 | async importFromFile(onProgress?: ImportProgressCallback): Promise<ImportResult> {
try {
hilog.info(0x0000, 'DataImportExportService', 'Starting file import...');
if (onProgress) {
onProgress({
totalRecords: 0,
processedRecords: 0,
currentOperation: '选择导入文件...',
... | AST#method_declaration#Left async importFromFile 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#L... | async importFromFile(onProgress?: ImportProgressCallback): Promise<ImportResult> {
try {
hilog.info(0x0000, 'DataImportExportService', 'Starting file import...');
if (onProgress) {
onProgress({
totalRecords: 0,
processedRecords: 0,
currentOperation: '选择导入文件...',
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/data/DataImportExportService.ets#L146-L209 | 955babaa85a8ae11d6ee550b87ee4ae130928925 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/BaseDataSet.ets | arkts | setColorsByVariable | Sets the colors that should be used fore this DataSet. Colors are reused
as soon as the number of Entries the DataSet represents is higher than
the size of the colors array. If you are using colors from the resources,
make sure that the colors are already prepared (by calling
getResources().getColor(...)) before adding... | public setColorsByVariable(colors: number[]): void {
this.mColors = ColorTemplate.createColors(colors);
} | AST#method_declaration#Left public setColorsByVariable AST#parameter_list#Left ( AST#parameter#Left colors : 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_annot... | public setColorsByVariable(colors: number[]): void {
this.mColors = ColorTemplate.createColors(colors);
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BaseDataSet.ets#L160-L162 | 3d9326ba070e65103fc785cf7fbd5a01c04a5baa | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildMemberRemove.ets | arkts | Emitted whenever a member leaves a guild, or is kicked.
@event Client#guildMemberRemove
@param {GuildMember} member The member that has left/been kicked from the guild
应用约束:模块导出语法(错误61) | export default GuildMemberRemoveAction; | AST#export_declaration#Left export default AST#expression#Left GuildMemberRemoveAction AST#expression#Right ; AST#export_declaration#Right | export default GuildMemberRemoveAction; | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildMemberRemove.ets#L60-L60 | b029027e49c86ee93d42f6ca683857da79035b30 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/pendingitems/src/main/ets/pages/ToDoListItem.ets | arkts | addAchieveData | 添加已完成数据项 | addAchieveData() {
this.toDoItem.isFinished = true;
if (this.toDoItem.isFinished) {
animateTo({ duration: STYLE_CONFIG.ANIMATION_DURATION }, () => {
const tempData = this.toDoData.filter(item => item.key !== this.toDoItem.key);
this.toDoData = tempData;
this.achieveData.push(this.t... | AST#method_declaration#Left addAchieveData 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 AST#member_expression#Left AST#expression#Left thi... | addAchieveData() {
this.toDoItem.isFinished = true;
if (this.toDoItem.isFinished) {
animateTo({ duration: STYLE_CONFIG.ANIMATION_DURATION }, () => {
const tempData = this.toDoData.filter(item => item.key !== this.toDoItem.key);
this.toDoData = tempData;
this.achieveData.push(this.t... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pendingitems/src/main/ets/pages/ToDoListItem.ets#L111-L120 | 4d1eebd51ca678cb3a0fdd4f97dc6ca6d85e9ac6 | gitee |
wustcat404/time-bar | d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8 | entry/src/main/ets/common/utils/CommonUtils.ets | arkts | Build prefix sum of durations (ms).
prefix[0] = 0, prefix[i+1] = sum(durations[0..i])
@param infos Video info list.
@returns Prefix sum array of length infos.length + 1. | export function calDurationPrefixSum(infos: VideoInfo[]): number[] {
if (isEmpty(infos)) {
return [];
}
const prefix: number[] = [0];
for (let i = 0; i < infos.length; i++) {
const prev = prefix[i] ?? 0;
const dur = Number(infos[i]?.duration) || 0;
prefix.push(prev + dur);
}
return prefix;
} | AST#export_declaration#Left export AST#function_declaration#Left function calDurationPrefixSum AST#parameter_list#Left ( AST#parameter#Left infos : 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#parameter#Right )... | export function calDurationPrefixSum(infos: VideoInfo[]): number[] {
if (isEmpty(infos)) {
return [];
}
const prefix: number[] = [0];
for (let i = 0; i < infos.length; i++) {
const prev = prefix[i] ?? 0;
const dur = Number(infos[i]?.duration) || 0;
prefix.push(prev + dur);
}
return prefix;
} | https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/entry/src/main/ets/common/utils/CommonUtils.ets#L174-L185 | 56a7b6f6697f4033967a603adfd7e2e0717de67d | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/FileUtil.ets | arkts | activatePermissionEasy | 对已经持久化授权的权限进行使能操作,否则已经持久化授权的权限仍存在不能使用的情况。(需要权限:ohos.permission.FILE_ACCESS_PERSIST)
@param uris string 需要授予或使能权限的URI。
@param operationMode number 授予或使能权限的URI访问模式,参考OperationMode,例如: fileShare.OperationMode.READ_MODE :允许读授权。fileShare.OperationMode.READ_MODE | fileShare.OperationMode.WRITE_MODE :允许读写授权。
@returns 无返回结果的P... | static async activatePermissionEasy(uris: Array<string>,
operationMode: number = fileShare.OperationMode.READ_MODE | fileShare.OperationMode.WRITE_MODE): Promise<void> {
let policies: Array<fileShare.PolicyInfo> = new Array<fileShare.PolicyInfo>();
for (let index = 0; index < uris.length; index++) {
l... | AST#method_declaration#Left static async activatePermissionEasy AST#parameter_list#Left ( AST#parameter#Left uris : 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 ... | static async activatePermissionEasy(uris: Array<string>,
operationMode: number = fileShare.OperationMode.READ_MODE | fileShare.OperationMode.WRITE_MODE): Promise<void> {
let policies: Array<fileShare.PolicyInfo> = new Array<fileShare.PolicyInfo>();
for (let index = 0; index < uris.length; index++) {
l... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L948-L956 | 9e8ffddb2fde7faec9c2be19f6959c884e24febc | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/VirtualEconomyService.ets | arkts | 用户钱包接口 | export interface UserWallet {
userId: string;
balances: Map<CurrencyType, number>;
items: VirtualItem[];
transactions: Transaction[];
dailyRewards: DailyReward[];
lastDailyRewardClaim: string;
totalSpent: Map<CurrencyType, number>;
totalEarned: Map<CurrencyType, number>;
createdAt: string;
updatedAt... | AST#export_declaration#Left export AST#interface_declaration#Left interface UserWallet AST#object_type#Left { AST#type_member#Left userId : 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 balances : AST#type_annotation#L... | export interface UserWallet {
userId: string;
balances: Map<CurrencyType, number>;
items: VirtualItem[];
transactions: Transaction[];
dailyRewards: DailyReward[];
lastDailyRewardClaim: string;
totalSpent: Map<CurrencyType, number>;
totalEarned: Map<CurrencyType, number>;
createdAt: string;
updatedAt... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/VirtualEconomyService.ets#L161-L172 | 68a908a9d43c93d86798fd6c5468d44249bf7d95 | github | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/ObjectUtil.ets | arkts | isNotNull | 判断对象是否为空
@param source
@returns | static isNotNull(source: object|undefined) {
return source !== undefined && source !== null;
} | AST#method_declaration#Left static isNotNull AST#parameter_list#Left ( AST#parameter#Left source : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left object AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ... | static isNotNull(source: object|undefined) {
return source !== undefined && source !== null;
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/ObjectUtil.ets#L26-L28 | 26799c201954d49ee8b96f5a24b51cb4efca9661 | github |
openharmony/graphic_graphic_2d | 46a11e91c9709942196ad2a7afea2e0fcd1349f3 | interfaces/kits/ani/drawing/ets/@ohos.graphics.drawing.ets | arkts | Provides settings for strokes during drawing.
@syscap SystemCapability.Graphics.Drawing
@since 11 | export class Pen {
static { loadLibraryWithPermissionCheck("drawing_ani_core", "@ohos.graphics.drawing"); } | AST#export_declaration#Left export AST#class_declaration#Left class Pen AST#ERROR#Left { static AST#ERROR#Right AST#class_body#Left { AST#method_declaration#Left loadLibraryWithPermissionCheck AST#parameter_list#Left ( AST#ERROR#Left "drawing_ani_core" , "@ohos.graphics.drawing" AST#ERROR#Right ) AST#parameter_list#Rig... | export class Pen {
static { loadLibraryWithPermissionCheck("drawing_ani_core", "@ohos.graphics.drawing"); } | https://github.com/openharmony/graphic_graphic_2d/blob/46a11e91c9709942196ad2a7afea2e0fcd1349f3/interfaces/kits/ani/drawing/ets/@ohos.graphics.drawing.ets#L581-L582 | d70dee2431b5ac0fbc598a8572f49b61718f675f | gitee | |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/shopping/user/src/ets/pages/collect/nullPage.ets | arkts | NullPage | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Component
export struct NullPage {
@Prop ratio: number
@Prop str: string
build() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(this.str)
.fontSize(15 * this.ratio)
.fontColor(Color.Grey)
.margin({ top: 10 } as... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct NullPage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right ratio : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#R... | @Component
export struct NullPage {
@Prop ratio: number
@Prop str: string
build() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(this.str)
.fontSize(15 * this.ratio)
.fontColor(Color.Grey)
.margin({ top: 10 } as... | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/shopping/user/src/ets/pages/collect/nullPage.ets#L16-L32 | 3d7ec7d54520ea1c3a3bd680565ed7a1b573c198 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/CandleDataSet.ets | arkts | setDecreasingColor | Sets the one and ONLY color that should be used for this DataSet when
open > close.
@param color | public setDecreasingColor(color: number): void {
this.mDecreasingColor = color;
} | AST#method_declaration#Left public setDecreasingColor AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#prima... | public setDecreasingColor(color: number): void {
this.mDecreasingColor = color;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/CandleDataSet.ets#L226-L228 | 79f92663248225e9bb0d390926ce00e3fe4e9e7b | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/view/OrderDetailPage.ets | arkts | RefundInfoCard | 退款信息卡片
@returns {void} 无返回值 | @Builder
private RefundInfoCard(order: Order) {
Card() {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
hasBorder: true,
titleBuilder: (): void => this.RefundInfoTitle()
});
IBest... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private RefundInfoCard AST#parameter_list#Left ( AST#parameter#Left order : AST#type_annotation#Left AST#primary_type#Left Order AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_functi... | @Builder
private RefundInfoCard(order: Order) {
Card() {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
hasBorder: true,
titleBuilder: (): void => this.RefundInfoTitle()
});
IBest... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderDetailPage.ets#L229-L267 | 6af4f9981e14adb9511f6034fc7f23c394694c81 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customdialog/src/main/ets/components/SubWindowApi.ets | arkts | hideSubWindow | 隐藏弹窗 | hideSubWindow(): void {
// 注销监听事件
this.offCallback();
// 关闭弹窗
this.destroySubWindow();
} | AST#method_declaration#Left hideSubWindow 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#... | hideSubWindow(): void {
this.offCallback();
this.destroySubWindow();
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customdialog/src/main/ets/components/SubWindowApi.ets#L174-L179 | c2e751414056645b8b69f1f1b09d0cc33934ba39 | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.deviceInfo.d.ets | arkts | get | Obtains the SDK API version number.
@syscap SystemCapability.Startup.SystemInfo
@crossplatform
@since 20
@arkts 1.2 | static get sdkApiVersion(): int; | AST#method_declaration#Left static get AST#ERROR#Left sdkApiVersion AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left int AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right | static get sdkApiVersion(): int; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.deviceInfo.d.ets#L294-L294 | 7bb7e16ade0083a7318fc1d70d6ddff1291c2fd8 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/core/device/DeviceManager.ets | arkts | onNetworkChange | 监听网络状态变化 | onNetworkChange(callback: (info: NetworkInfo) => void): void {
try {
const netHandle = network.getDefaultNetSync();
if (!netHandle) {
return;
}
netHandle.on('netAvailable', () => {
this.getNetworkInfo().then(callback);
});
netHandle.on('netCapabilitiesChange', (... | AST#method_declaration#Left onNetworkChange AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left info : AST#type_annotation#Left AST#primary_type#Left NetworkInfo AST#primary_type#Right AST#type_annotation#Right AST#paramete... | onNetworkChange(callback: (info: NetworkInfo) => void): void {
try {
const netHandle = network.getDefaultNetSync();
if (!netHandle) {
return;
}
netHandle.on('netAvailable', () => {
this.getNetworkInfo().then(callback);
});
netHandle.on('netCapabilitiesChange', (... | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/core/device/DeviceManager.ets#L185-L210 | 81bf71a5b5a94e43a5c37316182675d57f992aeb | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/ImageViewer/entry/src/main/ets/model/PositionModel.ets | arkts | PositionModel | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Observed
export class PositionModel {
private x: number;
private y: number;
constructor(x: number = 0, y: number = 0) {
this.x = x;
this.y = y;
}
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class PositionModel AST#class_body#Left { AST#property_declaration#Left private x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#p... | @Observed
export class PositionModel {
private x: number;
private y: number;
constructor(x: number = 0, y: number = 0) {
this.x = x;
this.y = y;
}
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ImageViewer/entry/src/main/ets/model/PositionModel.ets#L16-L25 | 9f14b2ac436f5766872d2a2a9a73637f52914c6d | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets | arkts | set | 设置tab项内容
@param name - tab项标题
@param content - tab项内容 | public set(name: string, tabInfo: TabInfo) {
this.tabsInfo.set(name, tabInfo);
} | AST#method_declaration#Left public set 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 tabInfo : AST#type_annotation#Left AST#primary_type#Left TabInfo AST#primary_type#Rig... | public set(name: string, tabInfo: TabInfo) {
this.tabsInfo.set(name, tabInfo);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets#L41-L43 | 4bb3489935eaa668638d25b1042e43295c1a8385 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.