nwo stringclasses 304
values | sha stringclasses 304
values | path stringlengths 9 214 | language stringclasses 1
value | identifier stringlengths 0 49 | docstring stringlengths 1 34.2k | function stringlengths 8 59.4k | ast_function stringlengths 71 497k | obf_function stringlengths 8 39.4k | url stringlengths 102 324 | function_sha stringlengths 40 40 | source stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/diggingholescreen/Index.ets | arkts | DiggingHoleScreenComponent | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export { DiggingHoleScreenComponent } from './src/main/ets/components/mainpage/DiggingHoleScreen'; | AST#export_declaration#Left export { DiggingHoleScreenComponent } from './src/main/ets/components/mainpage/DiggingHoleScreen' ; AST#export_declaration#Right | export { DiggingHoleScreenComponent } from './src/main/ets/components/mainpage/DiggingHoleScreen'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/diggingholescreen/Index.ets#L16-L16 | 7e8ea681059bb38dc3d26fdd8c26fe4e7f8b9303 | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/StringUtils.ets | arkts | bufferToUint8Array | ArrayBuffer转Uint8Array
@param str
@returns | static bufferToUint8Array(src: ArrayBuffer): Uint8Array {
return new Uint8Array(src)
} | AST#method_declaration#Left static bufferToUint8Array AST#parameter_list#Left ( AST#parameter#Left src : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Uint8Array ... | static bufferToUint8Array(src: ArrayBuffer): Uint8Array {
return new Uint8Array(src)
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/StringUtils.ets#L273-L275 | c333331bbc6ac22b4e543a7999479045f4c1a4e0 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/calendarswitch/src/main/ets/customcalendar/model/CalendarModel.ets | arkts | ScheduleInfo | 日程点相关信息 | @Observed
export class ScheduleInfo {
title: string; // 标题
location: string; // 地点
startTime: Date; // 开始时间
endTime: Date; // 结束时间
describe: string; // 说明
dateString: string; // 开始时间startTime里的年月日,如'2024/11/5'
reminderTime: number[]; // 提醒时间
constructor(title: string, location: string, startTime: Date,... | AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class ScheduleInfo AST#class_body#Left { AST#property_declaration#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // 标题 AST#... | @Observed
export class ScheduleInfo {
title: string;
location: string;
startTime: Date;
endTime: Date;
describe: string;
dateString: string; startTime里的年月日,如'2024/11/5'
reminderTime: number[];
constructor(title: string, location: string, startTime: Date, endTime: Date, describe: string,
dateS... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/calendarswitch/src/main/ets/customcalendar/model/CalendarModel.ets#L60-L80 | 6c2846ffe6ef7e8c718db6d0a4db65817baa48d5 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/action/ToastUtil.ets | arkts | initToastDefault | 初始化DialogOptions参数 | private static initToastDefault(options: ToastOptions = new ToastOptions(), type: number): ToastOptions {
if (type == 1) {
options.duration = options.duration ?? ToastUtil.defaultConfig.duration_short;
} else if (type == 2) {
options.duration = options.duration ?? ToastUtil.defaultConfig.duration_lo... | AST#method_declaration#Left private static initToastDefault AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ToastOptions AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new A... | private static initToastDefault(options: ToastOptions = new ToastOptions(), type: number): ToastOptions {
if (type == 1) {
options.duration = options.duration ?? ToastUtil.defaultConfig.duration_short;
} else if (type == 2) {
options.duration = options.duration ?? ToastUtil.defaultConfig.duration_lo... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/action/ToastUtil.ets#L101-L121 | 924f4dc9f3f980b882f7ae22dfe9862db44e1fe0 | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.atomicservice.AtomicServiceWeb.d.ets | arkts | backward | Goes back in the history of the web page.
@throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a
AtomicServiceWeb component.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 12 | backward(): void; | AST#method_declaration#Left backward 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#method_declaration#Right | backward(): void; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.AtomicServiceWeb.d.ets#L414-L414 | 85b7b191b51f48c8500d2a49f0226d46722f7d2a | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/WaterfallDataSet.ets | arkts | getDotsColors | 获取所有高亮点的颜色。
@returns 包含所有高亮点颜色的数组,元素可以是字符串或数字。 | public getDotsColors(): Array<string | number> {
const colors: Array<number | string> = [];
this.mEntries?.dataSource.forEach((value: BarEntry) => {
const entry = value as WaterfallEntry;
entry.getHighlights().forEach((highlight: WaterfallHighlight) => {
colors.push(highlight.getColor());
... | AST#method_declaration#Left public getDotsColors AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type... | public getDotsColors(): Array<string | number> {
const colors: Array<number | string> = [];
this.mEntries?.dataSource.forEach((value: BarEntry) => {
const entry = value as WaterfallEntry;
entry.getHighlights().forEach((highlight: WaterfallHighlight) => {
colors.push(highlight.getColor());
... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/WaterfallDataSet.ets#L91-L100 | 9c121bda9f250b2da41fa1904c58eaa43cbaa8ae | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/TaskManagement/WorkScheduler/entry/src/main/ets/feature/WorkSchedulerSystem.ets | arkts | Sending a Notification.
@param bundleName Check the name of the application that has permission.
@permission ohos.permission.NOTIFICATION_CONTROLLER | export async function handleNotification(bundleName: string): Promise<void> {
await notificationManager.requestEnableNotification();
Notification.subscribe({
onConsume: (data) => {
if (data.request.content.normal.text === 'isReady') {
AppStorage.SetOrCreate('isShowDialog', true);
... | AST#export_declaration#Left export AST#function_declaration#Left async function handleNotification AST#parameter_list#Left ( AST#parameter#Left bundleName : 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_an... | export async function handleNotification(bundleName: string): Promise<void> {
await notificationManager.requestEnableNotification();
Notification.subscribe({
onConsume: (data) => {
if (data.request.content.normal.text === 'isReady') {
AppStorage.SetOrCreate('isShowDialog', true);
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/TaskManagement/WorkScheduler/entry/src/main/ets/feature/WorkSchedulerSystem.ets#L53-L64 | de1102be082bdb10148a3e7c6abaab34fd9ce6a4 | gitee | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/view/LocalStoragePage.ets | arkts | InputSection | 输入区域
@returns {void} 无返回值 | @Builder
private InputSection(): void {
IBestCellGroup({ inset: true, outerMargin: 0 }) {
IBestField({
value: this.vm.accountInput,
label: $r("app.string.demo_local_storage_account_label"),
placeholder: $r("app.string.demo_local_storage_account_placeholder"),
onChange: (value... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private InputSection 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 InputSection(): void {
IBestCellGroup({ inset: true, outerMargin: 0 }) {
IBestField({
value: this.vm.accountInput,
label: $r("app.string.demo_local_storage_account_label"),
placeholder: $r("app.string.demo_local_storage_account_placeholder"),
onChange: (value... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/LocalStoragePage.ets#L54-L66 | d439d2bb2db0883b2bb33cc717e657f3b4375fca | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkTS/ArkTsConcurrent/MultithreadedConcurrency/TaskPoolIntroduction/entry/src/main/ets/util/resource.ets | arkts | [StartExclude p2p_manager_resource] | export class P2PManager {
public resourceToString(resource: Resource):string {
return getContext(this).resourceManager.getStringSync(resource);
}
} | AST#export_declaration#Left export AST#class_declaration#Left class P2PManager AST#class_body#Left { AST#method_declaration#Left public resourceToString AST#parameter_list#Left ( AST#parameter#Left resource : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#pa... | export class P2PManager {
public resourceToString(resource: Resource):string {
return getContext(this).resourceManager.getStringSync(resource);
}
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTsConcurrent/MultithreadedConcurrency/TaskPoolIntroduction/entry/src/main/ets/util/resource.ets#L17-L21 | 8a6d57b7a07c505b62ddf67cdd142068e216024d | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/components/DataManager.ets | arkts | setDate | 将数据写入缓存的Preferences实例中,并使数据持久化
@param { Context } Context - 应用上下文
@param { DateModel } dateModel - 日期数据类
@param { function } callback - 回调函数 | static setDate(context: Context, dateModel: DateModel, callback: () => void) {
try {
// 获取Preferences实例
let promise = dataPreferences.getPreferences(context, 'date')
promise.then((object: dataPreferences.Preferences) => {
try {
// 将数据写入缓存的Preferences实例中
let setPromise =... | AST#method_declaration#Left static setDate AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dateModel : AST#type_annotation#Left AST#primary_type#Left DateModel AST#prim... | static setDate(context: Context, dateModel: DateModel, callback: () => void) {
try {
let promise = dataPreferences.getPreferences(context, 'date')
promise.then((object: dataPreferences.Preferences) => {
try {
let setPromise = object.put('selectedDate', JSON.stringify(... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/components/DataManager.ets#L72-L107 | 53171cc793d5581bb84c122971790aabbccd8dcb | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/ui/grid/Grid.ets | arkts | 数据网格组件 | export interface GridItem {
id: string;
title: string;
icon?: string | Resource; | AST#export_declaration#Left export AST#interface_declaration#Left interface GridItem 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 title : AST#type_annotation#Left AST#p... | export interface GridItem {
id: string;
title: string;
icon?: string | Resource; | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/ui/grid/Grid.ets#L4-L7 | 9ef806605aef8a97902af65d3826ffe8a2996f55 | github | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/ComponentBase.ets | arkts | setXOffset | Sets the used x-axis offset for the labels on this axis.
@param xOffset | public setXOffset(xOffset: number): void {
this.mXOffset = Utils.handleDataValues(xOffset);
} | AST#method_declaration#Left public setXOffset AST#parameter_list#Left ( AST#parameter#Left xOffset : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_typ... | public setXOffset(xOffset: number): void {
this.mXOffset = Utils.handleDataValues(xOffset);
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/ComponentBase.ets#L69-L71 | 6b0c2801a15a34913939f1e3619fd6ce2d41efc6 | gitee |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | NEXT/OneAutumn/entry/src/main/ets/pages/Guide.ets | arkts | aboutToAppear | 生命周期 页面一加载就执行 | async aboutToAppear(): Promise<void> {
// 倒计时功能
const timer = setInterval(() => {
this.countdown--; // 每秒减 1
if (this.countdown <= 0) {
clearInterval(timer); // 倒计时结束,清除定时器
router.replaceUrl({
url: "pages/Index"
})
}
}, 1000); // 每秒执行一次
// 更换诗词功能 异步
... | AST#method_declaration#Left async aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_ar... | async aboutToAppear(): Promise<void> {
const timer = setInterval(() => {
this.countdown--;
if (this.countdown <= 0) {
clearInterval(timer);
router.replaceUrl({
url: "pages/Index"
})
}
}, 1000);
this.poemText = await utils.getPoemText() as str... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/OneAutumn/entry/src/main/ets/pages/Guide.ets#L22-L42 | 6934b89d2d12580716cd30c5ac71c8a4daf721c8 | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/StringUtils.ets | arkts | toUpper | 转换整个字符串的字符为大写
@param str 要转换的字符串
@returns 返回小写的字符串 | static toUpper(str: string = ''): string {
return str.toUpperCase();
} | AST#method_declaration#Left static toUpper 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#expression#Left '' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST... | static toUpper(str: string = ''): string {
return str.toUpperCase();
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/StringUtils.ets#L158-L160 | 738e8956ca9580d09383ff4f74db4c4be2ba0266 | gitee |
htliang128/arkts_oss.git | 9da4a87c36272873c649f556854bd793ac337a18 | java_type/src/main/ets/java/util/FileUtil.ets | arkts | readText | please make sure the file exist firstly | public static readText(filePath: string): string {
let buf = FileUtil.readBin(filePath);
return buffer.from(buf).toString('utf-8')
} | AST#method_declaration#Left public static readText AST#parameter_list#Left ( AST#parameter#Left filePath : 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#pri... | public static readText(filePath: string): string {
let buf = FileUtil.readBin(filePath);
return buffer.from(buf).toString('utf-8')
} | https://github.com/htliang128/arkts_oss.git/blob/9da4a87c36272873c649f556854bd793ac337a18/java_type/src/main/ets/java/util/FileUtil.ets#L83-L87 | 0ac03ea05df86c217a254ed321807fcfae71a3e4 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plancurve/Box.ets | arkts | sortBoxes | 对Box数组进行排序
@param boxes - Box数组 | static sortBoxes(boxes: Box[]): Box[] {
return boxes.sort((a, b) => a.compareTo(b));
} | AST#method_declaration#Left static sortBoxes AST#parameter_list#Left ( AST#parameter#Left boxes : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Box [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST... | static sortBoxes(boxes: Box[]): Box[] {
return boxes.sort((a, b) => a.compareTo(b));
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Box.ets#L145-L147 | 39eedc94579579b125e0d8cbfe25e0bacd14d036 | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/view/ScreenAdaptDemoPage.ets | arkts | SizeAdaptSection | 尺寸适配示例
@returns {void} 无返回值 | @Builder
private SizeAdaptSection(): void {
Column() {
this.CardTitle($r("app.string.demo_screen_adapt_size_title"));
SpaceVerticalSmall();
this.CardDesc($r("app.string.demo_screen_adapt_size_desc"));
SpaceVerticalSmall();
Row() {
Text($r("app.string.demo_screen_adapt_siz... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private SizeAdaptSection 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... | @Builder
private SizeAdaptSection(): void {
Column() {
this.CardTitle($r("app.string.demo_screen_adapt_size_title"));
SpaceVerticalSmall();
this.CardDesc($r("app.string.demo_screen_adapt_size_desc"));
SpaceVerticalSmall();
Row() {
Text($r("app.string.demo_screen_adapt_siz... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/ScreenAdaptDemoPage.ets#L232-L262 | c6ac5d43e54cdc4c246758e5b502e4d8b3ca14fc | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/cuberotateanimation/src/main/ets/model/BasicDataSource.ets | arkts | getData | 获取索引对应的数据
@param index 数组索引 | public getData(index: number): ESObject {
return this.originDataArray[index];
} | AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ESObject AST#primary_type... | public getData(index: number): ESObject {
return this.originDataArray[index];
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cuberotateanimation/src/main/ets/model/BasicDataSource.ets#L35-L37 | 163f8d7c968c781397ab32957ca5ada523d08d9e | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/BarDataSet.ets | arkts | getGradient | This method is deprecated.
Use getFill(...) instead.
@param index | public getGradient(index: number): Fill | null {
return this.getFill(index);
} | AST#method_declaration#Left public getGradient AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left F... | public getGradient(index: number): Fill | null {
return this.getFill(index);
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L103-L105 | daa4bc61170ae7b1c49440ceb86b754e3d54a72c | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plandb/DBPlanHelper.ets | arkts | dbPieces | MARK: - Private Helpers 获取此 DBPlan 的 DBPieces | async dbPieces(): Promise<DBPiece[]> {
if (this.plan.planId) {
return await PlanDbAccess.shared.getPieces(this.plan.planId) ?? [];
}
return [];
} | AST#method_declaration#Left async dbPieces AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DBPiece [ ] AST#array_type#Right AST#primary_type#Ri... | async dbPieces(): Promise<DBPiece[]> {
if (this.plan.planId) {
return await PlanDbAccess.shared.getPieces(this.plan.planId) ?? [];
}
return [];
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plandb/DBPlanHelper.ets#L19-L24 | 2da43cde62d5d245b28bc1f47553f5422b504c8c | github |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | examples/Select/entry/src/main/ets/pages/components/checkbox/checkboxThemeControl.ets | arkts | Customized theme object | export class AppTheme implements CustomTheme {
public colors: AppColors = new AppColors();
} | AST#export_declaration#Left export AST#class_declaration#Left class AppTheme AST#implements_clause#Left implements CustomTheme AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left public colors : AST#type_annotation#Left AST#primary_type#Left AppColors AST#primary_type#Right AST#type_annotati... | export class AppTheme implements CustomTheme {
public colors: AppColors = new AppColors();
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/checkbox/checkboxThemeControl.ets#L28-L30 | 62146979c484e1e71989cfb88fddc31d38d011cb | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/styledtext/src/main/ets/model/DataSource.ets | arkts | addData | 在指定索引位置增加一个元素
@param index | public addData(index: number, data: CustomMessage): void {
this.messageList.splice(index, 0, data);
this.notifyDataAdd(index);
} | AST#method_declaration#Left public addData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left CustomMessage AST#primary_... | public addData(index: number, data: CustomMessage): void {
this.messageList.splice(index, 0, data);
this.notifyDataAdd(index);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/styledtext/src/main/ets/model/DataSource.ets#L41-L44 | 84fd8ce254564bfcbc9107d8f9c7622f2e0def6c | gitee |
HomoArk/Homogram.git | 8a6e85898b6194fdd04ead75e732d348888a0c07 | features/home/src/main/ets/views/Chat/ChatDetailBottomPhotoPicker.ets | arkts | onPickerControllerReady | 接收到该回调后,便可通过pickerController相关接口向picker发送数据,在此之前不生效。 | private onPickerControllerReady(): void {
console.info('onPickerControllerReady');
} | AST#method_declaration#Left private onPickerControllerReady AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#L... | private onPickerControllerReady(): void {
console.info('onPickerControllerReady');
} | https://github.com/HomoArk/Homogram.git/blob/8a6e85898b6194fdd04ead75e732d348888a0c07/features/home/src/main/ets/views/Chat/ChatDetailBottomPhotoPicker.ets#L132-L134 | 019e86092bdb147555ca8e18429b8a51f2693e13 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/ResUtil.ets | arkts | getMediaByName | 用户获取指定资源名称对应的媒体文件内容/获取指定资源名称对应的默认或指定的屏幕密度媒体文件内容
@param resName 资源名称。
@param density 资源获取需要的屏幕密度,0或缺省表示默认屏幕密度。
@returns | static async getMediaByName(resName: string, density?: number): Promise<Uint8Array> {
if (density !== undefined) {
return ResUtil.getResourceManager().getMediaByName(resName, density);
} else {
return ResUtil.getResourceManager().getMediaByName(resName);
}
} | AST#method_declaration#Left static async getMediaByName AST#parameter_list#Left ( AST#parameter#Left resName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left density ? : AST#type_annotation#Left AST#primary_type#Left number... | static async getMediaByName(resName: string, density?: number): Promise<Uint8Array> {
if (density !== undefined) {
return ResUtil.getResourceManager().getMediaByName(resName, density);
} else {
return ResUtil.getResourceManager().getMediaByName(resName);
}
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L341-L347 | 331e7220e9ac2431d20325127f0d287daa5f8ab6 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/EmptyAlbumComponent.ets | arkts | EmptyAlbumComponentForTraditionalStyle | Traditional style | @Component
export struct EmptyAlbumComponentForTraditionalStyle {
build() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Center,
alignItems: ItemAlign.Center
}) {
Image($r('app.media.ic_goto_photos'))
.width($r('app.float.album_set_icon_size'))
.asp... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct EmptyAlbumComponentForTraditionalStyle 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#comp... | @Component
export struct EmptyAlbumComponentForTraditionalStyle {
build() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Center,
alignItems: ItemAlign.Center
}) {
Image($r('app.media.ic_goto_photos'))
.width($r('app.float.album_set_icon_size'))
.asp... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/EmptyAlbumComponent.ets#L71-L88 | f53e1ca12ca704539812626655001f6fbd1a464c | gitee |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/arkts/@arkts.collections.d.ets | arkts | push | Appends the bit element to the end of this bit vector.
@param { number } element - Element to be appended to this bit vector (0 means 0, else means 1).
@returns { boolean } The boolean type, returns true if the addition is successful, and returns false if it fails.
@throws { BusinessError } 401 - Parameter error. Poss... | push(element: number): boolean; | AST#method_declaration#Left push AST#parameter_list#Left ( AST#parameter#Left element : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AS... | push(element: number): boolean; | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/arkts/@arkts.collections.d.ets#L5466-L5466 | 5c82ec9b2774ffc59a1f7b3b7fbace481fae08d9 | github |
yrjwcharm/react-native-ohos-docviewer.git | c6e677fc0dd38eb21f5749b099812dd108a5c967 | harmony/docviewer/src/main/ets/generated/index.ets | arkts | This code was generated by "react-native codegen-lib-harmony" | export * from "./ts" | AST#export_declaration#Left export * from "./ts" AST#export_declaration#Right | export * from "./ts" | https://github.com/yrjwcharm/react-native-ohos-docviewer.git/blob/c6e677fc0dd38eb21f5749b099812dd108a5c967/harmony/docviewer/src/main/ets/generated/index.ets#L5-L5 | 3cd558a71215dc618b68a0845d75fc4ae6371a0b | github | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ViewPortHandler.ets | arkts | resetZoom | Zooms out to original size.
@param outputMatrix | public resetZoom(outputMatrix: Matrix) {
outputMatrix.reset();
outputMatrix.set(this.mMatrixTouch);
outputMatrix.postScale(1.0, 1.0, 0.0, 0.0);
} | AST#method_declaration#Left public resetZoom AST#parameter_list#Left ( AST#parameter#Left outputMatrix : AST#type_annotation#Left AST#primary_type#Left Matrix AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AS... | public resetZoom(outputMatrix: Matrix) {
outputMatrix.reset();
outputMatrix.set(this.mMatrixTouch);
outputMatrix.postScale(1.0, 1.0, 0.0, 0.0);
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ViewPortHandler.ets#L216-L220 | 6a9931963d0bd7df67e4a79bf65247c3d64175e5 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/utils/CommonUtils.ets | arkts | formatDate | 格式化日期 | static formatDate(date: Date, format: string = 'YYYY-MM-DD HH:mm:ss'): string {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = St... | AST#method_declaration#Left static formatDate 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 format : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#... | static formatDate(date: Date, format: string = 'YYYY-MM-DD HH:mm:ss'): string {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = St... | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/CommonUtils.ets#L9-L24 | 2cfc42745b1b9bdf46f5932e72520f5abb7aeca7 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Media/Camera_js/entry/src/main/ets/views/SlidePage.ets | arkts | SlidePage | 变焦组件 | @Component
export struct SlidePage {
@StorageLink('zoomRatioMin') zoomMin: number = 1;
@StorageLink('zoomRatioMax') zoomMax: number = 6;
// slide滑块
@State outSetValueOne: number = 1;
// slide滑块移动值
@State sliderTextPos: string = '-10';
slideChange(value: number) {
CameraService.setZoomRatioFn(value);
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct SlidePage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'zoomRatioMin' AST#expression#Right ) AST#decorator#Right zoomMin : AST#type_annotation#Left AST... | @Component
export struct SlidePage {
@StorageLink('zoomRatioMin') zoomMin: number = 1;
@StorageLink('zoomRatioMax') zoomMax: number = 6;
@State outSetValueOne: number = 1;
移动值
@State sliderTextPos: string = '-10';
slideChange(value: number) {
CameraService.setZoomRatioFn(value);
this.sliderTextP... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Camera_js/entry/src/main/ets/views/SlidePage.ets#L22-L82 | c673f56b465aaffaf2fe6f5e1fe6307ee773037a | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/model/VHHistoryMessageDataSource.ets | arkts | unregisterDataChangeListener | 该方法为框架侧调用,为对应的LazyForEach组件在数据源处去除listener监听 | unregisterDataChangeListener(listener: DataChangeListener): void {
const pos = this.listeners.indexOf(listener);
if (pos >= 0) {
console.info('remove listener');
this.listeners.splice(pos, 1);
}
} | AST#method_declaration#Left unregisterDataChangeListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left DataChangeListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#L... | unregisterDataChangeListener(listener: DataChangeListener): void {
const pos = this.listeners.indexOf(listener);
if (pos >= 0) {
console.info('remove listener');
this.listeners.splice(pos, 1);
}
} | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/model/VHHistoryMessageDataSource.ets#L26-L32 | 2ab7698f998ec4502a88de0c64bdcf9a09850db8 | gitee |
RedRackham-R/WanAndroidHarmoney.git | 0bb2a7c8d7b49194a96e42a380d43b7e106cdb22 | entry/src/main/ets/global/viewmodel/GlobalCollectViewModel.ets | arkts | uncolect | 取消收藏文章
@param id article id | async uncolect(id: number) {
try {
const response = await wanHttpClient.uncollect(id)
if (response.data.errorCode === 0) { //errorCode === 0说明收藏成功
EventBus.getInstance().post(WanEventId.EVENT_UNCOLLECT, new UncollectEvent(true, id))
} else {
EventBus.getInstance()
.post(W... | AST#method_declaration#Left async uncolect AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#... | async uncolect(id: number) {
try {
const response = await wanHttpClient.uncollect(id)
if (response.data.errorCode === 0) {
EventBus.getInstance().post(WanEventId.EVENT_UNCOLLECT, new UncollectEvent(true, id))
} else {
EventBus.getInstance()
.post(WanEventId.EVENT_UNCOLLE... | https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/global/viewmodel/GlobalCollectViewModel.ets#L91-L104 | b327cacc4d0aeb4feb10851e9d5abd9824e50598 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/PasteboardUtil.ets | arkts | getDataTextSync | 读取系统剪贴板纯文本内容。
@returns | static getDataTextSync(): string {
return PasteboardUtil.getDataSync().getPrimaryText();
} | AST#method_declaration#Left static getDataTextSync AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_exp... | static getDataTextSync(): string {
return PasteboardUtil.getDataSync().getPrimaryText();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L137-L139 | 1fab67eec3cde40c66b26e051e43982fd4be0e7e | gitee |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | examples/Info/entry/src/main/ets/pages/badge/BadgeExample001.ets | arkts | tabBuilder | 该示例设置标记组件内容 | @Builder
tabBuilder(index: number) {
Column() {
if (index === 2) {
Badge({
value: '',
style: { badgeSize: 6, badgeColor: '#FA2A2D' }
}) {
Image('/common/public_icon_off.svg')
.width(24)
.height(24)
}
.width(24)
.he... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right tabBuilder AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Lef... | @Builder
tabBuilder(index: number) {
Column() {
if (index === 2) {
Badge({
value: '',
style: { badgeSize: 6, badgeColor: '#FA2A2D' }
}) {
Image('/common/public_icon_off.svg')
.width(24)
.height(24)
}
.width(24)
.he... | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Info/entry/src/main/ets/pages/badge/BadgeExample001.ets#L21-L48 | 8a29973eaeb36dcf9b1b23a05a7af81dd13a9b9b | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/SHASync.ets | arkts | digestSHA384 | SHA384摘要
@param str 带摘要的字符串
@param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
@returns 摘要后的字符串 | static digestSHA384(str: string, resultCoding: buffer.BufferEncoding = 'base64'): string {
return CryptoSyncUtil.digest(str, 'SHA384', resultCoding);
} | AST#method_declaration#Left static digestSHA384 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 resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_t... | static digestSHA384(str: string, resultCoding: buffer.BufferEncoding = 'base64'): string {
return CryptoSyncUtil.digest(str, 'SHA384', resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/SHASync.ets#L65-L67 | 5706158a35197e764bc4bc73bee4f69a7ee4d27e | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/main/sub/report/RadarView.ets | arkts | drawDataArea | ========== 绘制数据区域 ========== | private drawDataArea(centerX: number, centerY: number, radius: number): void {
if (this.parts.length === 0) return;
const angleStep = (2 * Math.PI) / this.parts.length;
this.ctx.fillStyle = this.calculateFillColor();
this.ctx.strokeStyle = this.calculateLineColor();
this.ctx.lineWidth = 2;
thi... | AST#method_declaration#Left private drawDataArea AST#parameter_list#Left ( AST#parameter#Left centerX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left centerY : AST#type_annotation#Left AST#primary_type#Left number AST#prim... | private drawDataArea(centerX: number, centerY: number, radius: number): void {
if (this.parts.length === 0) return;
const angleStep = (2 * Math.PI) / this.parts.length;
this.ctx.fillStyle = this.calculateFillColor();
this.ctx.strokeStyle = this.calculateLineColor();
this.ctx.lineWidth = 2;
thi... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/main/sub/report/RadarView.ets#L251-L280 | 468d4e7a813cb7755370e80a707054a79e2a6e8e | github |
lime-zz/Ark-ui_RubbishRecycleApp.git | c2a9bff8fbb5bc46d922934afad0327cc1696969 | rubbish/rubbish/entry/src/main/ets/pages/SignIn.ets | arkts | doCheckIn | 执行签到(调用后端接口) | doCheckIn() {
let request = http.createHttp();
let url = `http://192.168.32.1:8080/api/user/${this.userId}/check-in`;
request.request(url, { method: http.RequestMethod.POST })
.then((response: http.HttpResponse) => {
if (response.responseCode === 200 && typeof response.result === 'string') {
... | AST#method_declaration#Left doCheckIn AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left request = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Lef... | doCheckIn() {
let request = http.createHttp();
let url = `http://192.168.32.1:8080/api/user/${this.userId}/check-in`;
request.request(url, { method: http.RequestMethod.POST })
.then((response: http.HttpResponse) => {
if (response.responseCode === 200 && typeof response.result === 'string') {
... | https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/SignIn.ets#L68-L97 | 5c0277c34d58ec28ad6ea39be17e64a82648d5c9 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/WebSocket_case/entry/src/main/ets/pages/Index.ets | arkts | 与底间隔 | export function resourceToString(resource: Resource): string {
return getContext().resourceManager.getStringSync(resource);
} | AST#export_declaration#Left export AST#function_declaration#Left function resourceToString AST#parameter_list#Left ( AST#parameter#Left resource : 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... | export function resourceToString(resource: Resource): string {
return getContext().resourceManager.getStringSync(resource);
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/WebSocket_case/entry/src/main/ets/pages/Index.ets#L30-L32 | c188b43527b037624981f8dc89786fb4b1b0239e | gitee | |
openharmony/update_update_app | 0157b7917e2f48e914b5585991e8b2f4bc25108a | feature/ota/src/main/ets/manager/OtaUpdateManager.ets | arkts | 升级接口管理类
@since 2022-06-05 | export class OtaUpdateManager {
private static readonly KEY = 'EventInfo';
private _updateStatus: number;
private _downloadProgress: number;
private lastStatus: number;
private stateObj: BaseState;
private otaStatusHolder: OtaStatusHolder;
private updateManager: UpdateManager;
private messageQueue: Mess... | AST#export_declaration#Left export AST#class_declaration#Left class OtaUpdateManager AST#class_body#Left { AST#property_declaration#Left private static readonly KEY = AST#expression#Left 'EventInfo' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left private _updateStatus : AST#type_anno... | export class OtaUpdateManager {
private static readonly KEY = 'EventInfo';
private _updateStatus: number;
private _downloadProgress: number;
private lastStatus: number;
private stateObj: BaseState;
private otaStatusHolder: OtaStatusHolder;
private updateManager: UpdateManager;
private messageQueue: Mess... | https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/manager/OtaUpdateManager.ets#L42-L455 | 71c753bcf87b7d9cfac325ede9d37a1ab8c9b098 | gitee | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/charts/Chart.ets | arkts | Baseclass of all Chart-Views.
@author Philipp Jahoda | export default abstract class Chart<T> {
// <T extends ChartData<? extends IDataSet<? extends EntryOhos>>> implements ChartInterface
public static LOG_TAG: string = 'ohos-MPChart';
/**
* flag that indicates if logging is enabled or not
*/
protected mLogEnabled: boolean = false;
/**
* object that ... | AST#export_declaration#Left export default AST#class_declaration#Left abstract class Chart AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#class_body#Left { // <T extends ChartData<? extends IDataSet<? extends EntryOhos>>> implements ChartInterface AST#prop... | export default abstract class Chart<T> {
public static LOG_TAG: string = 'ohos-MPChart';
protected mLogEnabled: boolean = false;
protected mData: T = null;
protected mHighLightPerTapEnabled: boolean = true;
private mDragDecelerationEnabled: boolean = true;
private mDragDecelerationFr... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/charts/Chart.ets#L50-L343 | 4bf00c15c7a0fb582ddac2bea77f0bc22c94304c | gitee | |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/Media/Image/photomodify/src/main/ets/components/pages/EditImage.ets | arkts | flushPage | 刷新图层显示 | flushPage(): void {
this.tempPixelMap = this.pixelMap;
this.pixelMap = undefined;
this.pixelMap = this.tempPixelMap;
} | AST#method_declaration#Left flushPage AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_e... | flushPage(): void {
this.tempPixelMap = this.pixelMap;
this.pixelMap = undefined;
this.pixelMap = this.tempPixelMap;
} | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Media/Image/photomodify/src/main/ets/components/pages/EditImage.ets#L183-L187 | 37566163ce9f76fa9a45492e0870962c04f9ce86 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/CalendarPage.ets | arkts | buildBirthdayCard | 构建生日卡片 | @Builder
buildBirthdayCard(contact: Contact) {
Row({ space: 12 }) {
// 头像
Image(contact.avatar || $r('app.media.ic_avatar_default'))
.width(40)
.height(40)
.borderRadius(20)
.objectFit(ImageFit.Cover)
// 信息
Column({ space: 4 }) {
Text(contact.... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildBirthdayCard AST#parameter_list#Left ( AST#parameter#Left contact : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_functio... | @Builder
buildBirthdayCard(contact: Contact) {
Row({ space: 12 }) {
Image(contact.avatar || $r('app.media.ic_avatar_default'))
.width(40)
.height(40)
.borderRadius(20)
.objectFit(ImageFit.Cover)
Column({ space: 4 }) {
Text(contact.name)
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/CalendarPage.ets#L473-L536 | 4c1dc8dda9359ee9dda74eb8dbecda943f2919db | github |
linwu-hi/open_neteasy_cloud.git | b562a70ffdbee5e192a1c3fb7fc8a4fb27119af4 | entry/src/main/ets/view/DetailListComponent.ets | arkts | DetailListComponent | This is the general detail page component that can add multiple items to the list. | @Component
export struct DetailListComponent {
build() {
Column() {
List() {
ForEach(CategoryModel.getDetailData(), (listItemData: ListItemData) => {
ListItem() {
Row() {
Text(listItemData.title)
.fontSize($r('app.float.sub_title_left_size'))
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct DetailListComponent 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 Column ( ) AST#container_content_b... | @Component
export struct DetailListComponent {
build() {
Column() {
List() {
ForEach(CategoryModel.getDetailData(), (listItemData: ListItemData) => {
ListItem() {
Row() {
Text(listItemData.title)
.fontSize($r('app.float.sub_title_left_size'))
... | https://github.com/linwu-hi/open_neteasy_cloud.git/blob/b562a70ffdbee5e192a1c3fb7fc8a4fb27119af4/entry/src/main/ets/view/DetailListComponent.ets#L8-L44 | e1a575fff283a01f9377a577f7f1b0e29ca88369 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | Component transition rotate. | export const COMPONENT_TRANSITION_ROTATE: ComponentTransitionRotate = { x: 0, y: 1, z: 0, angle: 360 }; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left COMPONENT_TRANSITION_ROTATE : AST#type_annotation#Left AST#primary_type#Left ComponentTransitionRotate AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignm... | export const COMPONENT_TRANSITION_ROTATE: ComponentTransitionRotate = { x: 0, y: 1, z: 0, angle: 360 }; | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets#L70-L70 | f3dc1b4865e20dc7b1506e3d54eff34c94fbb0ad | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/DateUtil.ets | arkts | getFormatRelativeTime | 格式化相对时间
@param value 相对时间格式化的数值
@param unit 相对时间格式化的单位,取值包括:"year", "quarter", "month", "week", "day", "hour", "minute", "second"。
@param options 时间日期格式化选项
@param locale 包含区域设置信息的字符串,包括语言以及可选的脚本和区域
@returns | static getFormatRelativeTime(value: number, unit: string, options?: intl.RelativeTimeFormatInputOptions,
locale: string = "zh-CN"): string {
let relativeTimeFormat = new intl.RelativeTimeFormat(locale, options);
return relativeTimeFormat.format(value, unit);
} | AST#method_declaration#Left static getFormatRelativeTime AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left unit : AST#type_annotation#Left AST#primary_type#Left string AST#p... | static getFormatRelativeTime(value: number, unit: string, options?: intl.RelativeTimeFormatInputOptions,
locale: string = "zh-CN"): string {
let relativeTimeFormat = new intl.RelativeTimeFormat(locale, options);
return relativeTimeFormat.format(value, unit);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DateUtil.ets#L385-L389 | ea0a46bdbc6ea252182904615e0261b9c0736485 | gitee |
IceYuanyyy/OxHornCampus.git | bb5686f77fa36db89687502e35898cda218d601f | entry/src/main/ets/common/utils/Geography.ets | arkts | MercatorY | Find radians based on latitude.
@param latitude.
@returns Radiance corresponding to the latitude. | public static MercatorY(latitude: number): number {
return Math.log(Math.tan((latitude * Const.RADIAN_CONSTANT / Const.DOUBLE_OR_HALF) +
(Const.QUARTER_CIRCLE)));
} | AST#method_declaration#Left public static MercatorY AST#parameter_list#Left ( AST#parameter#Left latitude : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#pr... | public static MercatorY(latitude: number): number {
return Math.log(Math.tan((latitude * Const.RADIAN_CONSTANT / Const.DOUBLE_OR_HALF) +
(Const.QUARTER_CIRCLE)));
} | https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/common/utils/Geography.ets#L51-L54 | a1ad6c084640fca4cede04f73663933edbbdcd2f | github |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/arkts/@arkts.utils.d.ets | arkts | lockAsync | Perform an operation with the acquired lock.
The method acquires the lock first, then calls the callback, and then releases the lock.
The callback is called asynchronously in the same thread where lockAsync was called.
An optional timeout value can be provided in {@link AsyncLockOptions}. In this case, lockAsync will r... | lockAsync<T, U>(callback: AsyncLockCallback<T>, mode: AsyncLockMode,
options: AsyncLockOptions<U>): Promise<T | U>; | AST#method_declaration#Left lockAsync AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right , AST#type_parameter#Left U AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Lef... | lockAsync<T, U>(callback: AsyncLockCallback<T>, mode: AsyncLockMode,
options: AsyncLockOptions<U>): Promise<T | U>; | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/arkts/@arkts.utils.d.ets#L154-L155 | 0bbe53f8e394e5ed8c81bf11cf332d6c0da2748c | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/models/CommonModels.ets | arkts | 商品数据模型 | export interface Goods {
id: number;
name: string;
mainPic: string;
price: number;
originalPrice?: number;
sales?: number;
tag?: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Goods AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#Left AST#prima... | export interface Goods {
id: number;
name: string;
mainPic: string;
price: number;
originalPrice?: number;
sales?: number;
tag?: string;
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/models/CommonModels.ets#L17-L25 | 61377d7610c65c01a57510198bb616962d53850b | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/limitedheightbottomdialog/src/main/ets/view/LimitedHeightBottomDialogComponent.ets | arkts | createSecuritySettingView | 创建安全设置底部弹窗视图 | @Builder
function createSecuritySettingView() {
SecuritySettingView()
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function createSecuritySettingView 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 SecuritySettingView ( ) AST... | @Builder
function createSecuritySettingView() {
SecuritySettingView()
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/limitedheightbottomdialog/src/main/ets/view/LimitedHeightBottomDialogComponent.ets#L36-L39 | 622903a39aa7d481043f518c1c2ca60825f3d1e0 | gitee |
xinkai-hu/MyDay.git | dcbc82036cf47b8561b0f2a7783ff0078a7fe61d | entry/src/main/ets/pages/MyDay.ets | arkts | ScheduleItem | 列表中,每一条日程记录对应一个 ScheduleItem 组件。
@param schedule 组件对应的日程记录。 | @Builder
private ScheduleItem(schedule: Schedule): void {
Row({ space: '2%' }) {
if (this.isBatchEdit) {
Checkbox({ group: 'batchEditGroup' })
.select(this.batchEditList.findIndex(
(value: Schedule): boolean => value.id === schedule.id) !== -1)
.onChange((isOn: boolea... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private ScheduleItem AST#parameter_list#Left ( AST#parameter#Left schedule : AST#type_annotation#Left AST#primary_type#Left Schedule AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_ann... | @Builder
private ScheduleItem(schedule: Schedule): void {
Row({ space: '2%' }) {
if (this.isBatchEdit) {
Checkbox({ group: 'batchEditGroup' })
.select(this.batchEditList.findIndex(
(value: Schedule): boolean => value.id === schedule.id) !== -1)
.onChange((isOn: boolea... | https://github.com/xinkai-hu/MyDay.git/blob/dcbc82036cf47b8561b0f2a7783ff0078a7fe61d/entry/src/main/ets/pages/MyDay.ets#L577-L872 | d44a12a67d1fe511add679d9a62fb9122f9d97f4 | github |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_imageText/ace_ets_module_imageText_api11_other/entry/src/main/ets/MainAbility/pages/RelativeContainer/relativeApi11/PageTwo.ets | arkts | PageTwo.ets | export class Pages {
names: string = ""
values: NavPathStack | null = null
} | AST#export_declaration#Left export AST#class_declaration#Left class Pages AST#class_body#Left { AST#property_declaration#Left names AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "" AST#expression#Right values AST#ERROR#Right... | export class Pages {
names: string = ""
values: NavPathStack | null = null
} | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_imageText/ace_ets_module_imageText_api11_other/entry/src/main/ets/MainAbility/pages/RelativeContainer/relativeApi11/PageTwo.ets#L16-L19 | 04c33b90b6061b9bcbd5ae4f6409b31aac74ca2f | gitee | |
azhuge233/ASFShortcut-HN.git | d1669c920c56317611b5b0375aa5315c1b91211b | entry/src/main/ets/common/utils/CommonUtils.ets | arkts | alert | 按照 API 版本显示 Toast 提醒 | public alert(message: string | Resource, newerPromptAction: PromptAction) {
if(deviceInfo.sdkApiVersion <= 17) {
try {
promptAction.showToast({
message: message
});
} catch (err) {
Logger.error(this.LOG_TAG, `alert() API... | AST#method_declaration#Left public alert AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , AS... | public alert(message: string | Resource, newerPromptAction: PromptAction) {
if(deviceInfo.sdkApiVersion <= 17) {
try {
promptAction.showToast({
message: message
});
} catch (err) {
Logger.error(this.LOG_TAG, `alert() API... | https://github.com/azhuge233/ASFShortcut-HN.git/blob/d1669c920c56317611b5b0375aa5315c1b91211b/entry/src/main/ets/common/utils/CommonUtils.ets#L24-L40 | 8abe6940bc9a340e97b9b58365fcd9f624ecbdee | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/CustomAnimationTab/customanimationtab/Index.ets | arkts | CustomAnimationTab | 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 { CustomAnimationTab } from './src/main/ets/utils/CustomAnimationTab' | AST#export_declaration#Left export { CustomAnimationTab } from './src/main/ets/utils/CustomAnimationTab' AST#export_declaration#Right | export { CustomAnimationTab } from './src/main/ets/utils/CustomAnimationTab' | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CustomAnimationTab/customanimationtab/Index.ets#L15-L15 | 52523acc0edb927316c10de9f90ee5b144ecd43e | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/ModelConfigService.ets | arkts | removeCustomModel | 删除自定义模型 | public removeCustomModel(name: string): void {
this.customModels = this.customModels.filter(model => model.name !== name);
this.storeCustomModels();
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP,
`[ModelConfigService] Custom model removed: ${name}`);
} | AST#method_declaration#Left public removeCustomModel 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_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary... | public removeCustomModel(name: string): void {
this.customModels = this.customModels.filter(model => model.name !== name);
this.storeCustomModels();
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP,
`[ModelConfigService] Custom model removed: ${name}`);
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/ModelConfigService.ets#L367-L372 | bc163d2ff2b7d1d8a9c867ad1e94cd9bbcb8b72b | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/base/src/main/ets/viewmodel/BaseViewModel.ets | arkts | onShown | 页面显示完成 - 来自 NavDestination
@param {VisibilityChangeReason} reason - 可见性变化原因
@returns {void} 无返回值 | onShown(reason: VisibilityChangeReason): void {
} | AST#method_declaration#Left onShown AST#parameter_list#Left ( AST#parameter#Left reason : AST#type_annotation#Left AST#primary_type#Left VisibilityChangeReason 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#primar... | onShown(reason: VisibilityChangeReason): void {
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/base/src/main/ets/viewmodel/BaseViewModel.ets#L55-L56 | 0d7a10f343434c722ff5d2b9a6fef23caea4e98a | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/network/src/main/ets/datasource/address/AddressNetworkDataSourceImpl.ets | arkts | @file 用户地址相关网络数据源实现类
@author Joker.X | export class AddressNetworkDataSourceImpl implements AddressNetworkDataSource {
/**
* 更新地址
* @param {Address} params - 地址信息
* @returns {Promise<NetworkResponse<void>>} 更新结果
*/
async updateAddress(params: Address): Promise<NetworkResponse<void>> {
const resp: AxiosResponse<NetworkResponse<void>> =
... | AST#export_declaration#Left export AST#class_declaration#Left class AddressNetworkDataSourceImpl AST#implements_clause#Left implements AddressNetworkDataSource AST#implements_clause#Right AST#class_body#Left { /**
* 更新地址
* @param {Address} params - 地址信息
* @returns {Promise<NetworkResponse<void>>} 更新结果
*/ AS... | export class AddressNetworkDataSourceImpl implements AddressNetworkDataSource {
async updateAddress(params: Address): Promise<NetworkResponse<void>> {
const resp: AxiosResponse<NetworkResponse<void>> =
await NetworkClient.http.post("user/address/update", params);
return resp.data;
}
async get... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/network/src/main/ets/datasource/address/AddressNetworkDataSourceImpl.ets#L10-L85 | b9bfa354dcb4fd7cf6c97de46b7906d10f7dd583 | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.TreeView.d.ets | arkts | getInstance | Get instance of treeListenerManager.
@return treeListenerManager instance
@static
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Get instance of treeListenerManager.
@return treeListenerManager instance
@static
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11 | static getInstance(): TreeListenerManager; | AST#method_declaration#Left static getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left TreeListenerManager AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right | static getInstance(): TreeListenerManager; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.TreeView.d.ets#L204-L204 | 9ba7a4b1db183470827d859b59df7340f6f1f535 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/utils/DateUtils.ets | arkts | formatRelative | 格式化相对时间(刚刚、几分钟前等) | static formatRelative(time: number): string {
const now = Date.now();
const diff = now - time;
const seconds = Math.floor(diff / 1000);
const minutes = Math.floor(seconds / 60);
const hours = Math.floor(minutes / 60);
const days = Math.floor(hours / 24);
if (seconds < 60) {
return '刚刚... | AST#method_declaration#Left static formatRelative 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 string AST#primary_... | static formatRelative(time: number): string {
const now = Date.now();
const diff = now - time;
const seconds = Math.floor(diff / 1000);
const minutes = Math.floor(seconds / 60);
const hours = Math.floor(minutes / 60);
const days = Math.floor(hours / 24);
if (seconds < 60) {
return '刚刚... | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/DateUtils.ets#L29-L48 | f67b3a0da67793023f1f1187aaabc1390bf8466a | github |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/components/player/VHWarmPlayerView.ets | arkts | onVodSeekDuration | @description 监听SeekTime,用于刷新进度条长度
@param duration 当前时长,单位为毫秒(ms)。 | onVodSeekDuration(duration: number){
} | AST#method_declaration#Left onVodSeekDuration AST#parameter_list#Left ( AST#parameter#Left duration : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right A... | onVodSeekDuration(duration: number){
} | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/player/VHWarmPlayerView.ets#L290-L292 | eeb2c52d62be3f8ba6ccd2ead5375fa37173b3a1 | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/common/helper/NovelContentParseHelper.ets | arkts | calculateChapterContent | 根据给定的页面大小对章节内容进行分页计算
Paginate the chapter content according to the given page size.
@param {string[]} paragraphList 章节的段落列表 the list of paragraph in the chapter
@param {number} fontSize 展示内容的文字大小 the text size of display config
@param {number} lineHeight 展示内容的行高 the line height of display config
@param {number} measur... | static async calculateChapterContent(paragraphList: string[], fontSize: number, lineHeight: number,
measureContentWidth: number, measureContentHeight: number): Promise<string[][]> {
let tempParagraphList = paragraphList.slice()
let wordSize = measure.measureTextSize({
textContent: '测', // 随便找的测试文字,用来测... | AST#method_declaration#Left static async calculateChapterContent AST#parameter_list#Left ( AST#parameter#Left paragraphList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fontS... | static async calculateChapterContent(paragraphList: string[], fontSize: number, lineHeight: number,
measureContentWidth: number, measureContentHeight: number): Promise<string[][]> {
let tempParagraphList = paragraphList.slice()
let wordSize = measure.measureTextSize({
textContent: '测',
fontSize... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/common/helper/NovelContentParseHelper.ets#L17-L41 | a6c0a213ef710c8888843682cfc3330b3bd4240f | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | setInverted | If this is set to true, the y-axis is inverted which means that low values are on top of
the chart, high values
on bottom.
@param enabled | public setInverted(enabled: boolean): void {
this.mInverted = enabled;
} | AST#method_declaration#Left public setInverted 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_t... | public setInverted(enabled: boolean): void {
this.mInverted = enabled;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L239-L241 | dfdd180405d61064dc9115ac36fd5d0c1e622c4a | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/data/FestivalData.ets | arkts | getFestivalsByType | 获取指定类型的节日 | public static getFestivalsByType(type: FestivalType): FestivalInfo[] {
return FestivalData.getAllFestivals().filter(festival => festival.type === type);
} | AST#method_declaration#Left public static getFestivalsByType AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left FestivalType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AS... | public static getFestivalsByType(type: FestivalType): FestivalInfo[] {
return FestivalData.getAllFestivals().filter(festival => festival.type === type);
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/data/FestivalData.ets#L252-L254 | 2de10215b72e87d3e1a43f209cfb464b1fcaab95 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/LazyImport/entry/src/main/ets/pages/middle.ets | arkts | c | 不推荐用法 | export { c, ns }; | AST#export_declaration#Left export { c , ns } ; AST#export_declaration#Right | export { c, ns }; | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/LazyImport/entry/src/main/ets/pages/middle.ets#L20-L20 | a77af9f6e54c713b6cd41592674cf5b339de5bc4 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/YAxis.ets | arkts | setZeroLineWidth | Sets the width of the zero line in vp
@param width | public setZeroLineWidth(width: number): void {
this.mZeroLineWidth = Utils.handleDataValues(width);
} | AST#method_declaration#Left public setZeroLineWidth AST#parameter_list#Left ( AST#parameter#Left width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary... | public setZeroLineWidth(width: number): void {
this.mZeroLineWidth = Utils.handleDataValues(width);
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/YAxis.ets#L402-L404 | 39c49e0269d60d2b36d6b735e094e587cf15fc05 | gitee |
JHB11Hinson/mineMointorAPP.git | b6b853cf534021ac39e66c9b3a35113896a272b2 | entry/src/main/ets/model/HomeModel.ets | arkts | handleWarning | 处理异常逻辑 | static async handleWarning(item: WarningItem, note: string): Promise<boolean> {
try {
// 上报历史记录
const newRecord: RecordItem = {
id: new Date().getTime(),
handler: "我 (安全员)",
source: item.source,
result: note,
time: new Date().toLocaleString()
};
// 显式... | AST#method_declaration#Left static async handleWarning AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left WarningItem AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left note : AST#type_annotation#Left AST#primary_type#Left string AST... | static async handleWarning(item: WarningItem, note: string): Promise<boolean> {
try {
const newRecord: RecordItem = {
id: new Date().getTime(),
handler: "我 (安全员)",
source: item.source,
result: note,
time: new Date().toLocaleString()
};
await R... | https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/model/HomeModel.ets#L126-L166 | 4decc6e9aba4e3bb8e158401bda34be707e58513 | github |
iichen-bycode/ArkTsWanandroid.git | ad128756a6c703d9a72cf7f6da128c27fc63bd00 | entry/src/main/ets/http/api.ets | arkts | 公众号作者下的文章
@param date
@returns | export function wxAuthorArticleList(id:number,page:number) {
return axiosClient.get<HomeArticleModel>({
url: `wxarticle/list/${id}/${page}/json`,
showLoading: page == 0
})
} | AST#export_declaration#Left export AST#function_declaration#Left function wxAuthorArticleList AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left page : AST#type_annotation#Left ... | export function wxAuthorArticleList(id:number,page:number) {
return axiosClient.get<HomeArticleModel>({
url: `wxarticle/list/${id}/${page}/json`,
showLoading: page == 0
})
} | https://github.com/iichen-bycode/ArkTsWanandroid.git/blob/ad128756a6c703d9a72cf7f6da128c27fc63bd00/entry/src/main/ets/http/api.ets#L146-L151 | 642f1b41f0906eb8afd7db8281defe8844c46eb4 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index_backup.ets | arkts | updateCustomTime | 更新自定义时间字符串 | private updateCustomTime(): void {
this.tempSettings.customTime =
`${this.selectedHour.toString().padStart(2, '0')}:${this.selectedMinute.toString().padStart(2, '0')}`;
} | AST#method_declaration#Left private updateCustomTime 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#Le... | private updateCustomTime(): void {
this.tempSettings.customTime =
`${this.selectedHour.toString().padStart(2, '0')}:${this.selectedMinute.toString().padStart(2, '0')}`;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index_backup.ets#L2071-L2074 | cf5e7a3c7670acdef5aa2894dc8c79918f6f4780 | github |
Puiching-Memory/HOMOAPP_Q5.git | 53e36a21984de7bf41b6fafc840fde013236b9d2 | entry/src/main/ets/model/AudioModel.ets | arkts | 动态信息 | export class Moment {
id: number = 0;
author: string = '';
avatar: string = '';
content: string = '';
comment: number = 0;
like: number = 0;
song: AudioItem = new AudioItem();
} | AST#export_declaration#Left export AST#class_declaration#Left class Moment AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#pro... | export class Moment {
id: number = 0;
author: string = '';
avatar: string = '';
content: string = '';
comment: number = 0;
like: number = 0;
song: AudioItem = new AudioItem();
} | https://github.com/Puiching-Memory/HOMOAPP_Q5.git/blob/53e36a21984de7bf41b6fafc840fde013236b9d2/entry/src/main/ets/model/AudioModel.ets#L27-L35 | e654661b2be1fa250877ce71d5fa13f146720c1a | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/datastore/src/main/ets/datasource/ordercache/OrderCacheStoreDataSourceImpl.ets | arkts | setSelectedGoodsList | 保存已选商品列表
@param {SelectedGoods[]} goodsList 已选商品列表
@returns {Promise<void>} Promise<void> | async setSelectedGoodsList(goodsList: SelectedGoods[]): Promise<void> {
const jsonStr: string = JSON.stringify(goodsList);
await this.prefs.set(OrderCacheStoreDataSourceImpl.KEY_SELECTED_GOODS_LIST, jsonStr);
} | AST#method_declaration#Left async setSelectedGoodsList AST#parameter_list#Left ( AST#parameter#Left goodsList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left SelectedGoods [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#... | async setSelectedGoodsList(goodsList: SelectedGoods[]): Promise<void> {
const jsonStr: string = JSON.stringify(goodsList);
await this.prefs.set(OrderCacheStoreDataSourceImpl.KEY_SELECTED_GOODS_LIST, jsonStr);
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/datastore/src/main/ets/datasource/ordercache/OrderCacheStoreDataSourceImpl.ets#L125-L128 | 7651d970b61ef276ed8139498159c0c836ca9940 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/utils/SimpleLunarCalendar.ets | arkts | 简化版农历计算器
基于权威天文数据,确保2025年计算准确性 | export class SimpleLunarCalendar {
// 2025年农历配置(基于中科院紫金山天文台数据)
private static readonly config2025: LunarConfig = {
year: 2025,
springFestivalDate: new Date(2025, 0, 29), // 2025年1月29日春节
months: [30, 29, 30, 29, 29, 30, 30, 29, 30, 30, 30, 29], // 正月(30)二月(29)三月(30)四月(29)五月(29)六月(30)七月(30)八月(29)九月(30)十月(... | AST#export_declaration#Left export AST#class_declaration#Left class SimpleLunarCalendar AST#class_body#Left { // 2025年农历配置(基于中科院紫金山天文台数据) AST#property_declaration#Left private static readonly config2025 : AST#type_annotation#Left AST#primary_type#Left LunarConfig AST#primary_type#Right AST#type_annotation#Right = AST#e... | export class SimpleLunarCalendar {
private static readonly config2025: LunarConfig = {
year: 2025,
springFestivalDate: new Date(2025, 0, 29),
months: [30, 29, 30, 29, 29, 30, 30, 29, 30, 30, 30, 29],
leapMonth: 6,
leapMonthDays: 29, 29天
totalDays: 384
};
private static readonly mont... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/utils/SimpleLunarCalendar.ets#L43-L181 | 1ac314a711194c4c4dd0bb00968558378b1517c3 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/networks/Server_Routes.ets | arkts | 获取指定路由的URL对象 注意:ArkTS/TypeScript中没有原生的URL类,通常使用字符串表示URL 如果需要URL处理,可以使用第三方库或平台提供的API | export function getRouteUrl(route: Route): string {
return Servers.getRouteAddress(route);
} | AST#export_declaration#Left export AST#function_declaration#Left function getRouteUrl AST#parameter_list#Left ( AST#parameter#Left route : AST#type_annotation#Left AST#primary_type#Left Route AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#p... | export function getRouteUrl(route: Route): string {
return Servers.getRouteAddress(route);
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/networks/Server_Routes.ets#L66-L68 | e1dcc9fce31b9952f686f5650033b8e270e7bc76 | github | |
softfatgay/harmony-netease.git | 5f3d226b72ba8579cacfbd229e4eb0054d63abef | entry/src/main/ets/base/Api.ets | arkts | /热销榜/条目 | export const HOT_LIST_LIST = baseUrl + '/xhr/item/saleRankItems.json'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HOT_LIST_LIST = AST#expression#Left AST#binary_expression#Left AST#expression#Left baseUrl AST#expression#Right + AST#expression#Left '/xhr/item/saleRankItems.json' AST#expression#Right AST#binary_expression#Right AST#ex... | export const HOT_LIST_LIST = baseUrl + '/xhr/item/saleRankItems.json'; | https://github.com/softfatgay/harmony-netease.git/blob/5f3d226b72ba8579cacfbd229e4eb0054d63abef/entry/src/main/ets/base/Api.ets#L25-L25 | a27a98922e33389f4d2efd1969c449f88363ebbc | github | |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/common/utils/StorageUtils.ets | arkts | clear | 清空所有数据 | static async clear(): Promise<void> {
const dataPreferences = StorageUtils.dataPreferences;
if (!dataPreferences) {
console.error('Preferences not initialized');
return;
}
try {
await dataPreferences.clear();
await dataPreferences.flush();
} catch (error) {
console.err... | AST#method_declaration#Left static async clear 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_arg... | static async clear(): Promise<void> {
const dataPreferences = StorageUtils.dataPreferences;
if (!dataPreferences) {
console.error('Preferences not initialized');
return;
}
try {
await dataPreferences.clear();
await dataPreferences.flush();
} catch (error) {
console.err... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/utils/StorageUtils.ets#L200-L213 | 5a56f6cedaba8fdd372f918f483e7ff0cbbe9161 | github |
zhuanyongtester/Cpay_arkts.git | 4402a8a06963d0757952513d3cbf7d5919ceb74f | entry/src/main/ets/pages/musicView/MusicPage.ets | arkts | musicColumn | 自定义音乐专栏 | @Builder
musicColumn(columnName: Resource) {
Row() {
Text(columnName)
.fontSize($r('app.float.mini_player_animation_music_column_font_size'))
.fontWeight(FontWeight.Bold)
Blank()
Text($r('app.string.mini_player_animation_music_column_more'))
.fontSize($r('app.float.mini_p... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right musicColumn AST#parameter_list#Left ( AST#parameter#Left columnName : 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#builder_function_... | @Builder
musicColumn(columnName: Resource) {
Row() {
Text(columnName)
.fontSize($r('app.float.mini_player_animation_music_column_font_size'))
.fontWeight(FontWeight.Bold)
Blank()
Text($r('app.string.mini_player_animation_music_column_more'))
.fontSize($r('app.float.mini_p... | https://github.com/zhuanyongtester/Cpay_arkts.git/blob/4402a8a06963d0757952513d3cbf7d5919ceb74f/entry/src/main/ets/pages/musicView/MusicPage.ets#L211-L255 | 721f5078380718aa1563f6ced076d5eee238bf6d | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customscan/src/main/ets/components/CommonCodeLayout.ets | arkts | vibratorPlay | 传感器震动 | vibratorPlay() {
try {
vibrator.startVibration({
type: 'time',
duration: 100
}, {
id: 0,
usage: 'alarm'
}).then((): void => {
}, (error: BusinessError) => {
logger.error(`Failed to start vibration. Code: ${error.code}, message: ${error.message}`);
... | AST#method_declaration#Left vibratorPlay AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_e... | vibratorPlay() {
try {
vibrator.startVibration({
type: 'time',
duration: 100
}, {
id: 0,
usage: 'alarm'
}).then((): void => {
}, (error: BusinessError) => {
logger.error(`Failed to start vibration. Code: ${error.code}, message: ${error.message}`);
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customscan/src/main/ets/components/CommonCodeLayout.ets#L217-L233 | b1f90875d7fb0365a3c8f87ecbb819220b43c599 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/controller/IndexController.ets | arkts | onRemoteAnswer | 对端接听 | onRemoteAnswer(): void {
Logger.info(TAG, `onRemoteAnswer`);
this.enterVoiceCall();
} | AST#method_declaration#Left onRemoteAnswer AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expressio... | onRemoteAnswer(): void {
Logger.info(TAG, `onRemoteAnswer`);
this.enterVoiceCall();
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/controller/IndexController.ets#L134-L137 | fff9de52d4b7d7a4ab45f6ad0ea1d93a1defca7e | gitee |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.Popup.d.ets | arkts | Defines the popup icon options
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@since 11
Defines the popup icon options
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export interface PopupIconOptions {
/**
* Set the icon image.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Set the icon image.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @cross... | AST#export_declaration#Left export AST#interface_declaration#Left interface PopupIconOptions AST#object_type#Left { /**
* Set the icon image.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/ /**
* Set the icon image.
* @type { Res... | export interface PopupIconOptions {
image: ResourceStr;
width?: Dimension;
height?: Dimension;
fillColor?: ResourceColor;
borderRadius?: Length | BorderRadiuses;
} | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.Popup.d.ets#L190-L271 | 54322eaf56891260f0a7c96c8e51133cac0fb4fe | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/perfermance/customreusablepool/src/main/ets/data/MockData.ets | arkts | 模拟数据图片资源列表 | export const banners1: Resource[] = [
$r('app.media.custom_reusable_text_expand_img1'),
$r('app.media.custom_reusable_text_expand_img2'),
$r('app.media.custom_reusable_text_expand_img3'),
$r('app.media.custom_reusable_text_expand_img4')
]; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left banners1 : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Resource [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expressi... | export const banners1: Resource[] = [
$r('app.media.custom_reusable_text_expand_img1'),
$r('app.media.custom_reusable_text_expand_img2'),
$r('app.media.custom_reusable_text_expand_img3'),
$r('app.media.custom_reusable_text_expand_img4')
]; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/customreusablepool/src/main/ets/data/MockData.ets#L19-L24 | 22ae1d0d229520dad6b8f74719f9334bb9047268 | gitee | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/utils/storage_tools.ets | arkts | Compress an image of the form arrayBuffer.
@param img_buffer The image arrayBuffer.
@param qua The quality.
@returns The compressed image buffer. | export async function compress_image_arrayBuffer(img_buffer: ArrayBuffer, qua: number = 10) {
let t = Date.now();
let compressed_buffer: ArrayBuffer = new ArrayBuffer(8);
// Compress image
let pictureObj: image.Picture = image.createPicture(arrayBuffer_2_pixelMap_sync(img_buffer));
await image.createImagePac... | AST#export_declaration#Left export AST#function_declaration#Left async function compress_image_arrayBuffer AST#parameter_list#Left ( AST#parameter#Left img_buffer : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left qua : ... | export async function compress_image_arrayBuffer(img_buffer: ArrayBuffer, qua: number = 10) {
let t = Date.now();
let compressed_buffer: ArrayBuffer = new ArrayBuffer(8);
let pictureObj: image.Picture = image.createPicture(arrayBuffer_2_pixelMap_sync(img_buffer));
await image.createImagePacker().packing(pic... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/storage_tools.ets#L797-L815 | 2a1107b456bd4a901cbaafc87cf78bf58d1dea5d | gitee | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.atomicservice.AtomicServiceWeb.d.ets | arkts | Error receive event when the web page receives a web resource loading error.
@typedef OnErrorReceiveEvent
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 12 | export declare interface OnErrorReceiveEvent {
/**
* Web resource request of event.
*
* @type { WebResourceRequest }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 12
*/
request: WebResourceRequest;
/**
* Web resource error of event.
*
* @type { WebResourceErr... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#interface_declaration#Left interface OnErrorReceiveEvent AST#object_type#Left { /**
* Web resource request of event.
*
* @type { WebResourceRequest }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 12
... | export declare interface OnErrorReceiveEvent {
request: WebResourceRequest;
error: WebResourceError;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.AtomicServiceWeb.d.ets#L204-L224 | fca00351ba86328990a9c8d52ea9ddbb0ee127fa | gitee | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/AxisBase.ets | arkts | getLongestLabel | Returns the longest formatted label (in terms of characters), this axis
contains.
@return | public getLongestLabel(): string {
var longest: string = '';
for (var i = 0; i < this.mEntries.length; i++) {
var text: string = this.getFormattedLabel(i);
if (text && text != null && longest.length < text.length) {
longest = text;
}
}
return longest;
} | AST#method_declaration#Left public getLongestLabel 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 var AST#variable_declarator#Left lo... | public getLongestLabel(): string {
var longest: string = '';
for (var i = 0; i < this.mEntries.length; i++) {
var text: string = this.getFormattedLabel(i);
if (text && text != null && longest.length < text.length) {
longest = text;
}
}
return longest;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/AxisBase.ets#L500-L510 | c22299fe27139240e063b8322593cfd52c86d04a | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/GameificationService.ets | arkts | 福利类型枚举 | export enum BenefitType {
EXTRA_POINTS = 'extra_points',
SPECIAL_THEMES = 'special_themes',
PRIORITY_SUPPORT = 'priority_support',
ADVANCED_FEATURES = 'advanced_features',
EXCLUSIVE_CONTENT = 'exclusive_content'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum BenefitType AST#enum_body#Left { AST#enum_member#Left EXTRA_POINTS = AST#expression#Left 'extra_points' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left SPECIAL_THEMES = AST#expression#Left 'special_themes' AST#expression#Right AST#enum_... | export enum BenefitType {
EXTRA_POINTS = 'extra_points',
SPECIAL_THEMES = 'special_themes',
PRIORITY_SUPPORT = 'priority_support',
ADVANCED_FEATURES = 'advanced_features',
EXCLUSIVE_CONTENT = 'exclusive_content'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L81-L87 | 480ddf65a2033d3598d4ff0dedaf0aa8833db5ef | github | |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/ActionsManager.ets | arkts | register | 应用约束2:通过Map维护actions而不是动态属性 | register(Action: any) { // 根据实际Action类型替换any
const actionKey = Action.name.replace(/Action$/, '');
this.actions.set(actionKey, new Action(this.client));
} | AST#method_declaration#Left register AST#parameter_list#Left ( AST#parameter#Left Action : AST#type_annotation#Left AST#primary_type#Left any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { // 根据实际Action类型替换any AST#statement#Left AST#variable_de... | register(Action: any) {
const actionKey = Action.name.replace(/Action$/, '');
this.actions.set(actionKey, new Action(this.client));
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/ActionsManager.ets#L42-L45 | 1ea4b71c5b7e59ce71c26d77c12aba9207f784ca | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/StickyHeaderList.ets | arkts | itemHead | 定义分组联系人数据集合contactsGroups数组 | @Builder
itemHead(text: string) {
// 列表分组的头部组件,对应联系人分组A、B等位置的组件
Text(text)
.fontSize(20)
.backgroundColor('#fff1f3f5')
.width('100%')
.padding(5)
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right itemHead AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left {... | @Builder
itemHead(text: string) {
Text(text)
.fontSize(20)
.backgroundColor('#fff1f3f5')
.width('100%')
.padding(5)
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/StickyHeaderList.ets#L61-L69 | eac50c33a32e748303009f75d91147bff3adaccd | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/LineDataSet.ets | arkts | disableDashedLine | Disables the line to be drawn in dashed mode. | public disableDashedLine(): void {
this.mDashPathEffect = null;
} | AST#method_declaration#Left public disableDashedLine 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#Le... | public disableDashedLine(): void {
this.mDashPathEffect = null;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineDataSet.ets#L217-L219 | a443efac6124388453516abf490271cb00386cd2 | gitee |
openharmony/update_update_app | 0157b7917e2f48e914b5585991e8b2f4bc25108a | feature/ota/src/main/ets/manager/OtaUpdateManager.ets | arkts | handleWant | 处理推送消息
@param want 推送数据
@param context 上下文 | public async handleWant(want: Want, context: common.Context): Promise<void> {
let action: string = want?.action ?? '';
if (await NotificationManager.handleAction(action, context)) {
this.log('handleWant:' + FormatUtils.stringify(want));
return;
}
let eventInfo = this.wantParser(want);
th... | AST#method_declaration#Left public async handleWant AST#parameter_list#Left ( AST#parameter#Left want : AST#type_annotation#Left AST#primary_type#Left Want AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_typ... | public async handleWant(want: Want, context: common.Context): Promise<void> {
let action: string = want?.action ?? '';
if (await NotificationManager.handleAction(action, context)) {
this.log('handleWant:' + FormatUtils.stringify(want));
return;
}
let eventInfo = this.wantParser(want);
th... | https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/manager/OtaUpdateManager.ets#L369-L382 | fbb9849c3993b57e06ebfb383d3cc6885adbeaf0 | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/structures/VoiceChannel.ets | arkts | get | 应用约束45: 显式返回类型 | get connection(): VoiceConnection | null {
const connection = this.guild.voiceConnection;
return connection?.channel.id === this.id ? connection : null;
}
get full(): boolean {
return this.userLimit > 0 && this.members.size >= this.userLimit;
} | AST#method_declaration#Left get AST#ERROR#Left connection AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left VoiceConnection AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_ann... | get connection(): VoiceConnection | null {
const connection = this.guild.voiceConnection;
return connection?.channel.id === this.id ? connection : null;
}
get full(): boolean {
return this.userLimit > 0 && this.members.size >= this.userLimit;
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/VoiceChannel.ets#L39-L46 | 0d8eda4bb9f9bbe063a433757770e573256061ed | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Speech/Recorder/SpeechRecordDbAccessor.ets | arkts | 表名 | export namespace Col {
export const text = "text"; | AST#export_declaration#Left export AST#ERROR#Left namespace Col { export AST#ERROR#Right AST#variable_declaration#Left const AST#variable_declarator#Left text = AST#expression#Left "text" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export namespace Col {
export const text = "text"; | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Speech/Recorder/SpeechRecordDbAccessor.ets#L16-L17 | 274bf9ff5847499f870eeac87626bb6a1ed5f78c | github | |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/pages/Settings.ets | arkts | getPath | 获取缓存路径 | getPath() {
// 获取原始密级
let area = this.context.area;
console.log('area', area)
let appArea = this.context.getApplicationContext().area
console.log('appArea', appArea)
// 暂时替换密级
this.context.area = contextConstant.AreaMode.EL2;
this.context.getApplicationContext().area = 1
let cacheD... | AST#method_declaration#Left getPath AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 获取原始密级 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left area = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#express... | getPath() {
let area = this.context.area;
console.log('area', area)
let appArea = this.context.getApplicationContext().area
console.log('appArea', appArea)
this.context.area = contextConstant.AreaMode.EL2;
this.context.getApplicationContext().area = 1
let cacheDir01 = ''
let ... | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/pages/Settings.ets#L574-L655 | 2f13eb73060d13ccbb27b9729a231a34f01125ab | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/RangeSeekBarView.ets | arkts | pointInArea | 区域判断 | pointInArea(x: number, y: number, area: Array<number>): boolean {
logger.info(TAG, ' x=' + x + ' y=' + y + ' area=' + area)
if (area.length == 4) {
if (x >= area[0] && x <= area[2]) {
return true;
} else {
return false;
}
} else {
return false;
}
} | AST#method_declaration#Left pointInArea AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#ty... | pointInArea(x: number, y: number, area: Array<number>): boolean {
logger.info(TAG, ' x=' + x + ' y=' + y + ' area=' + area)
if (area.length == 4) {
if (x >= area[0] && x <= area[2]) {
return true;
} else {
return false;
}
} else {
return false;
}
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/RangeSeekBarView.ets#L459-L471 | 56cf9b2d61645aae8611aaeb232f0a599f53208e | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Card/StepsCardJS/entry/src/main/ets/common/database/SensorData.ets | arkts | toValuesBucket | Gets the number of steps to insert a form.
@return Return steps. | toValuesBucket(): relationalStore.ValuesBucket {
return {
'date': this.date,
'stepsValue': this.stepsValue
};
} | AST#method_declaration#Left toValuesBucket AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . ValuesBucket AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left ... | toValuesBucket(): relationalStore.ValuesBucket {
return {
'date': this.date,
'stepsValue': this.stepsValue
};
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Card/StepsCardJS/entry/src/main/ets/common/database/SensorData.ets#L36-L41 | e0aa4debcbf5c46a8ca8772d4d6759ffc2572f60 | gitee |
openharmony/applications_settings | aac607310ec30e30d1d54db2e04d055655f72730 | common/component/src/main/ets/default/dialogComponent.ets | arkts | DialogButtonLayoutWithState | Standard dialog button layout, which contains two choices buttons.
@secondButtonState the click state of second button. | @Component
export struct DialogButtonLayoutWithState {
@Prop secondButtonState: boolean = true;
private firstTitle: string | Resource = $r("app.string.cancel");
private secondTitle: string | Resource = $r("app.string.add");
build() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct DialogButtonLayoutWithState AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right secondButtonState : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_... | @Component
export struct DialogButtonLayoutWithState {
@Prop secondButtonState: boolean = true;
private firstTitle: string | Resource = $r("app.string.cancel");
private secondTitle: string | Resource = $r("app.string.add");
build() {
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
... | https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/common/component/src/main/ets/default/dialogComponent.ets#L49-L91 | 25bc6ae59bd1033f6bcb9aadea224656d95e40e4 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/OHLayoutAlign/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | opacity of text | export const ATTRIBUTE_OPACITY: number = Number.parseFloat('0.6'); | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left ATTRIBUTE_OPACITY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST... | export const ATTRIBUTE_OPACITY: number = Number.parseFloat('0.6'); | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/OHLayoutAlign/entry/src/main/ets/common/constants/CommonConstants.ets#L54-L54 | f53720f1b8539ef9836332596bfe59fec564be4b | gitee | |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/viewmodel/SimpleStatsManager.ets | arkts | recordTaskCompletion | 记录任务完成 | recordTaskCompletion(completed: number, total: number): void {
this.loadRealTimeStats();
} | AST#method_declaration#Left recordTaskCompletion AST#parameter_list#Left ( AST#parameter#Left completed : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left total : AST#type_annotation#Left AST#primary_type#Left number AST#prim... | recordTaskCompletion(completed: number, total: number): void {
this.loadRealTimeStats();
} | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/SimpleStatsManager.ets#L85-L87 | 57cd4db938386fdfce58fe4a4b3c77f34656167d | github |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | NEXT/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets | arkts | hideKeyboard | 隐藏键盘函数 | hideKeyboard() {
let inputMethodController = inputMethod.getController();
//隐藏
inputMethodController.hideSoftKeyboard();
// 关闭
inputMethodController.stopInputSession();
} | AST#method_declaration#Left hideKeyboard AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left inputMethodController = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left A... | hideKeyboard() {
let inputMethodController = inputMethod.getController();
inputMethodController.hideSoftKeyboard();
inputMethodController.stopInputSession();
} | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets#L336-L342 | da17fb3024055de578d0a1d662cb6e4302d509c8 | gitee |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/model/QueueItem.ets | arkts | 播放队列项 | export class QueueItem {
id: string = '';
episodeId: string = '';
position: number = 0; // 队列中的位置
addedDate: number = 0; // 添加时间
} | AST#export_declaration#Left export AST#class_declaration#Left class QueueItem AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AST#property_declaration#Right AST... | export class QueueItem {
id: string = '';
episodeId: string = '';
position: number = 0;
addedDate: number = 0;
} | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/model/QueueItem.ets#L4-L9 | f8b10f0d1f30ccc522dfba8c3b132bca92a105fb | github | |
batiluoxuanwan/MomentFlow.git | e57aa461223abca74f48893afc2ccf7c2d73e9b8 | frontend/entry/src/main/ets/api/DiaryApi.ets | arkts | delete | 删除日记 | static async delete(id: number): Promise<boolean> {
// 后端现在返回的是 R<String>,所以泛型传 string
const res = await request<string>(`${BASE_URL}/${id}`, {
method: http.RequestMethod.DELETE
})
return res !== null
} | AST#method_declaration#Left static async delete AST#parameter_list#Left ( AST#parameter#Left id : 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 P... | static async delete(id: number): Promise<boolean> {
const res = await request<string>(`${BASE_URL}/${id}`, {
method: http.RequestMethod.DELETE
})
return res !== null
} | https://github.com/batiluoxuanwan/MomentFlow.git/blob/e57aa461223abca74f48893afc2ccf7c2d73e9b8/frontend/entry/src/main/ets/api/DiaryApi.ets#L86-L92 | 52a70b357166a2603cd5bd1e875067e4958c2dcf | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/sns/qq/QQLoginManager.ets | arkts | get | 单例模式 | public static get shared(): QQLoginManager {
if (!QQLoginManager.instance) {
QQLoginManager.instance = new QQLoginManager();
QQLoginManager.instance.init();
}
return QQLoginManager.instance;
} | AST#method_declaration#Left public static get AST#ERROR#Left shared AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left QQLoginManager AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_st... | public static get shared(): QQLoginManager {
if (!QQLoginManager.instance) {
QQLoginManager.instance = new QQLoginManager();
QQLoginManager.instance.init();
}
return QQLoginManager.instance;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/sns/qq/QQLoginManager.ets#L53-L59 | 4bc46d07211fed62583563749f18ed07047533ee | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/SignatureVerification/SigningSignatureVerificationArkTs/entry/src/main/ets/pages/rsa_pss_signature_verification/rsa_pss_signature_verification_asynchronous.ets | arkts | genRsa2048KeyPairSpec | 生成RSA2048密钥对参数 | function genRsa2048KeyPairSpec(): cryptoFramework.RSAKeyPairSpec {
let nIn =
BigInt('0x9260d0750ae117eee55c3f3deaba74917521a262ee76007cdf8a56755ad73a1598a1408410a01434c3f5bc54a88b57fa19fc432' +
'8daea0750a4c44e88cff3b2382621b80f670464433e4336e6d003e8cd65bff211da144b88291c2259a00a72b711c116ef7686e8fee34e4' +... | AST#function_declaration#Left function genRsa2048KeyPairSpec AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . RSAKeyPairSpec AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left {... | function genRsa2048KeyPairSpec(): cryptoFramework.RSAKeyPairSpec {
let nIn =
BigInt('0x9260d0750ae117eee55c3f3deaba74917521a262ee76007cdf8a56755ad73a1598a1408410a01434c3f5bc54a88b57fa19fc432' +
'8daea0750a4c44e88cff3b2382621b80f670464433e4336e6d003e8cd65bff211da144b88291c2259a00a72b711c116ef7686e8fee34e4' +... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/SignatureVerification/SigningSignatureVerificationArkTs/entry/src/main/ets/pages/rsa_pss_signature_verification/rsa_pss_signature_verification_asynchronous.ets#L37-L52 | d0c36d0d3fe27d5ef9ef0f8f82110839dda3b553 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/ToDoListArkTS/entry/src/main/ets/viewmodel/DataModel.ets | arkts | Saving and manipulating data displayed on the page. | export class DataModel {
/**
* Saved Data.
*/
private tasks: Array<string> = CommonConstants.TODO_DATA;
/**
* Get the data.
*/
getData(): Array<string> {
return this.tasks;
}
} | AST#export_declaration#Left export AST#class_declaration#Left class DataModel AST#class_body#Left { /**
* Saved Data.
*/ AST#property_declaration#Left private tasks : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left... | export class DataModel {
private tasks: Array<string> = CommonConstants.TODO_DATA;
getData(): Array<string> {
return this.tasks;
}
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/ToDoListArkTS/entry/src/main/ets/viewmodel/DataModel.ets#L21-L33 | d220f0c803f7057a6a727da5c12afc7e6bd1ba02 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.