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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/calendar/LunarService.ets | arkts | getFestivals | 获取节日信息 | private getFestivals(date: Date, lunarDate: LunarDate): Festival[] {
const festivals: Festival[] = [];
// 公历节日
const gregorianKey = this.formatDateKey(date);
if (this.TRADITIONAL_FESTIVALS[gregorianKey]) {
festivals.push(...this.TRADITIONAL_FESTIVALS[gregorianKey]);
}
// 农历节日
const l... | AST#method_declaration#Left private getFestivals AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left lunarDate : AST#type_annotation#Left AST#primary_type#Left LunarDate AST#prim... | private getFestivals(date: Date, lunarDate: LunarDate): Festival[] {
const festivals: Festival[] = [];
const gregorianKey = this.formatDateKey(date);
if (this.TRADITIONAL_FESTIVALS[gregorianKey]) {
festivals.push(...this.TRADITIONAL_FESTIVALS[gregorianKey]);
}
const lunarKey = this... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/calendar/LunarService.ets#L294-L310 | ff11dc68de70fa0210f9518fca7460c014f21e64 | github |
openharmony/applications_settings | aac607310ec30e30d1d54db2e04d055655f72730 | common/component/src/main/ets/default/sliderComponent.ets | arkts | SliderComponent | Slider component | @Component
export default struct SliderComponent {
@State clickConfirm: boolean = true;
@State showStep: boolean = false;
@State value: number = 0;
@State fontSize: number = 18; // Font size
private visible: boolean = true;
private min: number = 0;
private max: number = 100;
private step: number = 1;
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct SliderComponent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right clickConfirm : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Rig... | @Component
export default struct SliderComponent {
@State clickConfirm: boolean = true;
@State showStep: boolean = false;
@State value: number = 0;
@State fontSize: number = 18;
private visible: boolean = true;
private min: number = 0;
private max: number = 100;
private step: number = 1;
private left... | https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/common/component/src/main/ets/default/sliderComponent.ets#L20-L109 | 7f71e2dcbf4a13bacded8b2c7ecba9510420dfc5 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/clockin/src/main/ets/views/ClockInSamplePage.ets | arkts | customInfoWindowSlot | 自定义信息窗口插槽 | @Builder
customInfoWindowSlot(marker: map.Marker) {
Text(marker.getTitle())
.id('userAddress')
.lineHeight($r('app.integer.clock_in_info_window_line_height'))
.textAlign(TextAlign.Center)
.fontColor(Color.Black)
.font({ size: $r('app.integer.clock_in_info_window_font_size'), weight: ... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customInfoWindowSlot AST#parameter_list#Left ( AST#parameter#Left marker : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left map . Marker AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parame... | @Builder
customInfoWindowSlot(marker: map.Marker) {
Text(marker.getTitle())
.id('userAddress')
.lineHeight($r('app.integer.clock_in_info_window_line_height'))
.textAlign(TextAlign.Center)
.fontColor(Color.Black)
.font({ size: $r('app.integer.clock_in_info_window_font_size'), weight: ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/clockin/src/main/ets/views/ClockInSamplePage.ets#L90-L98 | f2796db8fac2fd52446d8fa046fb4b70e9ed50ae | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/DialogProject/entry/src/main/ets/common/Card.ets | arkts | CompletedRoutableCard | 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... | @Component
export struct CompletedRoutableCard {
@Prop
symbol: Resource = $r('sys.symbol.label');
@Prop
@Require
title: ResourceStr;
@Prop
@Require
description: ResourceStr;
build() {
Card({ verticalAlign: VerticalAlign.Top }) {
Button({ type: ButtonType.Circle }) {
SymbolGlyph(this... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CompletedRoutableCard AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right symbol : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#t... | @Component
export struct CompletedRoutableCard {
@Prop
symbol: Resource = $r('sys.symbol.label');
@Prop
@Require
title: ResourceStr;
@Prop
@Require
description: ResourceStr;
build() {
Card({ verticalAlign: VerticalAlign.Top }) {
Button({ type: ButtonType.Circle }) {
SymbolGlyph(this... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/DialogProject/entry/src/main/ets/common/Card.ets#L16-L48 | 89905e57e89b6d8b692c3957cdc24954f277c5a4 | gitee |
MoonlitDropOfBlood/websocket.git | 0e93f2a243442fec0c16b511081a9d7fddceb821 | library/BuildProfile.ets | arkts | Use these variables when you tailor your ArkTS code. They must be of the const type. | export const HAR_VERSION = '1.0.5'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HAR_VERSION = AST#expression#Left '1.0.5' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const HAR_VERSION = '1.0.5'; | https://github.com/MoonlitDropOfBlood/websocket.git/blob/0e93f2a243442fec0c16b511081a9d7fddceb821/library/BuildProfile.ets#L4-L4 | 231ead46d755d07740958a24f99234ab7b563c48 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/functionalscenes/src/main/ets/model/WaterFlowDataSource.ets | arkts | registerDataChangeListener | 注册改变数据的控制器
@param listener 数据控制器 | registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
this.listeners.push(listener);
}
} | AST#method_declaration#Left registerDataChangeListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left DataChangeListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Lef... | registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
this.listeners.push(listener);
}
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/functionalscenes/src/main/ets/model/WaterFlowDataSource.ets#L102-L106 | 28327fd8deaf8d3af0d2c5aad67a6913c5691b6a | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/DeviceUtils.ets | arkts | getPowerMode | 获取当前设备的电源模式。
MODE_NORMAL 600 表示标准模式,默认值。
MODE_POWER_SAVE 601 表示省电模式。
MODE_PERFORMANCE 602 表示性能模式。
MODE_EXTREME_POWER_SAVE 603 表示超级省电模式。
@returns | static getPowerMode(): power.DevicePowerMode {
return power.getPowerMode();
} | AST#method_declaration#Left static getPowerMode AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left power . DevicePowerMode AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AS... | static getPowerMode(): power.DevicePowerMode {
return power.getPowerMode();
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/DeviceUtils.ets#L245-L247 | 649a1d16de22f533ec5dafbbc8e07b3b5c257ea7 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/member/MemberManager.ets | arkts | 私有构造器 | private constructor() {} | AST#constructor_declaration#Left private constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { } AST#block_statement#Right AST#constructor_declaration#Right | private constructor() {} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/member/MemberManager.ets#L82-L82 | 4f412ef1927c406a4cf9fb5de3b4a1cf1dc7231d | github | |
dcm23333/FishManager.git | 952dde4475268ac16f3480f3d55f82033aa6b467 | FishManager/entry/src/main/ets/common/contants/commonContants.ets | arkts | ‘90%’ | export const THOUSANDTH_1000: string = '100%'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left THOUSANDTH_1000 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '100%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_decl... | export const THOUSANDTH_1000: string = '100%'; | https://github.com/dcm23333/FishManager.git/blob/952dde4475268ac16f3480f3d55f82033aa6b467/FishManager/entry/src/main/ets/common/contants/commonContants.ets#L63-L63 | f90515df0a870b3b3baabf9f7f479faaa93ac193 | github | |
fengmingdev/protobuf-arkts-generator.git | 75888d404fd6ce52a046cba2a94807ecf1350147 | runtime/arkpb/MessageRegistry.ets | arkts | 消息类型注册表(可选功能)
提供消息类型的动态查找和创建功能
使用场景示例:
场景 1: 使用 google.protobuf.Any
```typescript
import { MessageRegistry } from './protobuf-core'
import { Person } from './pb/Person'
// 注册消息类型
MessageRegistry.register(Person)
// 使用 Any 类型
const anyMsg = new Google_Protobuf_Any()
anyMsg.pack(person)
const unpacked = anyMsg.unpac... | export class MessageRegistry {
/**
* 消息类型映射表
*
* key: 消息类型名称(如 "google.protobuf.Timestamp")
* value: 消息构造器
*/
private static readonly types = new Map<string, MessageConstructor<Message>>()
/**
* 注册消息类型
*
* ⚠️ 可选:只在需要动态查找或 Any 类型时才调用
*
* @param ctor 消息构造器
*
* 使用示例:
* ```type... | AST#export_declaration#Left export AST#class_declaration#Left class MessageRegistry AST#class_body#Left { /**
* 消息类型映射表
*
* key: 消息类型名称(如 "google.protobuf.Timestamp")
* value: 消息构造器
*/ AST#property_declaration#Left private static readonly types = AST#expression#Left AST#call_expression#Left AST#expressio... | export class MessageRegistry {
private static readonly types = new Map<string, MessageConstructor<Message>>()
static register<T extends Message>(ctor: MessageConstructor<T>): void {
MessageRegistry.types.set(ctor.typeName, ctor as MessageConstructor<Message>)
}
static registerAll(ctors: MessageCo... | https://github.com/fengmingdev/protobuf-arkts-generator.git/blob/75888d404fd6ce52a046cba2a94807ecf1350147/runtime/arkpb/MessageRegistry.ets#L64-L260 | 9ccbf70668b17e62eddd86cd49d5949319c4f4e0 | github | |
RedRackham-R/WanAndroidHarmoney.git | 0bb2a7c8d7b49194a96e42a380d43b7e106cdb22 | entry/src/main/ets/utils/SyncSafetyLock.ets | arkts | 简单异步安全锁 | export class SyncSafetyLock {
private _locked: boolean = false;
private _waiting: (() => void)[] = [];
async acquire() {
while (this._locked) {
await new Promise<void>(resolve => this._waiting.push(resolve));
}
this._locked = true;
}
release() {
this._locked = false;
if (this._wait... | AST#export_declaration#Left export AST#class_declaration#Left class SyncSafetyLock AST#class_body#Left { AST#property_declaration#Left private _locked : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolea... | export class SyncSafetyLock {
private _locked: boolean = false;
private _waiting: (() => void)[] = [];
async acquire() {
while (this._locked) {
await new Promise<void>(resolve => this._waiting.push(resolve));
}
this._locked = true;
}
release() {
this._locked = false;
if (this._wait... | https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/utils/SyncSafetyLock.ets#L4-L22 | 536c505d55acec64ee75c4d9dd691f2a9e434384 | github | |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | examples/Overlay/entry/src/main/ets/pages/components/popup/popupDismissTets.ets | arkts | PopupDismissBuilder | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Builder
export function PopupDismissBuilder(name: string, param: Object) {
PopupExample03()
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function PopupDismissBuilder 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 p... | @Builder
export function PopupDismissBuilder(name: string, param: Object) {
PopupExample03()
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Overlay/entry/src/main/ets/pages/components/popup/popupDismissTets.ets#L15-L18 | aa0a6b72b7ae6446b2d1f4eb63b3b9328cf37e45 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/greetings/GreetingSendPage.ets | arkts | buildGreetingEditor | 构建祝福语编辑器 | @Builder
buildGreetingEditor() {
Column({ space: 12 }) {
Row() {
Text('祝福语内容')
.fontSize(16)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.layoutWeight(1)
// 样式选择按钮
Button(this.getStyleLabel(this.selectedStyle))
.type... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildGreetingEditor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component... | @Builder
buildGreetingEditor() {
Column({ space: 12 }) {
Row() {
Text('祝福语内容')
.fontSize(16)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.layoutWeight(1)
Button(this.getStyleLabel(this.selectedStyle))
.type(ButtonTy... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/greetings/GreetingSendPage.ets#L322-L397 | cf101f5343e10a5ad44e01351353516ca700059d | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkWeb/UseOfflineWebComp/entry1/src/main/ets/entry1ability/Entry1Ability.ets | arkts | onWindowStageCreate | [Start entry_ability_window_stage_created_after_page_loaded] | onWindowStageCreate(windowStage: window.WindowStage): void {
windowStage.loadContent('pages/Index', (err, data) => {
// 创建空的Web动态组件(需传入UIContext),loadContent之后的任意时机均可创建
createNWeb('about:blank', windowStage.getMainWindowSync().getUIContext());
if (err.code) {
return;
}
});
} | AST#method_declaration#Left onWindowStageCreate AST#parameter_list#Left ( AST#parameter#Left windowStage : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . WindowStage AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right ... | onWindowStageCreate(windowStage: window.WindowStage): void {
windowStage.loadContent('pages/Index', (err, data) => {
createNWeb('about:blank', windowStage.getMainWindowSync().getUIContext());
if (err.code) {
return;
}
});
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkWeb/UseOfflineWebComp/entry1/src/main/ets/entry1ability/Entry1Ability.ets#L31-L39 | c14b61f3f06b79081248f676826df42b575227b7 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/action/DialogUtil.ets | arkts | showConfirmDialog | 显示弹框(一个按钮的)
@param options | static showConfirmDialog(options: ConfirmDialogOptions) {
DialogUtil.initDialogDefault(options);
DialogUtil.initConfirmButton(options);
AlertDialog.show(options as AlertDialogParamWithConfirm);
} | AST#method_declaration#Left static showConfirmDialog AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ConfirmDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_... | static showConfirmDialog(options: ConfirmDialogOptions) {
DialogUtil.initDialogDefault(options);
DialogUtil.initConfirmButton(options);
AlertDialog.show(options as AlertDialogParamWithConfirm);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/action/DialogUtil.ets#L53-L57 | d4b77fc7a65b1973cade46713e5a2052d4ae188c | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/utils/DateUtils.ets | arkts | getTimestamp | 获取时间戳 | static getTimestamp(): number {
return Date.now();
} | AST#method_declaration#Left static getTimestamp 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#call_expres... | static getTimestamp(): number {
return Date.now();
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/DateUtils.ets#L53-L55 | 9847fc563dad0c5a4a73f54758c255a2992cd5cb | github |
openharmony/applications_launcher | f75dfb6bf7276e942793b75e7a9081bbcd015843 | feature/pagedesktop/src/main/ets/default/common/components/FolderItem.ets | arkts | setStartAppInfo | set start app info | private setStartAppInfo(appItem: AppItemInfo) {
AppStorage.setOrCreate('startAppItemInfo', appItem);
AppStorage.setOrCreate('startAppFromFolderItemInfo', this.folderItem);
AppStorage.setOrCreate('startAppTypeFromPageDesktop', CommonConstants.OVERLAY_TYPE_FOLDER);
this.mPageDesktopStartAppHandler.setAppI... | AST#method_declaration#Left private setStartAppInfo AST#parameter_list#Left ( AST#parameter#Left appItem : AST#type_annotation#Left AST#primary_type#Left AppItemInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#... | private setStartAppInfo(appItem: AppItemInfo) {
AppStorage.setOrCreate('startAppItemInfo', appItem);
AppStorage.setOrCreate('startAppFromFolderItemInfo', this.folderItem);
AppStorage.setOrCreate('startAppTypeFromPageDesktop', CommonConstants.OVERLAY_TYPE_FOLDER);
this.mPageDesktopStartAppHandler.setAppI... | https://github.com/openharmony/applications_launcher/blob/f75dfb6bf7276e942793b75e7a9081bbcd015843/feature/pagedesktop/src/main/ets/default/common/components/FolderItem.ets#L238-L244 | 15d5ed29697a27e553025355060acb4b397e5895 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets | arkts | handleRegionConfirm | 处理地区选择确认
@param {IBestCascaderOption[]} selectedOptions - 选中的地区
@returns {void} 无返回值 | handleRegionConfirm(selectedOptions: IBestCascaderOption[]): void {
this.isRegionPickerVisible = false;
const labels: string[] = selectedOptions.map((item: IBestCascaderOption): string => {
return `${item.text ?? ""}`;
});
const values: Array<string> = selectedOptions.map((item: IBestCascaderOptio... | AST#method_declaration#Left handleRegionConfirm AST#parameter_list#Left ( AST#parameter#Left selectedOptions : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left IBestCascaderOption [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right :... | handleRegionConfirm(selectedOptions: IBestCascaderOption[]): void {
this.isRegionPickerVisible = false;
const labels: string[] = selectedOptions.map((item: IBestCascaderOption): string => {
return `${item.text ?? ""}`;
});
const values: Array<string> = selectedOptions.map((item: IBestCascaderOptio... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets#L182-L194 | a67a9980e4f7ea0f11b7de0e87a3b1f3f0a6ed2b | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/components/SelectDialog.ets | arkts | SelectDialog | 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... | @CustomDialog
export struct SelectDialog {
private menus: Array<string> = [];
private doOperation: (index: number) => void = () => {
};
controller?: CustomDialogController;
build() {
Column() {
ForEach(this.menus, (item: string, index: number) => {
Row() {
Button() {
T... | AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct SelectDialog AST#component_body#Left { AST#property_declaration#Left private menus : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST... | @CustomDialog
export struct SelectDialog {
private menus: Array<string> = [];
private doOperation: (index: number) => void = () => {
};
controller?: CustomDialogController;
build() {
Column() {
ForEach(this.menus, (item: string, index: number) => {
Row() {
Button() {
T... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/components/SelectDialog.ets#L16-L49 | afce0f68150ac48dff7038957d9bbc2512943736 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Media/Image/photomodify/Index.ets | arkts | logger | Copyright (c) 2022-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,... | export { logger } from './src/main/ets/components/util/Logger'; | AST#export_declaration#Left export { logger } from './src/main/ets/components/util/Logger' ; AST#export_declaration#Right | export { logger } from './src/main/ets/components/util/Logger'; | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Image/photomodify/Index.ets#L16-L16 | 7fd29575b9589310f762a4fed1f86218ed22afbe | gitee |
Classaspen/ArkTS_PasswordManagement.git | 66aea6e4f8ee3a78e5029c63186dba70707ca2d9 | entry/src/main/ets/pages/MainPage.ets | arkts | BuildSpecialCard | 特殊卡片 | @Builder
BuildSpecialCard(text: Resource, color: Resource, borderColor: Resource) {
Column() {
Image($r('app.media.avatar'))
.width(60) // 增大图标
.height(60)
.margin({ bottom: 16 })
Text(text)
.fontSize(22) // 增大字体
.fontColor(Color.White)
.fontWeight(Font... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right BuildSpecialCard AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left color : AST#type_annotation#... | @Builder
BuildSpecialCard(text: Resource, color: Resource, borderColor: Resource) {
Column() {
Image($r('app.media.avatar'))
.width(60)
.height(60)
.margin({ bottom: 16 })
Text(text)
.fontSize(22)
.fontColor(Color.White)
.fontWeight(FontWeight.Bold)
... | https://github.com/Classaspen/ArkTS_PasswordManagement.git/blob/66aea6e4f8ee3a78e5029c63186dba70707ca2d9/entry/src/main/ets/pages/MainPage.ets#L134-L160 | eed5bcce270eeaf6e500ff320d504f3e5c65c976 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/ComponentBase.ets | arkts | setEnabled | Set this to true if this component should be enabled (should be drawn),
false if not. If disabled, nothing of this component will be drawn.
Default: true
@param enabled | public setEnabled(enabled: boolean): void {
this.mEnabled = enabled;
} | AST#method_declaration#Left public setEnabled AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_ty... | public setEnabled(enabled: boolean): void {
this.mEnabled = enabled;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/ComponentBase.ets#L170-L172 | dd15ac041bd260704097847be698ecefbac1432d | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/chatwithexpression/src/main/ets/view/ChatWithExpression.ets | arkts | sendChatMsg | 发送聊天消息 | async sendChatMsg(): Promise<void> {
let msgBase = new MessageBase(true, USER_NAME_MYSELF, HEAD_IMAGE_MYSELF, this.msgMaxWidth);
// 获取发送信息
this.controllerRich.getSpans({
start: this.start,
end: this.end
}).forEach(item => {
if (typeof (item as RichEditorImageSpanResult)['imageStyle'] !... | AST#method_declaration#Left async sendChatMsg 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 sendChatMsg(): Promise<void> {
let msgBase = new MessageBase(true, USER_NAME_MYSELF, HEAD_IMAGE_MYSELF, this.msgMaxWidth);
this.controllerRich.getSpans({
start: this.start,
end: this.end
}).forEach(item => {
if (typeof (item as RichEditorImageSpanResult)['imageStyle'] !== 'undef... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/chatwithexpression/src/main/ets/view/ChatWithExpression.ets#L204-L234 | a91e25226431a214b1567e778e7a48bac89e9db1 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/jobs/AnimatedViewPortJob.ets | arkts | Runnable that is used for viewport modifications since they cannot be
executed at any time. This can be used to delay the execution of viewport
modifications until the onSizeChanged(...) method of the chart-view is called.
This is especially important if viewport modifying methods are called on the chart
directly after... | export default abstract class AnimatedViewPortJob extends ViewPortJob {
protected phase : number = 0;
protected xOrigin : number = 0;
protected yOrigin : number = 0;
protected duration: number = 0
protected mViewPortHandler: ViewPortHandler | null = null;
protected xValue: number = 0;
protected yValue: ... | AST#export_declaration#Left export default AST#class_declaration#Left abstract class AnimatedViewPortJob extends AST#type_annotation#Left AST#primary_type#Left ViewPortJob AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#property_declaration#Left protected phase : AST#type_annotation#Left AST#... | export default abstract class AnimatedViewPortJob extends ViewPortJob {
protected phase : number = 0;
protected xOrigin : number = 0;
protected yOrigin : number = 0;
protected duration: number = 0
protected mViewPortHandler: ViewPortHandler | null = null;
protected xValue: number = 0;
protected yValue: ... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/jobs/AnimatedViewPortJob.ets#L34-L55 | 12fdd909eeb6e2ccc4a5afdc55a08e5edffb637f | gitee | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/utils/storage_tools.ets | arkts | Pick & Save
Save (Copy) any file from a path to download folder. Without pulling up a DocumentViewPicker interface.
@param path source path of object to be stored. | export async function download_save_from_path(path: string) {
let uri: string = '';
const documentViewPicker = new picker.DocumentViewPicker();
const documentSaveOptions = new picker.DocumentSaveOptions();
documentSaveOptions.pickerMode = picker.DocumentPickerMode.DOWNLOAD;
await documentViewPicker.save(docum... | AST#export_declaration#Left export AST#function_declaration#Left async function download_save_from_path AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_stat... | export async function download_save_from_path(path: string) {
let uri: string = '';
const documentViewPicker = new picker.DocumentViewPicker();
const documentSaveOptions = new picker.DocumentSaveOptions();
documentSaveOptions.pickerMode = picker.DocumentPickerMode.DOWNLOAD;
await documentViewPicker.save(docum... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/storage_tools.ets#L17-L36 | db51d5cee483580b1df99606624689fdb191bf53 | gitee | |
openharmony/applications_settings | aac607310ec30e30d1d54db2e04d055655f72730 | common/component/src/main/ets/default/subEntryComponent.ets | arkts | SubEntryComponentWithEndText | Sub-Page Entry Component with EndText | @Component
export struct SubEntryComponentWithEndText {
@State isTouched: boolean = false;
@Link endText: string;
private targetPage: string = '';
private title: string | Resource = '';
build() {
Navigator({ target: this.targetPage }) {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: Ite... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct SubEntryComponentWithEndText 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#R... | @Component
export struct SubEntryComponentWithEndText {
@State isTouched: boolean = false;
@Link endText: string;
private targetPage: string = '';
private title: string | Resource = '';
build() {
Navigator({ target: this.targetPage }) {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: Ite... | https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/common/component/src/main/ets/default/subEntryComponent.ets#L78-L140 | e1e96b2de380b4856e158ebf35c9ada97212aa02 | gitee |
buqiuz/game-puzzle.git | 605dc0fac0738466db308a8ba255b5e9094c52ac | entry/src/main/ets/pages/Login.ets | arkts | showToast | Toast提示 | showToast(resource: string) {
try {
promptAction.showToast({
message: resource,
duration: 2000
});
} catch (error) {
const message = (error as BusinessError).message
const code = (error as BusinessError).code
hilog.error(this.domainId, this.logTag, `showToast args ... | AST#method_declaration#Left showToast AST#parameter_list#Left ( AST#parameter#Left resource : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST... | showToast(resource: string) {
try {
promptAction.showToast({
message: resource,
duration: 2000
});
} catch (error) {
const message = (error as BusinessError).message
const code = (error as BusinessError).code
hilog.error(this.domainId, this.logTag, `showToast args ... | https://github.com/buqiuz/game-puzzle.git/blob/605dc0fac0738466db308a8ba255b5e9094c52ac/entry/src/main/ets/pages/Login.ets#L119-L130 | 57d474fd17a1e16c127c81a0b9e267e14fa3e983 | github |
jjjjjjava/ffmpeg_tools.git | 6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161 | BuildProfile.ets | arkts | Use these variables when you tailor your ArkTS code. They must be of the const type. | export const HAR_VERSION = '2.2.3'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HAR_VERSION = AST#expression#Left '2.2.3' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const HAR_VERSION = '2.2.3'; | https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/BuildProfile.ets#L4-L4 | b45e5e624d0adc8c810dbfa6628cf64a757b8015 | github | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_history_index_x_functions.ets | arkts | Ensures that this month has an history file.
If there doesn't exist such, then create one. | export function ensure_this_month_history_file(context_filesDir?: string) {
let filesDir: string = context_filesDir || meowContext().filesDir;
// Create this month history
const current_year: number = new Date().getUTCFullYear();
const current_month: number = new Date().getUTCMonth() + 1;
const this_month_fil... | AST#export_declaration#Left export AST#function_declaration#Left function ensure_this_month_history_file AST#parameter_list#Left ( AST#parameter#Left context_filesDir ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right... | export function ensure_this_month_history_file(context_filesDir?: string) {
let filesDir: string = context_filesDir || meowContext().filesDir;
const current_year: number = new Date().getUTCFullYear();
const current_month: number = new Date().getUTCMonth() + 1;
const this_month_file_path = history_path_of_mon... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history_index_x_functions.ets#L335-L346 | b8789ebce4757984bca21aaf1d5fcc378d46b633 | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/slidetohideanddisplace/src/main/ets/view/SlideToHideAndDisplace.ets | arkts | interaction | 自定义构建函数。此处样式为在Row组件中横向排列互动相关的标签:粉丝,收藏,关注,历史 | @Builder
interaction() {
Row() {
ForEach(this.interactionInfo, (item: IconAndDescription) => {
Column() {
this.iconAndDescription(item.icon, item.description, undefined, 0, () => {
})
}
.width($r("app.string.slidetohideanddisplace_width_of_elements_in_interaction"... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right interaction 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#ui_control_flow#... | @Builder
interaction() {
Row() {
ForEach(this.interactionInfo, (item: IconAndDescription) => {
Column() {
this.iconAndDescription(item.icon, item.description, undefined, 0, () => {
})
}
.width($r("app.string.slidetohideanddisplace_width_of_elements_in_interaction"... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/slidetohideanddisplace/src/main/ets/view/SlideToHideAndDisplace.ets#L141-L153 | e931bcea31ffc1ab6c66567da1d215466fe763ea | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_audio/src/main/ets/audio/EfAVPlayer.ets | arkts | @Author wsy
@DateTime 2024/10/13 0:11
@TODO EfAVPlayer 类用于管理多媒体播放器 | export class EfAVPlayer {
/**
* 私有属性,存储多媒体播放器实例,初始值为 null。
*/
private avPlayer: media.AVPlayer | null = null;
/**
* 私有属性,用于存储状态变化的回调函数,初始值为 undefined。
*/
private stateChangeCallback?: Function;
/**
* 私有属性,用于存储错误的回调函数,初始值为 undefined。
*/
private errorCallback?: Function;
/**
* 私有属性,用于存储... | AST#export_declaration#Left export AST#class_declaration#Left class EfAVPlayer AST#class_body#Left { /**
* 私有属性,存储多媒体播放器实例,初始值为 null。
*/ AST#property_declaration#Left private avPlayer : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left media . AVPlayer AST#qualified_type#R... | export class EfAVPlayer {
private avPlayer: media.AVPlayer | null = null;
private stateChangeCallback?: Function;
private errorCallback?: Function;
private timeUpdateCallback?: Function;
volume: number = 1
loop: boolean = false
duration: number = 0;
currentTime: number = 0;
... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_audio/src/main/ets/audio/EfAVPlayer.ets#L26-L159 | cc042279736c031db33b2eed2ebef9a34ed6e121 | gitee | |
Vinson0709/arkdemo.git | 793491fe04b387f55dadfef86b30e28d0535d994 | entry/src/main/ets/pages/Grids.ets | arkts | dividerStyle | 自定义样式:divider | @Styles dividerStyle() {
.width('100%')
.margin({ top: 24, bottom: 24})
} | AST#method_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right dividerStyle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . margin ( AST#e... | @Styles dividerStyle() {
.width('100%')
.margin({ top: 24, bottom: 24})
} | https://github.com/Vinson0709/arkdemo.git/blob/793491fe04b387f55dadfef86b30e28d0535d994/entry/src/main/ets/pages/Grids.ets#L38-L41 | 9925ed9a36fcf093575de0a98b0821f2c1df6477 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/ar/ARCardCreatorPage.ets | arkts | buildStepContent | 构建步骤内容 | @Builder
buildStepContent() {
Column() {
switch (this.currentStep) {
case 0:
this.buildContactSelection();
break;
case 1:
this.buildCardTypeSelection(); | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildStepContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left { Column ( ) { AST#expression_statement#Left AST#expression#Left switch AST#expression#Right AST#ERROR#Left ( AST#expression#Left AST#member_expression#Left A... | @Builder
buildStepContent() {
Column() {
switch (this.currentStep) {
case 0:
this.buildContactSelection();
break;
case 1:
this.buildCardTypeSelection(); | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/ar/ARCardCreatorPage.ets#L161-L169 | 46195058b48595763e0b37588cf2f06fa61930b8 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/DataType.ets | arkts | totalCount | 获取数组长度。
@returns {number} 返回数组长度。 | public totalCount(): number {
return 0;
} | AST#method_declaration#Left public totalCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left 0 AST#expression#... | public totalCount(): number {
return 0;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/DataType.ets#L54-L56 | 97058d42a0f73c7aed7a1921dee7552444e4ee49 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/AuthUtil.ets | arkts | onStart | 开始认证,用户指定类型认证
@param options
@param callBack | static onStart(options: AuthOptions, callBack: Callback<userAuth.UserAuthResult>) {
try {
if (options.challenge === undefined) {
options.challenge = AuthUtil.generateChallenge(); //挑战值,用来防重放攻击。最大长度为32字节,可传Uint8Array([])
}
if (options.authType === undefined || options.authType.length <= 0) ... | AST#method_declaration#Left static onStart AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left AuthOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callBack : AST#type_annotation#Left AST#primary_type#Left AST#generic_typ... | static onStart(options: AuthOptions, callBack: Callback<userAuth.UserAuthResult>) {
try {
if (options.challenge === undefined) {
options.challenge = AuthUtil.generateChallenge();
}
if (options.authType === undefined || options.authType.length <= 0) {
options.authType = [userAuth.U... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/AuthUtil.ets#L71-L118 | eeb876f6ba1a20f97113f83efb96c73bc6fb9d7e | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/basedict/utils/BaseWordUtility.ets | arkts | getTextOfKindString | / 返回单词类型字符串,如动词、形容词等 | static getTextOfKindString(kindStr: string | null): string {
let rtnStr = "";
if (kindStr != null) {
if (kindStr === "n") rtnStr = getString($r('app.string.word_kind_n'));
else if (kindStr === "v") rtnStr = getString($r('app.string.word_kind_v'));
else if (kindStr === "vt") ... | AST#method_declaration#Left static getTextOfKindString AST#parameter_list#Left ( AST#parameter#Left kindStr : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#... | static getTextOfKindString(kindStr: string | null): string {
let rtnStr = "";
if (kindStr != null) {
if (kindStr === "n") rtnStr = getString($r('app.string.word_kind_n'));
else if (kindStr === "v") rtnStr = getString($r('app.string.word_kind_v'));
else if (kindStr === "vt") ... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/basedict/utils/BaseWordUtility.ets#L234-L258 | 0f6a1479447f664c5a051a25a7295ea84cf5e8cc | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.file.PhotoPickerComponent.d.ets | arkts | Single-Line display mode.
@syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
@atomicservice
@since 20 | export declare class SingleLineConfig {
/**
* item display ratio
*
* @type { ?ItemDisplayRatio }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 20
*/
itemDisplayRatio?: ItemDisplayRatio;
/**
* Rounded corner radius of grid items.
*
* @type... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class SingleLineConfig AST#class_body#Left { /**
* item display ratio
*
* @type { ?ItemDisplayRatio }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 20
*/... | export declare class SingleLineConfig {
itemDisplayRatio?: ItemDisplayRatio;
itemBorderRadius?: Length | BorderRadiuses | LocalizedBorderRadiuses;
itemGap?: Length;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.file.PhotoPickerComponent.d.ets#L745-L775 | 8f2951e8b6318b11592c438d30a36151bc5f4168 | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/renderer/scatter/CrossShapeRenderer.ets | arkts | Created by wajdic on 15/06/2016.
Created at Time 09:08 | export default class CrossShapeRenderer implements IShapeRenderer {
public renderShape(c: CanvasRenderingContext2D, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler,
posX: number, posY: number, renderPaint: Paint): void {
const shapeHalf: number = dataSet.getScatterShapeSize() / 2;... | AST#export_declaration#Left export default AST#class_declaration#Left class CrossShapeRenderer AST#implements_clause#Left implements IShapeRenderer AST#implements_clause#Right AST#class_body#Left { AST#method_declaration#Left public renderShape AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left A... | export default class CrossShapeRenderer implements IShapeRenderer {
public renderShape(c: CanvasRenderingContext2D, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler,
posX: number, posY: number, renderPaint: Paint): void {
const shapeHalf: number = dataSet.getScatterShapeSize() / 2;... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/scatter/CrossShapeRenderer.ets#L26-L46 | 7a5f441736ba6cfaa61d9c75548dd743ef237bb9 | gitee | |
851432669/Smart-Home-ArkTs-Hi3861.git | 0451f85f072ed3281cc23d9cdc2843d79f60f975 | entry/src/main/ets/common/utils/GlobalDataManager.ets | arkts | getDeviceStatus | 获取所有设备状态 | getDeviceStatus(): DeviceStatus[] {
return this.deviceStatus;
} | AST#method_declaration#Left getDeviceStatus AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DeviceStatus [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#... | getDeviceStatus(): DeviceStatus[] {
return this.deviceStatus;
} | https://github.com/851432669/Smart-Home-ArkTs-Hi3861.git/blob/0451f85f072ed3281cc23d9cdc2843d79f60f975/entry/src/main/ets/common/utils/GlobalDataManager.ets#L147-L149 | 5d76edaef21a7b49523db660baba7cd101c518db | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/DisplayUtils.ets | arkts | getScreenWidthPx | px单位方法(保持原有) | public static getScreenWidthPx(): number {
return DisplayUtils._defaultDisplay.width;
} | AST#method_declaration#Left public static getScreenWidthPx 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#... | public static getScreenWidthPx(): number {
return DisplayUtils._defaultDisplay.width;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/DisplayUtils.ets#L18-L20 | b44f4f98e80de289c91da976e0d0d2781fba2e7d | github |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/services/MockDataService.ets | arkts | 会话模型 | export interface Conversation {
id: string;
name: string;
avatar: string;
lastMessage: string;
lastMessageTime: number;
unreadCount: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Conversation 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 AS... | export interface Conversation {
id: string;
name: string;
avatar: string;
lastMessage: string;
lastMessageTime: number;
unreadCount: number;
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/services/MockDataService.ets#L50-L57 | 050d1baa4b181fe2038da93dace4dd6e6d3affbe | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.deviceInfo.d.ets | arkts | get | Obtaining the drive boot count.
if get failed, it will be -1
@syscap SystemCapability.Startup.SystemInfo
@since 22
@arkts 1.2 | static get bootCount(): int; | AST#method_declaration#Left static get AST#ERROR#Left bootCount 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 bootCount(): int; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.deviceInfo.d.ets#L496-L496 | 3b952ded597c149835c9f53f96db2dcb754c5584 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/navigation/src/main/ets/main/MainNavigator.ets | arkts | toMain | 跳转到主框架
@returns {void} 无返回值 | static toMain(): void {
navigateTo(MainRoutes.Main);
} | AST#method_declaration#Left static toMain AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#Left navigateTo ( AST#expression#Left AST#member_expres... | static toMain(): void {
navigateTo(MainRoutes.Main);
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/navigation/src/main/ets/main/MainNavigator.ets#L13-L15 | a5189024b4b5a5d1cf97df7f26bb156d9f6a7a7f | github |
waylau/harmonyos-tutorial | 74e23dfa769317f8f057cc77c2d09f0b1f2e0773 | samples/ArkUIExperience/entry/src/main/ets/common/constants/Constants.ets | arkts | 服务端相关常量 | export const Sever = {
PREFIX_URL: SEVER_PREFIX_URL,
WEB_PAGE_URL: SEVER_PREFIX_URL + '/web/image',
GET_NFT_URL: SEVER_PREFIX_URL + '/dac/get',
}; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left Sever = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left PREFIX_URL AST#property_name#Right : AST#expression#Left SEVER_PREFIX_URL AST#expression#Right AST#property_assign... | export const Sever = {
PREFIX_URL: SEVER_PREFIX_URL,
WEB_PAGE_URL: SEVER_PREFIX_URL + '/web/image',
GET_NFT_URL: SEVER_PREFIX_URL + '/dac/get',
}; | https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkUIExperience/entry/src/main/ets/common/constants/Constants.ets#L26-L30 | 232004449148b703faa164210e13e63343413c2d | gitee | |
LiuAnclouds/Harmony-ArkTS-App.git | 2119ce333927599b81a31081bc913e1416837308 | WeatherMind/entry/src/main/ets/pages/ChooseCity.ets | arkts | getCitiesByLetter | 根据字母获取城市列表 | private getCitiesByLetter(letter: string): CityWithInfo[] {
let cityGroups = this.groupCitiesByLetter();
return cityGroups.get(letter) || [];
} | AST#method_declaration#Left private getCitiesByLetter AST#parameter_list#Left ( AST#parameter#Left letter : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_typ... | private getCitiesByLetter(letter: string): CityWithInfo[] {
let cityGroups = this.groupCitiesByLetter();
return cityGroups.get(letter) || [];
} | https://github.com/LiuAnclouds/Harmony-ArkTS-App.git/blob/2119ce333927599b81a31081bc913e1416837308/WeatherMind/entry/src/main/ets/pages/ChooseCity.ets#L902-L905 | 34f50ff27a888f3ae3a8f32ef34cc9a7d36bb55b | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildEmojiDelete.ets | arkts | Emitted whenever a custom guild emoji is deleted.
@event Client#emojiDelete
@param {Emoji} emoji The emoji that was deleted
应用约束60:使用ES6 export代替module.exports | export default GuildEmojiDeleteAction; | AST#export_declaration#Left export default AST#expression#Left GuildEmojiDeleteAction AST#expression#Right ; AST#export_declaration#Right | export default GuildEmojiDeleteAction; | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildEmojiDelete.ets#L23-L23 | b0ccb1045c0ae2a31f105175fcbb5cc826e51be8 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/dynamicattributes/src/main/ets/view/ShoppingCart.ets | arkts | ShoppingCart | 实现步骤:
一、跨文件样式复用
1.提供方创建AttributeModifier接口的实现类。
2.使用方创建提供方的AttributeModifier实现类实例,并作为系统组件attributeModifier属性方法的参数传入
二、跨文件组件复用
1.提供方在公共组件库中创建公用的自定义组件,该组件支持外部传入attributeModifier属性。
2.使用方分别实现Image组件和Text组件的AttributeModifier接口实现类。
3.使用方创建Image组件和Text组件的AttributeModifier接口实现类实例,并作为提供方自定义组件CustomImageText的入参传入。 | @Component
export struct ShoppingCart {
private data: MyDataSource = new MyDataSource();
@Provide('navPathStack') navPathStack: NavPathStack = new NavPathStack();
aboutToAppear() {
for (let i = 1; i <= 20; i++) {
this.data.pushData(`商品 ${i}`);
}
}
@Builder
buildMap(name: string, param?: ESOb... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ShoppingCart AST#component_body#Left { AST#property_declaration#Left private data : AST#type_annotation#Left AST#primary_type#Left MyDataSource AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AS... | @Component
export struct ShoppingCart {
private data: MyDataSource = new MyDataSource();
@Provide('navPathStack') navPathStack: NavPathStack = new NavPathStack();
aboutToAppear() {
for (let i = 1; i <= 20; i++) {
this.data.pushData(`商品 ${i}`);
}
}
@Builder
buildMap(name: string, param?: ESOb... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/dynamicattributes/src/main/ets/view/ShoppingCart.ets#L38-L99 | 5fb370430ebfacfa1cabb38e58484a801575e6c7 | gitee |
weiwei0928/Eyepetizer-harmony.git | fd5947c6f616c22d42256f36ba752093b782a910 | entry/src/main/ets/common/ui/StateComponent.ets | arkts | holdContent | 占位组件 | @Builder
holdContent() {
Column() {
Image($r('app.media.ic_refresh_blue_24dp'))
.width("35vp")
.aspectRatio(1)
.rotate({ angle: 360 })
.animation({
duration: 1500,
iterations: -1,
curve: Curve.Smooth
})
}
.justifyContent(FlexAlign... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right holdContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_elem... | @Builder
holdContent() {
Column() {
Image($r('app.media.ic_refresh_blue_24dp'))
.width("35vp")
.aspectRatio(1)
.rotate({ angle: 360 })
.animation({
duration: 1500,
iterations: -1,
curve: Curve.Smooth
})
}
.justifyContent(FlexAlign... | https://github.com/weiwei0928/Eyepetizer-harmony.git/blob/fd5947c6f616c22d42256f36ba752093b782a910/entry/src/main/ets/common/ui/StateComponent.ets#L26-L45 | dae00ca84a54e25ba2493cf22cd2b55bc14cf811 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_core/src/main/ets/core/base/OutDTO.ets | arkts | OK | 成功-只包含消息
@param msg 提示消息
@returns | static OK(msg: string): OutDTO<string> {
let outDTO = new OutDTO<string>(true, msg, '', [], 200);
return outDTO;
} | AST#method_declaration#Left static OK AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST... | static OK(msg: string): OutDTO<string> {
let outDTO = new OutDTO<string>(true, msg, '', [], 200);
return outDTO;
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/base/OutDTO.ets#L65-L68 | 4e4d1beafb5e748f85ed3058d6fc7e63b8b4c1fe | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/user/src/main/ets/data/RegionData.ets | arkts | 地区数据工具 | export class RegionData {
/**
* 获取地区级联选项
* @returns {IBestCascaderOption[]} 地区选项
*/
static getRegionOptions(): IBestCascaderOption[] {
return REGION_OPTIONS;
}
/**
* 根据省市区名称匹配级联值路径
* @param {string} province - 省
* @param {string} city - 市
* @param {string} district - 区
* @returns {A... | AST#export_declaration#Left export AST#class_declaration#Left class RegionData AST#class_body#Left { /**
* 获取地区级联选项
* @returns {IBestCascaderOption[]} 地区选项
*/ AST#method_declaration#Left static getRegionOptions AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Lef... | export class RegionData {
static getRegionOptions(): IBestCascaderOption[] {
return REGION_OPTIONS;
}
static getRegionValuePath(province: string, city: string, district: string): Array<string> {
if (!province || !city || !district) {
return [];
}
const provinceNode = RegionData.findBy... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/data/RegionData.ets#L1349-L1397 | 5ba3843b79348e34864121302aa0540e213ac194 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/SimpleAIService.ets | arkts | getStyleText | 获取风格文本 | private getStyleText(style: GreetingStyle): string {
switch (style) {
case GreetingStyle.WARM:
return '温馨';
case GreetingStyle.FORMAL:
return '正式';
case GreetingStyle.HUMOROUS:
return '幽默';
case GreetingStyle.POETIC:
return '诗意';
case GreetingStyle.SIMPL... | AST#method_declaration#Left private getStyleText AST#parameter_list#Left ( AST#parameter#Left style : AST#type_annotation#Left AST#primary_type#Left GreetingStyle 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#p... | private getStyleText(style: GreetingStyle): string {
switch (style) {
case GreetingStyle.WARM:
return '温馨';
case GreetingStyle.FORMAL:
return '正式';
case GreetingStyle.HUMOROUS:
return '幽默';
case GreetingStyle.POETIC:
return '诗意';
case GreetingStyle.SIMPL... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/SimpleAIService.ets#L576-L591 | a747c2aba483e35dd9fcca3314c228ba5a74c91d | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkWeb/UseSameLayerRender/entry/src/main/ets/pages/PlayerDemo.ets | arkts | setSurfaceID | 用于区分模式是否支持seek操作。 | setSurfaceID(id: string){
console.log('setSurfaceID : ' + id);
this.surfaceId = id;
} | AST#method_declaration#Left setSurfaceID AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#L... | setSurfaceID(id: string){
console.log('setSurfaceID : ' + id);
this.surfaceId = id;
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkWeb/UseSameLayerRender/entry/src/main/ets/pages/PlayerDemo.ets#L25-L28 | 8a6c3d49f2376c81b9aa3c6e685f5a8863333aa4 | gitee |
Lateautumn00/HarmonyOS_WeChat.git | 88993b308d5018c11d4e6ddf7838a96c6384201c | entry/src/main/ets/pages/Chat.ets | arkts | getListOne | 列表的每一列 个人聊天 | @Builder getListOne(myCode:string,item:List){
Flex({justifyContent:FlexAlign.Start,alignItems:ItemAlign.Center,direction:myCode==item.code?FlexDirection.RowReverse:FlexDirection.Row}){
Image(item.image).width(50).height(50).borderRadius(50).margin({right:10,left:10})
.onClick(()=>{
router.pushUr... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right getListOne AST#parameter_list#Left ( AST#parameter#Left myCode : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left item : AST#type_annotation#Left AS... | @Builder getListOne(myCode:string,item:List){
Flex({justifyContent:FlexAlign.Start,alignItems:ItemAlign.Center,direction:myCode==item.code?FlexDirection.RowReverse:FlexDirection.Row}){
Image(item.image).width(50).height(50).borderRadius(50).margin({right:10,left:10})
.onClick(()=>{
router.pushUr... | https://github.com/Lateautumn00/HarmonyOS_WeChat.git/blob/88993b308d5018c11d4e6ddf7838a96c6384201c/entry/src/main/ets/pages/Chat.ets#L170-L188 | 34486886d0523b09e6d6b3a32b6f9e1a5a288947 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2Sync.ets | arkts | sign | 签名
@param str 需要签名的字符串
@param priKey 私钥
@param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式
@param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
@returns OutDTO<string> 签名对象 | static sign(str: string, priKey: string, keyCoding: buffer.BufferEncoding,
resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil.sign(str, priKey, 'SM2_256', 'SM2_256|SM3', 256, keyCoding, resultCoding, false);
} | AST#method_declaration#Left static sign AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right... | static sign(str: string, priKey: string, keyCoding: buffer.BufferEncoding,
resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil.sign(str, priKey, 'SM2_256', 'SM2_256|SM3', 256, keyCoding, resultCoding, false);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2Sync.ets#L71-L74 | cc45d81782da108c9a62441415ce27bfc499b081 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/core/network/HttpClient.ets | arkts | setDefaultHeaders | 设置默认请求头 | setDefaultHeaders(headers: Record<string, string>): void {
const merged: Record<string, string> = {};
Object.keys(this.defaultHeaders).forEach(key => {
merged[key] = this.defaultHeaders[key];
} | AST#method_declaration#Left setDefaultHeaders AST#parameter_list#Left ( AST#parameter#Left headers : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_ann... | setDefaultHeaders(headers: Record<string, string>): void {
const merged: Record<string, string> = {};
Object.keys(this.defaultHeaders).forEach(key => {
merged[key] = this.defaultHeaders[key];
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/core/network/HttpClient.ets#L74-L78 | a82c955fc730213ee309f9a6f37bc3b04d09e2e0 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/pendingitems/src/main/ets/pages/ToDoListItem.ets | arkts | 编辑状态 | build() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row({ space: STYLE_CONFIG.ICON_GUTTER }) {
if (!this.isEdited) {
Row() {
if (this.toDoItem.isFinished) {
Image($r('app.media.pendingitems_ic_public_ok_filled'))
... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Flex ( AST#component_parameters#Left { AST#component_parameter#Left justifyContent : AST#expression#Left AST#member_expression#Left AST#expression#Left FlexAlign AST#expression#Right ... | build() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row({ space: STYLE_CONFIG.ICON_GUTTER }) {
if (!this.isEdited) {
Row() {
if (this.toDoItem.isFinished) {
Image($r('app.media.pendingitems_ic_public_ok_filled'))
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pendingitems/src/main/ets/pages/ToDoListItem.ets#L26-L106 | 8d9622ce4546117a98ecab9286c5daf37b2184ef | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/greetings/GreetingSendPage.ets | arkts | getRelationLabel | 获取关系标签 | private getRelationLabel(relation: string): string {
const labels: Record<string, string> = {
'family': '家人',
'friend': '朋友',
'colleague': '同事',
'other': '其他'
};
return labels[relation] || '其他';
} | AST#method_declaration#Left private getRelationLabel AST#parameter_list#Left ( AST#parameter#Left relation : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#p... | private getRelationLabel(relation: string): string {
const labels: Record<string, string> = {
'family': '家人',
'friend': '朋友',
'colleague': '同事',
'other': '其他'
};
return labels[relation] || '其他';
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/greetings/GreetingSendPage.ets#L797-L805 | 8e33c4a40425f2f890445f8dbf8108cf0e21df80 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/VirtualEconomyService.ets | arkts | addCurrency | 添加货币 | async addCurrency(
currencyType: CurrencyType,
amount: number,
reason: string,
metadata: Record<string, any> = {}
): Promise<Transaction> {
try {
if (!this.userWallet || amount <= 0) {
throw new Error('Invalid wallet or amount');
}
const currentBalance = this.getCurren... | AST#method_declaration#Left async addCurrency AST#parameter_list#Left ( AST#parameter#Left currencyType : AST#type_annotation#Left AST#primary_type#Left CurrencyType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left amount : AST#type_annotation#Left AST#primary_type#Left number A... | async addCurrency(
currencyType: CurrencyType,
amount: number,
reason: string,
metadata: Record<string, any> = {}
): Promise<Transaction> {
try {
if (!this.userWallet || amount <= 0) {
throw new Error('Invalid wallet or amount');
}
const currentBalance = this.getCurren... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/VirtualEconomyService.ets#L267-L312 | 53fdc6b9069a9db9e6ad1219fb3b6b975dba49fa | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/calendar/CalendarApiService.ets | arkts | parseSojsonResponse | 解析SOJSON API响应 | private parseSojsonResponse(data: Record<string, string | boolean>): LunarDate {
// 解析农历字符串,如"二○二五年正月初一"
const lunarStr = (data.lunar as string) || '';
// 提取年月日信息
let year = 2025;
let month = 1;
let day = 1;
let monthText = '正月';
let dayText = '初一';
let isLeapMonth = false;
// ... | AST#method_declaration#Left private parseSojsonResponse AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#t... | private parseSojsonResponse(data: Record<string, string | boolean>): LunarDate {
const lunarStr = (data.lunar as string) || '';
let year = 2025;
let month = 1;
let day = 1;
let monthText = '正月';
let dayText = '初一';
let isLeapMonth = false;
const yearMatch = lunarStr.matc... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/calendar/CalendarApiService.ets#L214-L266 | 573a5c4fbd7c1c41b1a3c93ec50561b4e3ded1b7 | github |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/ECDSA.ets | arkts | verify | 对数据进行验签,异步
@param dataBlob 待验签数据
@param signDataBlob 签名数据
@param pubKey 公钥
@returns | static async verify(dataBlob: cryptoFramework.DataBlob, signDataBlob: cryptoFramework.DataBlob,
pubKey: cryptoFramework.PubKey): Promise<boolean> {
return CryptoUtil.verify(dataBlob, signDataBlob, pubKey, 'ECC256|SHA256');
} | AST#method_declaration#Left static async verify AST#parameter_list#Left ( AST#parameter#Left dataBlob : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left sig... | static async verify(dataBlob: cryptoFramework.DataBlob, signDataBlob: cryptoFramework.DataBlob,
pubKey: cryptoFramework.PubKey): Promise<boolean> {
return CryptoUtil.verify(dataBlob, signDataBlob, pubKey, 'ECC256|SHA256');
} | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/ECDSA.ets#L56-L59 | b87915e60059bae0d5c82540b1d6bf3b77c5a469 | github |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | examples/Overlay/entry/src/main/ets/pages/components/menu/menuLevel2.ets | arkts | MenuDemo | 菜单的wrapBuilder | @Builder
export function MenuDemo(params: MenuAttrOptions) {
MenuBuilder({ menuAttrOptions: { submenuMode: params.submenuMode } })
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function MenuDemo AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left MenuAttrOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#R... | @Builder
export function MenuDemo(params: MenuAttrOptions) {
MenuBuilder({ menuAttrOptions: { submenuMode: params.submenuMode } })
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Overlay/entry/src/main/ets/pages/components/menu/menuLevel2.ets#L28-L31 | 77a7be186caed57dac7e4259bf0f4c56a58f355a | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/FSize.ets | arkts | Class for describing width and height dimensions in some arbitrary | export default class FSize extends Poolable {
// TODO : Encapsulate width & height
public width: number;
public height: number;
public static pool: ObjectPool<FSize> = ObjectPool.create(256, new FSize(0, 0)).setReplenishPercentage(0.5);
instantiate(): Poolable {
return new FSize(0, 0);
}
public sta... | AST#export_declaration#Left export default AST#class_declaration#Left class FSize extends AST#type_annotation#Left AST#primary_type#Left Poolable AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { // TODO : Encapsulate width & height AST#property_declaration#Left public width : AST#type_annotation#L... | export default class FSize extends Poolable {
public width: number;
public height: number;
public static pool: ObjectPool<FSize> = ObjectPool.create(256, new FSize(0, 0)).setReplenishPercentage(0.5);
instantiate(): Poolable {
return new FSize(0, 0);
}
public static getInstance(width: number, heigh... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/FSize.ets#L21-L79 | 0c42a965a6fa8f51211c1a9e88ff403f7a1a116e | gitee | |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/search/LinearSearch.ets | arkts | findFirst | 查找第一个满足条件的元素
@param arr 数组
@param predicate 判断条件函数
@returns 第一个满足条件的元素索引,如果不存在则返回-1 | public static findFirst(arr: number[], predicate: (value: number) => boolean): number {
if (!arr || arr.length === 0) {
return -1;
}
for (let i = 0; i < arr.length; i++) {
if (predicate(arr[i])) {
return i;
}
}
return -1;
} | AST#method_declaration#Left public static findFirst AST#parameter_list#Left ( AST#parameter#Left arr : 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#Left predicate : AST#type_annotat... | public static findFirst(arr: number[], predicate: (value: number) => boolean): number {
if (!arr || arr.length === 0) {
return -1;
}
for (let i = 0; i < arr.length; i++) {
if (predicate(arr[i])) {
return i;
}
}
return -1;
} | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/search/LinearSearch.ets#L52-L64 | 0bf9d7f825987d6c84106e23a4f0dc6328d376ff | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/common/types/GreetingTypes.ets | arkts | 祝福方式枚举 | export enum GreetingMethod {
COPY = 'copy', // 复制
SHARE = 'share', // 分享
MESSAGE = 'message', // 短信
WECHAT = 'wechat', // 微信
EMAIL = 'email', // 邮件
CALL = 'call' // 电话
} | AST#export_declaration#Left export AST#enum_declaration#Left enum GreetingMethod AST#enum_body#Left { AST#enum_member#Left COPY = AST#expression#Left 'copy' AST#expression#Right AST#enum_member#Right , // 复制 AST#enum_member#Left SHARE = AST#expression#Left 'share' AST#expression#Right AST#enum_member#Right , // 分享 AST#... | export enum GreetingMethod {
COPY = 'copy',
SHARE = 'share',
MESSAGE = 'message',
WECHAT = 'wechat',
EMAIL = 'email',
CALL = 'call'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/GreetingTypes.ets#L173-L180 | 36fc1bc39b17b7ec87edb7e69a985c63c115113d | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/viewmodel/OrderConfirmViewModel.ets | arkts | deleteCartItems | 删除购物车中已下单的商品
@returns {Promise<void>} Promise<void> | async deleteCartItems(): Promise<void> {
if (!this.cachedCarts || this.cachedCarts.length === 0) {
return;
}
for (const cart of this.cachedCarts) {
const goodsId = cart.goodsId;
// 获取该商品所有的规格ID
const specIds = new Set(cart.spec.map((s: CartGoodsSpec): number => s.id));
// 判断... | AST#method_declaration#Left async deleteCartItems 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_... | async deleteCartItems(): Promise<void> {
if (!this.cachedCarts || this.cachedCarts.length === 0) {
return;
}
for (const cart of this.cachedCarts) {
const goodsId = cart.goodsId;
const specIds = new Set(cart.spec.map((s: CartGoodsSpec): number => s.id));
const fullCar... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/viewmodel/OrderConfirmViewModel.ets#L352-L381 | 0c49c339b64c1902ec3dc7ad779b92e05e2ecddb | github |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | ETSUI/LoginSample/entry/src/main/ets/view/PrivacyStatementComponent.ets | arkts | PrivacyStatementComponent | Component of privacy statement and help. | @Component
export struct PrivacyStatementComponent {
build() {
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.Center
}) {
Text($r('app.string.problem_encountered'))
.fontSize($r('app.float.statement_text_size'))
.fontColor($r('app.color.problem_encountered_fon... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct PrivacyStatementComponent AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Flex ( AST#component_paramet... | @Component
export struct PrivacyStatementComponent {
build() {
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.Center
}) {
Text($r('app.string.problem_encountered'))
.fontSize($r('app.float.statement_text_size'))
.fontColor($r('app.color.problem_encountered_fon... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/LoginSample/entry/src/main/ets/view/PrivacyStatementComponent.ets#L7-L40 | 3053070f9241702faccb37b2a549d04a01cbf5cb | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/AES.ets | arkts | decodeCBC128 | 解密-CBC模式-128位
@param str 加密的字符串
@param aesKey AES密钥
@param iv iv偏移量字符串
@returns | static async decodeCBC128(str: string, aesKey: string, iv: string): Promise<string> {
return CryptoUtil.decodeCBC(str, aesKey, iv, 'AES128', 'AES128|CBC|PKCS7', 128);
} | AST#method_declaration#Left static async decodeCBC128 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left aesKey : AST#type_annotation#Left AST#primary_type#Left string AST#prim... | static async decodeCBC128(str: string, aesKey: string, iv: string): Promise<string> {
return CryptoUtil.decodeCBC(str, aesKey, iv, 'AES128', 'AES128|CBC|PKCS7', 128);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/AES.ets#L191-L193 | 539e94be0d7887e548d58dd5473782e7721a004b | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | buildCategoryTag | 分类标签 | @Builder
buildCategoryTag(label: string, value: string) {
Text(label)
.fontSize(14)
.fontColor(this.selectedGreetingCategory === value ? this.COLORS.whitePrimary : this.COLORS.textSecondary)
.padding({ left: 16, right: 16, top: 8, bottom: 8 })
.margin({ right: 8, bottom: 8 })
.backgr... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCategoryTag AST#parameter_list#Left ( AST#parameter#Left label : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left value : AST#type_annotation#L... | @Builder
buildCategoryTag(label: string, value: string) {
Text(label)
.fontSize(14)
.fontColor(this.selectedGreetingCategory === value ? this.COLORS.whitePrimary : this.COLORS.textSecondary)
.padding({ left: 16, right: 16, top: 8, bottom: 8 })
.margin({ right: 8, bottom: 8 })
.backgr... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L3115-L3127 | ae995738c3016a8d44009bf3fd9218db79fd3596 | github |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/viewmodel/StatsManager.ets | arkts | recordPomodoroSession | 记录番茄钟会话 | async recordPomodoroSession(focusMinutes: number = 25): Promise<void> {
const today = DateUtils.getTodayKey();
if (!this.stats.dailyStats[today]) {
this.stats.dailyStats[today] = {
tasksCompleted: 0,
tasksTotal: 0,
focusTime: 0,
pomodoroSessions: 0,
achievements: [... | AST#method_declaration#Left async recordPomodoroSession AST#parameter_list#Left ( AST#parameter#Left focusMinutes : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 25 AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#ty... | async recordPomodoroSession(focusMinutes: number = 25): Promise<void> {
const today = DateUtils.getTodayKey();
if (!this.stats.dailyStats[today]) {
this.stats.dailyStats[today] = {
tasksCompleted: 0,
tasksTotal: 0,
focusTime: 0,
pomodoroSessions: 0,
achievements: [... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/StatsManager.ets#L231-L251 | 2088f146bf835241559f27c86c766368d446b73d | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | TaskPoolPractice/entry/src/main/ets/pages/sample7/Interceptor.ets | arkts | ResponseInterceptor | Response interceptor encapsulated as sendable | @Sendable
export class ResponseInterceptor implements IResponseInterceptor {
handle(data: AxiosResponse<object, object>): AxiosResponse<object, object> |
Promise<AxiosResponse<object, object>> {
return data;
}
handleError(error: object): object {
return error;
}
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Sendable AST#decorator#Right export class ResponseInterceptor AST#implements_clause#Left implements IResponseInterceptor AST#implements_clause#Right AST#class_body#Left { AST#method_declaration#Left handle AST#parameter_list#Left ( AST#parameter#Left data : AST... | @Sendable
export class ResponseInterceptor implements IResponseInterceptor {
handle(data: AxiosResponse<object, object>): AxiosResponse<object, object> |
Promise<AxiosResponse<object, object>> {
return data;
}
handleError(error: object): object {
return error;
}
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/TaskPoolPractice/entry/src/main/ets/pages/sample7/Interceptor.ets#L33-L42 | c9cb731a148de741e011c94739d5bad79567f99a | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/storage/DatabaseService.ets | arkts | delete | 删除数据
@param tableName 表名
@param whereClause 条件子句
@param whereArgs 条件参数
@returns 受影响的行数 | async delete(tableName: string, whereClause?: string, whereArgs?: Array<string>): Promise<number> {
try {
this.checkInitialized();
const predicates = new relationalStore.RdbPredicates(tableName);
if (whereClause && whereArgs) {
// Parse simple where clauses - this is a simplified im... | AST#method_declaration#Left async delete AST#parameter_list#Left ( AST#parameter#Left tableName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left whereClause ? : AST#type_annotation#Left AST#primary_type#Left string AST#prim... | async delete(tableName: string, whereClause?: string, whereArgs?: Array<string>): Promise<number> {
try {
this.checkInitialized();
const predicates = new relationalStore.RdbPredicates(tableName);
if (whereClause && whereArgs) {
if (whereClause.includes('=') && whereArgs.len... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/storage/DatabaseService.ets#L297-L321 | 3a7934ef5c63206f5fd2095d5ef33a6b665be98d | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/foldablescreencases/src/main/ets/viewmodel/MusicPlayViewModel.ets | arkts | genTimeStr | 生成时间字符串
@param timeMs 毫秒数
@returns {string} 时:分:秒 规格的字符串 | genTimeStr(timeMs: number): string {
const totalTime = timeMs / 1000;
const hours = Math.floor(totalTime / CommonConstants.SECONDS_IN_HOUR);
const leftTime = totalTime % CommonConstants.SECONDS_IN_HOUR;
const minutes = Math.floor(leftTime / CommonConstants.SECONDS_IN_MINUTE);
const seconds = Math.fl... | AST#method_declaration#Left genTimeStr AST#parameter_list#Left ( AST#parameter#Left timeMs : 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#Righ... | genTimeStr(timeMs: number): string {
const totalTime = timeMs / 1000;
const hours = Math.floor(totalTime / CommonConstants.SECONDS_IN_HOUR);
const leftTime = totalTime % CommonConstants.SECONDS_IN_HOUR;
const minutes = Math.floor(leftTime / CommonConstants.SECONDS_IN_MINUTE);
const seconds = Math.fl... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/foldablescreencases/src/main/ets/viewmodel/MusicPlayViewModel.ets#L278-L309 | 147973cf7014ab5b9bb01430ae74cc4cefbbd53d | gitee |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/viewmodels/ReviewViewModel.ets | arkts | calculateTotalTime | 计算总时长(小时) | static calculateTotalTime(): string {
const totalSeconds = AppState.completedTasks.reduce((sum, task) =>
sum + (task.actualTime || 0), 0);
const result = (totalSeconds / 3600).toFixed(1);
console.info('calculateTotalTime: totalSeconds=' + totalSeconds + ', result=' + result);
return result;
} | AST#method_declaration#Left static calculateTotalTime 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#Le... | static calculateTotalTime(): string {
const totalSeconds = AppState.completedTasks.reduce((sum, task) =>
sum + (task.actualTime || 0), 0);
const result = (totalSeconds / 3600).toFixed(1);
console.info('calculateTotalTime: totalSeconds=' + totalSeconds + ', result=' + result);
return result;
} | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/viewmodels/ReviewViewModel.ets#L19-L25 | c4766cc5f8e151b2c7edd53fc2cfa7e7a2c1bf05 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/CommonTypes.ets | arkts | 通知方式枚举 | export enum NotificationMethod {
PUSH = 'push',
SMS = 'sms',
EMAIL = 'email',
WECHAT = 'wechat'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum NotificationMethod AST#enum_body#Left { AST#enum_member#Left PUSH = AST#expression#Left 'push' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left SMS = AST#expression#Left 'sms' AST#expression#Right AST#enum_member#Right , AST#enum_member#... | export enum NotificationMethod {
PUSH = 'push',
SMS = 'sms',
EMAIL = 'email',
WECHAT = 'wechat'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/CommonTypes.ets#L267-L272 | ea63ca7e66117be661752aadac43cc647a4a0cef | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/ListDataSource.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 ListDataSource implements IDataSource {
private list: number[] = [];
private listeners: DataChangeListener[] = [];
constructor(list: number[]) {
this.list = list;
}
totalCount(): number {
return this.list.length;
}
getData(index: number): number {
return this.list[index];
}
... | AST#export_declaration#Left export AST#class_declaration#Left class ListDataSource AST#implements_clause#Left implements IDataSource AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left private list : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type... | export class ListDataSource implements IDataSource {
private list: number[] = [];
private listeners: DataChangeListener[] = [];
constructor(list: number[]) {
this.list = list;
}
totalCount(): number {
return this.list.length;
}
getData(index: number): number {
return this.list[index];
}
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/ListDataSource.ets#L16-L57 | 224b1adfe46ae400d5f8d2b5afc050aa19de0fe5 | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/networks/HttpUtils.ets | arkts | 定义HTTP相关的枚举和常量 | export namespace HttpUtils {
// 1. 定义严格参数类型 - 避免any/unknown
export type HttpParamValue = string | number | boolean | Object; | AST#export_declaration#Left export AST#ERROR#Left namespace HttpUtils { // 1. 定义严格参数类型 - 避免any/unknown export AST#ERROR#Right AST#type_declaration#Left type HttpParamValue = AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#R... | export namespace HttpUtils {
export type HttpParamValue = string | number | boolean | Object; | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/networks/HttpUtils.ets#L5-L9 | 6a2c414a58d3c2118dadf05c5d0a7829b8f74a4c | github | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/CanvasComponent/entry/src/main/ets/pages/CanvasPage.ets | arkts | startAnimator | Start animator. | startAnimator() {
let randomAngle = Math.round(Math.random() * CommonConstants.CIRCLE);
// Obtaining prize information.
this.prizeData = this.drawModel.showPrizeData(randomAngle);
animateTo({
duration: CommonConstants.DURATION,
curve: Curve.Ease,
delay: 0,
iterations: 1,
p... | AST#method_declaration#Left startAnimator AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left randomAngle = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expres... | startAnimator() {
let randomAngle = Math.round(Math.random() * CommonConstants.CIRCLE);
this.prizeData = this.drawModel.showPrizeData(randomAngle);
animateTo({
duration: CommonConstants.DURATION,
curve: Curve.Ease,
delay: 0,
iterations: 1,
playMode: PlayMode.Normal,
... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/CanvasComponent/entry/src/main/ets/pages/CanvasPage.ets#L97-L117 | fe3245acf1488d019749bb48b86aa57298a95caa | gitee |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/models/TaskModel.ets | arkts | 全局状态管理类 | export class AppState {
// P2 任务列表
static tasks: TaskItem[] = [];
// P3 历史记录
static completedTasks: TaskItem[] = [];
// P1 -> P2 联动数据
static currentTask: TaskItem | null = null;
static activeTimerValue: number = 0; // 当前正在运行的计时器值
// 初始化数据(从持久化存储加载)
static async loadData(context: Context): Promi... | AST#export_declaration#Left export AST#class_declaration#Left class AppState AST#class_body#Left { // P2 任务列表 AST#property_declaration#Left static tasks : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TaskItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expressio... | export class AppState {
static tasks: TaskItem[] = [];
static completedTasks: TaskItem[] = [];
static currentTask: TaskItem | null = null;
static activeTimerValue: number = 0;
static async loadData(context: Context): Promise<void> {
await DataStorage.init(context);
AppState.tasks =... | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/models/TaskModel.ets#L118-L141 | d19e3db38c359ac28814007934cfa3e4b4eb7491 | github | |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/pages/TaskReviewView.ets | arkts | closeRemarkDialog | 关闭备注编辑对话框 | closeRemarkDialog() {
this.remarkDialogController.close();
this.selectedFlaw = null;
this.editingRemark = '';
} | AST#method_declaration#Left closeRemarkDialog AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left... | closeRemarkDialog() {
this.remarkDialogController.close();
this.selectedFlaw = null;
this.editingRemark = '';
} | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/pages/TaskReviewView.ets#L286-L290 | 0eaef51ea1fef8a7ce72e604bca4421684737148 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/SHA.ets | arkts | @Author csx
@DateTime 2024/3/20 21:43
@TODO SHA
@Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_crypto | export class SHA {
/**
* SHA1摘要
* @param str 带摘要的字符串
* @returns 摘要后的字符串
*/
static async digestSHA1(str: string): Promise<string> {
return CryptoUtil.digest(str, 'SHA1');
}
/**
* SHA224摘要
* @param str 带摘要的字符串
* @returns 摘要后的字符串
*/
static async digestSHA224(str: string): Promise<str... | AST#export_declaration#Left export AST#class_declaration#Left class SHA AST#class_body#Left { /**
* SHA1摘要
* @param str 带摘要的字符串
* @returns 摘要后的字符串
*/ AST#method_declaration#Left static async digestSHA1 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string A... | export class SHA {
static async digestSHA1(str: string): Promise<string> {
return CryptoUtil.digest(str, 'SHA1');
}
static async digestSHA224(str: string): Promise<string> {
return CryptoUtil.digest(str, 'SHA224');
}
static async digest(str: string): Promise<string> {
return CryptoUtil.... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/SHA.ets#L26-L80 | 50bc6c8a866b2ff05691dd27157fd12375f9f005 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/auth/src/main/ets/view/LoginPage.ets | arkts | LoginContent | 登录页面内容视图
@returns {void} 无返回值 | @Builder
private LoginContent(): void {
LargePaddingVerticalScroll({ fillMaxSize: true }) {
Column() {
LogoIcon({ iconSize: 120 });
SpaceVerticalLarge();
Blank().layoutWeight(1);
this.buildActionSection();
}
.constraintSize({ minHeight: P100 });
}
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private LoginContent AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_... | @Builder
private LoginContent(): void {
LargePaddingVerticalScroll({ fillMaxSize: true }) {
Column() {
LogoIcon({ iconSize: 120 });
SpaceVerticalLarge();
Blank().layoutWeight(1);
this.buildActionSection();
}
.constraintSize({ minHeight: P100 });
}
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/auth/src/main/ets/view/LoginPage.ets#L50-L61 | 48bfbe89c637dbd736abbce7abdf758cd140826b | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/PixelMapUtils.ets | arkts | savePixelMapDirect | 使用packToFile直接保存PixelMap(高效,无内存中转) | static async savePixelMapDirect(
pixelMap: image.PixelMap,
filePath: string,
format: string = 'image/jpeg',
quality: number = 90
): Promise<string> {
if (!pixelMap) {
throw new Error('PixelMap不能为空');
}
let file: fs.File | null = null; // 文件对象
try {
// 确保目录存在
const d... | AST#method_declaration#Left static async savePixelMapDirect AST#parameter_list#Left ( AST#parameter#Left pixelMap : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left f... | static async savePixelMapDirect(
pixelMap: image.PixelMap,
filePath: string,
format: string = 'image/jpeg',
quality: number = 90
): Promise<string> {
if (!pixelMap) {
throw new Error('PixelMap不能为空');
}
let file: fs.File | null = null;
try {
const dirPath = filePat... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/PixelMapUtils.ets#L67-L123 | fe21507e4d5b6623ef178e2655fedacdf1a4d1bc | github |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/pages/LoginPage.ets | arkts | TODO | build() {
Stack({ alignContent: Alignment.Top }) {
Column() {
Image($r('app.media.ic_logo'))
.width($r('app.float.logo_image_size'))
.height($r('app.float.logo_image_size'))
.margin({
top: $r('app.float.logo_margin_top'),
bottom: $r('app.float.logo... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Stack ( AST#component_parameters#Left { AST#component_parameter#Left alignContent : AST#expression#Left AST#member_expression#Left AST#expression#Left Alignment AST#expression#Right .... | build() {
Stack({ alignContent: Alignment.Top }) {
Column() {
Image($r('app.media.ic_logo'))
.width($r('app.float.logo_image_size'))
.height($r('app.float.logo_image_size'))
.margin({
top: $r('app.float.logo_margin_top'),
bottom: $r('app.float.logo... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/pages/LoginPage.ets#L13-L111 | d3f0727eeb426cef9a05ad9782514164a79704bd | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/user/User.ets | arkts | /用于Http表示后收到的json转换对象 | export interface UserJson {
user_id?: number | null
user_name?: string | null
email?: string | null
password?: string | null
login_type?: string | null
login_identifier?: string | null
login_time?: string | null // Date 用 string 表示
create_time?: string | null
image_addr?: string | null
device... | AST#export_declaration#Left export AST#interface_declaration#Left interface UserJson AST#object_type#Left { AST#type_member#Left user_id ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_... | export interface UserJson {
user_id?: number | null
user_name?: string | null
email?: string | null
password?: string | null
login_type?: string | null
login_identifier?: string | null
login_time?: string | null
create_time?: string | null
image_addr?: string | null
device_type?: string | nu... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/user/User.ets#L51-L63 | e6206b9acb95cdf7556c6e4b3456c181a69bbbcb | github | |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/search/BinarySearch.ets | arkts | findFirstGreaterOrEqual | 查找第一个大于等于目标值的元素
@param arr 已排序的数组
@param target 目标值
@returns 第一个大于等于目标值的元素索引,如果不存在则返回-1 | public static findFirstGreaterOrEqual(arr: number[], target: number): number {
if (!arr || arr.length === 0) {
return -1;
}
let left = 0;
let right = arr.length - 1;
let result = -1;
while (left <= right) {
const mid = Math.floor((left + right) / 2);
if (arr[mid] >= ta... | AST#method_declaration#Left public static findFirstGreaterOrEqual AST#parameter_list#Left ( AST#parameter#Left arr : 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#Left target : AST#t... | public static findFirstGreaterOrEqual(arr: number[], target: number): number {
if (!arr || arr.length === 0) {
return -1;
}
let left = 0;
let right = arr.length - 1;
let result = -1;
while (left <= right) {
const mid = Math.floor((left + right) / 2);
if (arr[mid] >= ta... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/search/BinarySearch.ets#L102-L123 | e917852d6100283011ee59001158b7968499aa58 | github |
ccccjiemo/egl.git | d18849c3da975ccf9373fd09874aa5637ccbe6bd | Index.d.ets | arkts | createSync | eglCreateSync | createSync(type: EGLSyncType, attrib_list?: number[]): EGLSync | undefined; | AST#method_declaration#Left createSync AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left EGLSyncType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left attrib_list ? : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Le... | createSync(type: EGLSyncType, attrib_list?: number[]): EGLSync | undefined; | https://github.com/ccccjiemo/egl.git/blob/d18849c3da975ccf9373fd09874aa5637ccbe6bd/Index.d.ets#L196-L196 | bb248e6084511ffb8b0aa7f9666a544ad264560a | github |
azhuge233/Wake-HarmonyOS.git | 68c4e961f9cf5fab8699af99313dd5854ea313a1 | entry/src/main/ets/common/utils/CommonUtils.ets | arkts | sleep | Debug 等待 time 秒 | public async sleep(time: number): Promise<void> {
await new Promise<void>(resolve => setTimeout(resolve, time));
} | AST#method_declaration#Left public async sleep AST#parameter_list#Left ( AST#parameter#Left time : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ... | public async sleep(time: number): Promise<void> {
await new Promise<void>(resolve => setTimeout(resolve, time));
} | https://github.com/azhuge233/Wake-HarmonyOS.git/blob/68c4e961f9cf5fab8699af99313dd5854ea313a1/entry/src/main/ets/common/utils/CommonUtils.ets#L20-L22 | 7610165d2de34eee075a9a8d5f9167f66a9835f1 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Sounds/Player/AudioTool.ets | arkts | 音频工具类 - 处理音频数据转换和播放
功能:将 Uint8Array 格式的音频数据转换为可播放格式 | export class AudioTool {
// 1. 显式声明配置类型
static readonly Configs: AudioToolConfig = {
IsNotPlayingIndex: -1,
TmpFmt: (idxx: number) => `${idxx}_01.mp3`
};
/**
* 创建播放器并播放 Uint8Array 音频数据
* @param data Uint8Array 格式的音频数据
* @param idxx 音频唯一标识符
* @returns 播放器实例
*/
static async createAudio... | AST#export_declaration#Left export AST#class_declaration#Left class AudioTool AST#class_body#Left { // 1. 显式声明配置类型 AST#property_declaration#Left static readonly Configs : AST#type_annotation#Left AST#primary_type#Left AudioToolConfig AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_lite... | export class AudioTool {
static readonly Configs: AudioToolConfig = {
IsNotPlayingIndex: -1,
TmpFmt: (idxx: number) => `${idxx}_01.mp3`
};
static async createAudioPlayer(data: Uint8Array, idxx: number, onStateChange: (state: string) =>void): Promise<media.AVPlayer | null> {
try {
const... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Player/AudioTool.ets#L23-L176 | fcbf5347733b78efc13717dd65a45868e275d3f3 | github | |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/view/SpotlightGuide.ets | arkts | nextStep | 下一步 | private nextStep(): void {
if (this.currentStepIndex < this.steps.length - 1) {
this.getUIContext().animateTo({
duration: 200,
curve: Curve.EaseOut
}, () => {
this.tooltipOpacity = 0;
});
setTimeout(() => {
this.currentStepIndex++;
this.getUIContext()... | AST#method_declaration#Left private nextStep AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left... | private nextStep(): void {
if (this.currentStepIndex < this.steps.length - 1) {
this.getUIContext().animateTo({
duration: 200,
curve: Curve.EaseOut
}, () => {
this.tooltipOpacity = 0;
});
setTimeout(() => {
this.currentStepIndex++;
this.getUIContext()... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/view/SpotlightGuide.ets#L222-L243 | bcff2521c27137dbe2cadb94faa88eca554b9aa0 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/InteractiveGameService.ets | arkts | 游戏难度枚举 | export enum GameDifficulty {
EASY = 'easy',
MEDIUM = 'medium',
HARD = 'hard',
EXPERT = 'expert'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum GameDifficulty AST#enum_body#Left { AST#enum_member#Left EASY = AST#expression#Left 'easy' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left MEDIUM = AST#expression#Left 'medium' AST#expression#Right AST#enum_member#Right , AST#enum_membe... | export enum GameDifficulty {
EASY = 'easy',
MEDIUM = 'medium',
HARD = 'hard',
EXPERT = 'expert'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/InteractiveGameService.ets#L30-L35 | 2b970fb2942a9821e726533d02d32764f9fd18a0 | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets | arkts | genIvParamsSpec | 根据传入的iv字符串转换iv对象
@param ivStr
@returns | static genIvParamsSpec(ivStr: string, keyName: number): crypto.IvParamsSpec {
let ivBlob: crypto.DataBlob = { data: StrAndUintUtil.stringToByteArray(ivStr, keyName) };
let ivParamsSpec: crypto.IvParamsSpec = {
algName: "IvParamsSpec",
iv: ivBlob
};
return ivParamsSpec;
} | AST#method_declaration#Left static genIvParamsSpec AST#parameter_list#Left ( AST#parameter#Left ivStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left keyName : AST#type_annotation#Left AST#primary_type#Left number AST#prim... | static genIvParamsSpec(ivStr: string, keyName: number): crypto.IvParamsSpec {
let ivBlob: crypto.DataBlob = { data: StrAndUintUtil.stringToByteArray(ivStr, keyName) };
let ivParamsSpec: crypto.IvParamsSpec = {
algName: "IvParamsSpec",
iv: ivBlob
};
return ivParamsSpec;
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets#L74-L81 | 940d35c1c3d91ef8cb6123128bb006c234bcf072 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/SimpleDownloader/SimpleDownloader.ets | arkts | deleteDownload | 删除下载任务
@param {request.DownloadTask} downloadTask - 要删除的下载任务实例
@returns {Promise<boolean>} 删除操作结果的Promise,true表示成功
@throws {BusinessError} 删除失败时抛出错误 | async deleteDownload(downloadTask: request.DownloadTask): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
downloadTask.delete((error: BusinessError, result: boolean) => {
if (error) {
reject(error);
} else {
resolve(result);
}
});
});... | AST#method_declaration#Left async deleteDownload AST#parameter_list#Left ( AST#parameter#Left downloadTask : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left request . DownloadTask AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Ri... | async deleteDownload(downloadTask: request.DownloadTask): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
downloadTask.delete((error: BusinessError, result: boolean) => {
if (error) {
reject(error);
} else {
resolve(result);
}
});
});... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/SimpleDownloader/SimpleDownloader.ets#L130-L140 | fcb4b4969f6a57b63a221a423694c3d24e7f54dd | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/components/common/EmptyView.ets | arkts | EmptyView | 通用空状态视图组件
用于展示无数据或空状态 | @Component
export struct EmptyView {
@Prop message: string = '暂无数据';
@Prop description: string = '';
@Prop icon: Resource | null = null;
@Prop showAction: boolean = false;
@Prop actionText: string = '刷新';
@Prop textColorStr: string = '#999999';
@Prop backgroundColorStr: string = 'transparent';
onActi... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct EmptyView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right message : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotatio... | @Component
export struct EmptyView {
@Prop message: string = '暂无数据';
@Prop description: string = '';
@Prop icon: Resource | null = null;
@Prop showAction: boolean = false;
@Prop actionText: string = '刷新';
@Prop textColorStr: string = '#999999';
@Prop backgroundColorStr: string = 'transparent';
onActi... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/components/common/EmptyView.ets#L6-L76 | 780d59fe0e0070b011d5128f8e79bc640cb97285 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/utils/Helper.ets | arkts | getNumber | 获取指定资源对应的integer数值或者float数值
@param res
@returns | static getNumber(res: Resource): number {
return Helper.getResourceManager().getNumber(res);
} | AST#method_declaration#Left static getNumber AST#parameter_list#Left ( AST#parameter#Left res : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type... | static getNumber(res: Resource): number {
return Helper.getResourceManager().getNumber(res);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/utils/Helper.ets#L114-L116 | 82ffd4089fe55a1af0bb70bdad01a38c57baa4bf | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_defaults.ets | arkts | Obtains the default window_decor_height.
@returns A number, in vp. | export function default_window_decor_height(windowStorage: LocalStorage): number {
if (windowStorage.get('fullscreen_mode') as boolean) {
return 58;
}
let tablet_mode = windowStorage.get('tablet_mode') as boolean;
if (tablet_mode) {
return (AppStorage.get('showing_my_window_alias') as boolean) ? 45 : 37... | AST#export_declaration#Left export AST#function_declaration#Left function default_window_decor_height AST#parameter_list#Left ( AST#parameter#Left windowStorage : AST#type_annotation#Left AST#primary_type#Left LocalStorage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right :... | export function default_window_decor_height(windowStorage: LocalStorage): number {
if (windowStorage.get('fullscreen_mode') as boolean) {
return 58;
}
let tablet_mode = windowStorage.get('tablet_mode') as boolean;
if (tablet_mode) {
return (AppStorage.get('showing_my_window_alias') as boolean) ? 45 : 37... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_defaults.ets#L147-L157 | 8b5e53cd3b98164bdd10a3597585b822dd929110 | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Vibrator/Vibrator.ets | arkts | // 使用示例: // 1. 短振动(默认100ms) AppVibrator.shared.vibrate(); // 2. 长振动(1000ms) AppVibrator.shared.vibrate(1000); // 3. 使用系统预设效果 AppVibrator.shared.vibratePreset(); /震动 | export function vibrate(){
Vibrator.shared.vibrate()
} | AST#export_declaration#Left export AST#function_declaration#Left function vibrate AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Le... | export function vibrate(){
Vibrator.shared.vibrate()
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Vibrator/Vibrator.ets#L77-L79 | 91b6c6f848bca7d92417c7af0fd8d86adeef3d41 | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/model/src/main/ets/entity/UserContributor.ets | arkts | @file 用户贡献者实体类
@author Joker.X | export class UserContributor {
/**
* ID
*/
id: number = 0;
/**
* 头像
*/
avatarUrl: string = "";
/**
* 昵称
*/
nickName: string = "";
/**
* 网站地址(GitHub/Gitee/个人博客)
*/
websiteUrl?: string | null = null;
/**
* 个性签名/个人描述
*/
signature?: string | null = null;
/**
* 个人标签
... | AST#export_declaration#Left export AST#class_declaration#Left class UserContributor AST#class_body#Left { /**
* ID
*/ AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#propert... | export class UserContributor {
id: number = 0;
avatarUrl: string = "";
nickName: string = "";
websiteUrl?: string | null = null;
signature?: string | null = null;
tags?: string[] | null = null;
sortNum: number = 0;
status: number = 1;
createTime?: string | null = null;
... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/UserContributor.ets#L5-L62 | b916224b2c7cb92a05e7baba7feb9469fbf94c71 | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/WindowUtil.ets | arkts | getPreferredOrientation | 获取窗口的显示方向属性,主窗口调用。
@param windowClass 不传该值,默认主窗口。
@returns | static getPreferredOrientation(windowClass: window.Window = AppUtil.getMainWindow()): window.Orientation {
return windowClass.getPreferredOrientation();
} | AST#method_declaration#Left static getPreferredOrientation AST#parameter_list#Left ( AST#parameter#Left windowClass : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression... | static getPreferredOrientation(windowClass: window.Window = AppUtil.getMainWindow()): window.Orientation {
return windowClass.getPreferredOrientation();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/WindowUtil.ets#L58-L60 | 21e33f5197c92021806571bf9a6d19e0c9a558f5 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/viewmodel/OrderDetailViewModel.ets | arkts | showCancelModal | 显示取消原因选择弹窗
@returns {void} 无返回值 | showCancelModal(): void {
this.cancelModalVisible = true;
this.loadCancelReasons();
} | AST#method_declaration#Left showCancelModal AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#me... | showCancelModal(): void {
this.cancelModalVisible = true;
this.loadCancelReasons();
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/viewmodel/OrderDetailViewModel.ets#L205-L208 | dca04e7e183bfd788f6f85e5ce7d6c5de1431970 | github |
robotzzh/AgricultureApp.git | 7b12c588dd1d07cc07a8b25577d785d30bd838f6 | entry/src/main/ets/DB/relationDB.ets | arkts | updateDatas | 对数据进行修改 | async updateDatas(tableName: string, valueBucket, key, val) {
let predicates = new relationalStore.RdbPredicates(tableName); // 创建表tableName的predicates
predicates.equalTo(key, val); // 匹配表tableName中key为val的字段
if (store != undefined) {
(store as relationalStore.RdbStore).update(valueBucket, predicates,... | AST#method_declaration#Left async updateDatas AST#parameter_list#Left ( AST#parameter#Left tableName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left valueBucket AST#parameter#Right , AST#parameter#Left key AST#parameter#Ri... | async updateDatas(tableName: string, valueBucket, key, val) {
let predicates = new relationalStore.RdbPredicates(tableName);
predicates.equalTo(key, val);
if (store != undefined) {
(store as relationalStore.RdbStore).update(valueBucket, predicates, (err, rowId: number) => {
if (err) {
... | https://github.com/robotzzh/AgricultureApp.git/blob/7b12c588dd1d07cc07a8b25577d785d30bd838f6/entry/src/main/ets/DB/relationDB.ets#L63-L75 | 8491d1d923170585328c86a90e64c36c04c3d523 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.