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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/buffer/AbstractBuffer.ets | arkts | reset | Resets the buffer index to 0 and makes the buffer reusable. | public reset(): void {
this.index = 0;
} | AST#method_declaration#Left public reset 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#membe... | public reset(): void {
this.index = 0;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/buffer/AbstractBuffer.ets#L59-L61 | cb3019c534368b6de852ece38897b8ffdda64799 | gitee |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/viewmodel/SimpleNotificationManager.ets | arkts | getReminderSettings | 获取提醒设置 | getReminderSettings(): SimpleReminderSettings {
return this.reminderSettings;
} | AST#method_declaration#Left getReminderSettings AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left SimpleReminderSettings AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left... | getReminderSettings(): SimpleReminderSettings {
return this.reminderSettings;
} | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/SimpleNotificationManager.ets#L138-L140 | cf4e2d778d467f90b564c9d6c5c3e745830c8787 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customanimationtab/Index.ets | arkts | CustomAnimationTab | 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 { 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/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/Index.ets#L15-L15 | 4fabd84f915ab1927727f77b8704391a3554c084 | gitee |
chongzi/Lucky-ArkTs.git | 84fc104d4a68def780a483e2543ebf9f53e793fd | entry/src/main/ets/model/OfferModel.ets | arkts | getTotalCompensation | 获取总包薪资 | getTotalCompensation(): number {
let total = this.annualSalary || this.baseSalary;
total += this.bonus;
return total;
} | AST#method_declaration#Left getTotalCompensation AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left tota... | getTotalCompensation(): number {
let total = this.annualSalary || this.baseSalary;
total += this.bonus;
return total;
} | https://github.com/chongzi/Lucky-ArkTs.git/blob/84fc104d4a68def780a483e2543ebf9f53e793fd/entry/src/main/ets/model/OfferModel.ets#L174-L178 | 14ed6de7e05dd2af89827cd072681724fd507d7f | github |
tomorrowKreswell/Ledger.git | 1f2783ae70b8540d677af8a27f29db1b4089ea69 | ledger/entry/src/main/ets/common/beans/ClassifiedStatistic.ets | arkts | 导出一个名为 ClassifiedStatistic 的类,用于表示记账应用中的分类统计信息 | export default class ClassifiedStatistic {
// 类型文本,用于描述统计项的类型
typeText: string = '';
// 账目类型,0 表示支出,1 表示收入
accountType: number = 0;
// 金额,表示该类型下的账目总金额,初始为0
amount: number = 0;
// 账目数量,表示该类型下的账目数量,初始为0
count: number = 0;
// 构造函数,用于创建 ClassifiedStatistic 类的实例
constructor(typeText: string, accountT... | AST#export_declaration#Left export default AST#class_declaration#Left class ClassifiedStatistic AST#class_body#Left { // 类型文本,用于描述统计项的类型 AST#property_declaration#Left typeText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression... | export default class ClassifiedStatistic {
typeText: string = '';
accountType: number = 0;
amount: number = 0;
count: number = 0;
constructor(typeText: string, accountType: number, amount: number = 0, count: number = 0) {
this.typeText = typeText;
this.accountType = accountType... | https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/common/beans/ClassifiedStatistic.ets#L2-L23 | 1cc2511d94340e8173004058a5cb67141be39122 | github | |
JHB11Hinson/mineMointorAPP.git | b6b853cf534021ac39e66c9b3a35113896a272b2 | entry/src/main/ets/common/utils/HttpUtil.ets | arkts | put | PUT 请求 | static async put<T>(url: string, data: Record<string, string | number | boolean>): Promise<T> {
return HttpUtil.request<T>(url, http.RequestMethod.PUT, data);
} | AST#method_declaration#Left static async put AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#R... | static async put<T>(url: string, data: Record<string, string | number | boolean>): Promise<T> {
return HttpUtil.request<T>(url, http.RequestMethod.PUT, data);
} | https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/common/utils/HttpUtil.ets#L16-L18 | 22ca92515ae073e8f6be618c77a512dac4793bcb | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/app/views/CircleView.ets | arkts | ========== 构建视图 ========== | build() {
Row() {
// 左侧 Canvas 绘图
Canvas(this.ctx)
.width('auto')
.height('100%')
.onReady(() => { try { this.drawCanvas(); } catch(e) {} })
// 图例
if (this.showInfo) {
Column({ space: 8 }) {
ForEach(this.parts, (part: GraphPart) => {
Row... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { // 左侧 Canvas 绘图 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Canvas ( AST#expression#Left AST#member_ex... | build() {
Row() {
Canvas(this.ctx)
.width('auto')
.height('100%')
.onReady(() => { try { this.drawCanvas(); } catch(e) {} })
if (this.showInfo) {
Column({ space: 8 }) {
ForEach(this.parts, (part: GraphPart) => {
Row({ space: 8 }) {
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/CircleView.ets#L48-L78 | b3ff63facc938837972080e45844a23e2ea273d7 | github | |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/ciphers/HillCipher.ets | arkts | encrypt | 加密文本
@param text 要加密的文本
@param key 2x2密钥矩阵
@returns 加密后的文本 | static encrypt(text: string, key: number[][]): string {
// 确保文本长度为偶数
if (text.length % 2 !== 0) {
text += 'X';
}
let result = '';
for (let i = 0; i < text.length; i += 2) {
const char1 = text.charCodeAt(i) - 'A'.charCodeAt(0);
const char2 = text.charCodeAt(i + 1) - 'A'.charCodeAt(... | AST#method_declaration#Left static encrypt 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#Left key : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [... | static encrypt(text: string, key: number[][]): string {
if (text.length % 2 !== 0) {
text += 'X';
}
let result = '';
for (let i = 0; i < text.length; i += 2) {
const char1 = text.charCodeAt(i) - 'A'.charCodeAt(0);
const char2 = text.charCodeAt(i + 1) - 'A'.charCodeAt(0);
... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/ciphers/HillCipher.ets#L87-L113 | f7137df7c261bb32c4c5c609529cb392c76058ba | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plancurve/Plan.ets | arkts | deleteLearn | / 删除此plan的Learn | async deleteLearn(): Promise<void> {
await PlanManager.deleteLearnForPlan(this);
} | AST#method_declaration#Left async deleteLearn AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_argu... | async deleteLearn(): Promise<void> {
await PlanManager.deleteLearnForPlan(this);
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L508-L510 | 9fdaa6e72d310b2a1723c2195c45744716cb09f8 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ar/ARCardService.ets | arkts | 碰撞形状枚举 | export enum CollisionShape {
BOX = 'box',
SPHERE = 'sphere',
CAPSULE = 'capsule',
MESH = 'mesh'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum CollisionShape AST#enum_body#Left { AST#enum_member#Left BOX = AST#expression#Left 'box' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left SPHERE = AST#expression#Left 'sphere' AST#expression#Right AST#enum_member#Right , AST#enum_member#... | export enum CollisionShape {
BOX = 'box',
SPHERE = 'sphere',
CAPSULE = 'capsule',
MESH = 'mesh'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L167-L172 | e3f18b361527ad2c6717c8de9a27d1bc3d45dce8 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customscan/src/main/ets/components/CommonCodeLayout.ets | arkts | aboutToAppear | 成功扫描二维码的提示音 | aboutToAppear() {
// 触发传感器震动
this.vibratorPlay();
// 播放二维码扫描成功提示音
this.avplayerPlay();
// 处理扫码结果信息
for (let i = 0; i < this.scanResults.size; i++) {
let scanResult: scanBarcode.ScanResult = this.scanResults.data[i];
this.multiCodeScanResult.push(scanResult);
let scanCodeRect: s... | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 触发传感器震动 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right ... | aboutToAppear() {
this.vibratorPlay();
this.avplayerPlay();
for (let i = 0; i < this.scanResults.size; i++) {
let scanResult: scanBarcode.ScanResult = this.scanResults.data[i];
this.multiCodeScanResult.push(scanResult);
let scanCodeRect: scanBarcode.ScanCodeRect | undefined ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customscan/src/main/ets/components/CommonCodeLayout.ets#L74-L102 | fc0d4559b084c27aa12d10521786d4233865a41e | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets | arkts | [EndExclude respond_to_scroll_position] | build() {
// [StartExclude respond_to_scroll_position]
NavDestination() {
Column({ space: 12 }) {
ComponentCard({ title: $r('app.string.ResponsiveScrollPositionList_titleExample') }) {
// [EndExclude use_stack]
Stack({ alignContent: Alignment.End }) {
// 此为响应滚动位置示例L... | AST#build_method#Left build ( ) AST#build_body#Left { // [StartExclude respond_to_scroll_position] AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left NavDestination ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Co... | build() {
NavDestination() {
Column({ space: 12 }) {
ComponentCard({ title: $r('app.string.ResponsiveScrollPositionList_titleExample') }) {
Stack({ alignContent: Alignment.End }) {
List({ scroller: this.listScroller }) {
F... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/ResponsiveScrollPositionList.ets#L124-L175 | 6447be0b5d223eb58e1bb0ec04fedf7dc5f29d50 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/LanguageSettingsPage.ets | arkts | getLanguageInfo | 获取语言信息 | private getLanguageInfo(language: SupportedLanguage): LanguageInfo | undefined {
return this.supportedLanguages.find(lang => lang.code === language);
} | AST#method_declaration#Left private getLanguageInfo AST#parameter_list#Left ( AST#parameter#Left language : AST#type_annotation#Left AST#primary_type#Left SupportedLanguage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#... | private getLanguageInfo(language: SupportedLanguage): LanguageInfo | undefined {
return this.supportedLanguages.find(lang => lang.code === language);
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LanguageSettingsPage.ets#L639-L641 | 14151ec7c171c1aae72781550f26740a81924f39 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/decompressfile/src/main/ets/model/FileListDataSource.ets | arkts | clearData | 清空数据 | public clearData(): void {
this.fileList = [];
this.notifyDataReload();
} | AST#method_declaration#Left public clearData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#m... | public clearData(): void {
this.fileList = [];
this.notifyDataReload();
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/decompressfile/src/main/ets/model/FileListDataSource.ets#L56-L59 | 86e6628a4bce33a2b34ecea29702694dbe777123 | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Description.ets | arkts | getTextAlign | Returns the text alignment of the description.
@return | public getTextAlign(): TextAlign {
return this.mTextAlign;
} | AST#method_declaration#Left public getTextAlign AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left TextAlign AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_e... | public getTextAlign(): TextAlign {
return this.mTextAlign;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Description.ets#L98-L100 | ab5ad131064691aa7ce96b069ac6353cc30c1867 | gitee |
openharmony/bundlemanager_bundle_framework | 89882654172b6bfba2a4a1ebfacdd6c9296f6f21 | interfaces/kits/ani/shortcut_manager/ets/bundleManager/ShortcutInfo.ets | arkts | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export interface ShortcutInfo {
id: string;
bundleName: string;
moduleName?: string;
hostAbility?: string;
icon?: string;
iconId?: number;
label?: string;
labelId?: number;
wants?: Array<ShortcutWant>;
appIndex: number;
sourceType: number;
visible?: boolean;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ShortcutInfo 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 bundleName : AST#type_annotation#L... | export interface ShortcutInfo {
id: string;
bundleName: string;
moduleName?: string;
hostAbility?: string;
icon?: string;
iconId?: number;
label?: string;
labelId?: number;
wants?: Array<ShortcutWant>;
appIndex: number;
sourceType: number;
visible?: boolean;
} | https://github.com/openharmony/bundlemanager_bundle_framework/blob/89882654172b6bfba2a4a1ebfacdd6c9296f6f21/interfaces/kits/ani/shortcut_manager/ets/bundleManager/ShortcutInfo.ets#L16-L29 | a8c5cb9fecb15f650caf6fe955821f139f0e35f1 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/CommonTypes.ets | arkts | 版本信息接口 | export interface VersionInfo {
version: string;
buildNumber: string;
releaseDate: string;
features: string[];
bugFixes: string[];
} | AST#export_declaration#Left export AST#interface_declaration#Left interface VersionInfo AST#object_type#Left { AST#type_member#Left version : 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 buildNumber : AST#type_annotat... | export interface VersionInfo {
version: string;
buildNumber: string;
releaseDate: string;
features: string[];
bugFixes: string[];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/CommonTypes.ets#L191-L197 | 1a9f8f89e87df736a5d822dfdd4fd290d52174ce | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/media/VoiceService.ets | arkts | recognizeSpeech | 语音识别 | async recognizeSpeech(audioPath?: string): Promise<RecognitionResult> {
if (!this.recognizer) {
throw new Error('语音识别引擎未初始化');
}
try {
const startTime = Date.now();
// 如果没有提供音频文件,则使用实时识别
let result: any;
if (audioPath) {
result = await this.recognizer.recognizeFile(au... | AST#method_declaration#Left async recognizeSpeech AST#parameter_list#Left ( AST#parameter#Left audioPath ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_... | async recognizeSpeech(audioPath?: string): Promise<RecognitionResult> {
if (!this.recognizer) {
throw new Error('语音识别引擎未初始化');
}
try {
const startTime = Date.now();
let result: any;
if (audioPath) {
result = await this.recognizer.recognizeFile(audioPath);
} els... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/media/VoiceService.ets#L338-L373 | 7b0c21bd6e3f8a63fa39a455c833b7a1b656cfe2 | github |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/services/FlawService.ets | arkts | delFlaw | 删除故障
@param id 故障ID
@returns 删除结果 | static async delFlaw(id: number): Promise<ApiResponse<object>> {
try {
console.info(`[FlawService] 🗑️ 删除故障,ID: ${id}`);
const response = await HttpUtil.delete(`/agv/flaw/${id}`);
console.info('[FlawService] ✅ 故障删除成功');
const result: ApiResponse<object> = {
code: response.code,
... | AST#method_declaration#Left static async delFlaw 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 ... | static async delFlaw(id: number): Promise<ApiResponse<object>> {
try {
console.info(`[FlawService] 🗑️ 删除故障,ID: ${id}`);
const response = await HttpUtil.delete(`/agv/flaw/${id}`);
console.info('[FlawService] ✅ 故障删除成功');
const result: ApiResponse<object> = {
code: response.code,
... | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/FlawService.ets#L159-L174 | 64d32da17847dbd31016d5ffdcb926e880cc98eb | github |
huangwei021230/HarmonyFlow.git | 427f918873b0c9efdc975ff4889726b1bfccc546 | entry/src/main/ets/lib/Pointer.ets | arkts | hasNext | Checks if there are more elements to iterate over.
@returns True if there are more elements, otherwise false. | hasNext(): boolean {
do {
if (this.pointerMap.getPointer(this.index) != null) {
return true;
} | AST#method_declaration#Left hasNext AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#ERROR#Left AST#expression_statement#Left AST#expression#Left do AST#expression#Right AST#expre... | hasNext(): boolean {
do {
if (this.pointerMap.getPointer(this.index) != null) {
return true;
} | https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/lib/Pointer.ets#L137-L141 | d503bc6b9d64516a2d38442dbf74369eea6889e6 | github |
851432669/Smart-Home-ArkTs-Hi3861.git | 0451f85f072ed3281cc23d9cdc2843d79f60f975 | entry/src/main/ets/common/utils/MQTTUtil.ets | arkts | scheduleReconnect | 安排自动重连 | private scheduleReconnect(): void {
// 如果已达到最大重连次数,停止重连
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
console.error(`已达到最大重连次数(${this.maxReconnectAttempts}),停止重连`);
return;
}
// 清除可能存在的定时器
if (this.reconnectTimer !== -1) {
clearTimeout(this.reconnectTimer);
}
... | AST#method_declaration#Left private scheduleReconnect AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // 如果已达到最大重连次数,停止重连 AST#statement#Left AST#if_statement#Left if ( AST#expression#Le... | private scheduleReconnect(): void {
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
console.error(`已达到最大重连次数(${this.maxReconnectAttempts}),停止重连`);
return;
}
if (this.reconnectTimer !== -1) {
clearTimeout(this.reconnectTimer);
}
const delay = this... | https://github.com/851432669/Smart-Home-ArkTs-Hi3861.git/blob/0451f85f072ed3281cc23d9cdc2843d79f60f975/entry/src/main/ets/common/utils/MQTTUtil.ets#L152-L183 | 5352245cd7c0f75aa44add87f434ad63b92665b0 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/containernestedslide/src/main/ets/view/Scroller.ets | arkts | customBuilder3 | 定义List的builder方法 | @Builder customBuilder3() {} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customBuilder3 AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right | @Builder customBuilder3() {} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/containernestedslide/src/main/ets/view/Scroller.ets#L45-L45 | 56daa6d15976021a09066158f7823cec62384b7e | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Distributed/HandleGameApplication/GameEtsOpenHarmony/entry/src/main/ets/MainAbility/pages/index.ets | arkts | connectRemoteService | 连接远端Service | async function connectRemoteService(deviceId) {
// 连接成功的回调
async function onConnectCallback(element, remote) {
console.log('[game]connectRemoteService onConnectCallback:' + remote)
mRemote = remote;
}
// Service异常死亡的回调
function onDisconnectCallback(element) {
console.log('[game]connectRemoteServic... | AST#function_declaration#Left async function connectRemoteService AST#parameter_list#Left ( AST#parameter#Left deviceId AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { // 连接成功的回调 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#function_expression#Left async function on... | async function connectRemoteService(deviceId) {
async function onConnectCallback(element, remote) {
console.log('[game]connectRemoteService onConnectCallback:' + remote)
mRemote = remote;
}
function onDisconnectCallback(element) {
console.log('[game]connectRemoteService onDisconnectCallback')
... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/HandleGameApplication/GameEtsOpenHarmony/entry/src/main/ets/MainAbility/pages/index.ets#L60-L100 | c9e370df2a9026f38ab4a9587a4ec65805c9cb7d | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/charts/BarLineChartBaseModel.ets | arkts | Base-class of LineChart, BarChart, ScatterChart and CandleStickChart. | export default abstract class BarLineChartBaseModel<T extends BarLineScatterCandleBubbleData<IBarLineScatterCandleBubbleDataSet<EntryOhos>>>
extends Chart<T> implements BarLineScatterCandleBubbleDataProvider {
/**
* the maximum number of entries to which values will be drawn
* (entry numbers greater than this v... | AST#export_declaration#Left export default AST#ERROR#Left abstract class BarLineChartBaseModel AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left BarLineScatterCandleBubbleData AST#type_arguments#Left < AST#type_annotation#Left AST#primary_t... | export default abstract class BarLineChartBaseModel<T extends BarLineScatterCandleBubbleData<IBarLineScatterCandleBubbleDataSet<EntryOhos>>>
extends Chart<T> implements BarLineScatterCandleBubbleDataProvider {
protected mMaxVisibleCount: number = 100;
protected mAutoScaleMinMaxEnabled: boolean = false;
p... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/BarLineChartBaseModel.ets#L53-L564 | 88489d3f9b9a84c8517cda2040a73e3ff284f297 | gitee | |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/datatype/collections/queue_001_T.ets | arkts | Introduction 集合-队列类型 | export function queue_001_T(taint_src : Queue<string>) {
taint.Sink(taint_src);
} | AST#export_declaration#Left export AST#function_declaration#Left function queue_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Queue AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right... | export function queue_001_T(taint_src : Queue<string>) {
taint.Sink(taint_src);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/datatype/collections/queue_001_T.ets#L6-L8 | bec2692588a96f00c774611d68f1848e94f4059b | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/dbUtils/DBAccessor.ets | arkts | 数据库访问工具类
封装HarmonyOS relationalStore操作,提供安全易用的数据库访问接口
注意:所有数据库操作完成后会自动关闭连接,无需手动管理 | export class DBAccessor {
// MARK: - 成员变量
/** 主数据库文件路径(示例:'/data/app/main.db') */
private dbPath: string | null;
/** 需要附加的数据库路径列表(示例:['/data/app/user.db']) */
private attachPaths: Array<string | null> | null;
private isReadOnly: boolean = true
/** 数据库连接实例(使用后会自动关闭) */
private rdbStore: relationalSto... | AST#export_declaration#Left export AST#class_declaration#Left class DBAccessor AST#class_body#Left { // MARK: - 成员变量 /** 主数据库文件路径(示例:'/data/app/main.db') */ AST#property_declaration#Left private dbPath : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#... | export class DBAccessor {
private dbPath: string | null;
private attachPaths: Array<string | null> | null;
private isReadOnly: boolean = true
private rdbStore: relationalStore.RdbStore | null = null;
private isInitialized = false;
constructor(dbPath: string | null, attachPaths: A... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/dbUtils/DBAccessor.ets#L24-L406 | 9409ac4e5cf14f28bf4c9f8873375dd83fef6615 | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/SHA.ets | arkts | hmacSegment | 消息认证码计算,分段,异步
@param data 传入的消息
@param algName 指定摘要算法(SHA1、SHA224、SHA256、SHA384、SHA512)。
@param symKey 共享对称密钥。
@param resultCoding 摘要的编码方式(base64/hex),默认不传为hex。
@param len 自定义的数据拆分长度 | static async hmacSegment(data: string, algName: crypto.SHA = 'SHA256', symKey: cryptoFramework.SymKey = SHA.symKey,
resultCoding: crypto.BhCoding = 'hex', len: number = 120): Promise<string> {
return CryptoUtil.hmacSegment(data, algName, symKey, resultCoding, len);
} | AST#method_declaration#Left static async hmacSegment AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left algName : AST#type_annotation#Left AST#primary_type#Left AST#qualified_... | static async hmacSegment(data: string, algName: crypto.SHA = 'SHA256', symKey: cryptoFramework.SymKey = SHA.symKey,
resultCoding: crypto.BhCoding = 'hex', len: number = 120): Promise<string> {
return CryptoUtil.hmacSegment(data, algName, symKey, resultCoding, len);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SHA.ets#L115-L118 | f942bec3e47da9c9a1da062db11f2878d88cc4a0 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/navigation/src/main/ets/user/UserNavigator.ets | arkts | toAddressDetail | 跳转到收货地址详情
@param {boolean} isEditMode - 是否为编辑模式(默认 false)
@param {number} addressId - 地址 ID(0表示新增,默认 0)
@returns {Promise<RefreshResult | undefined>} 返回结果 Promise | static toAddressDetail(isEditMode: boolean = false, addressId: number = 0): Promise<RefreshResult | undefined> {
const params: UserAddressDetailParam = { isEditMode, addressId };
return navigateToForResult<RefreshResult>(UserRoutes.AddressDetail, params);
} | AST#method_declaration#Left static toAddressDetail AST#parameter_list#Left ( AST#parameter#Left isEditMode : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#par... | static toAddressDetail(isEditMode: boolean = false, addressId: number = 0): Promise<RefreshResult | undefined> {
const params: UserAddressDetailParam = { isEditMode, addressId };
return navigateToForResult<RefreshResult>(UserRoutes.AddressDetail, params);
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/user/UserNavigator.ets#L36-L39 | 3a17e3aa2f52879942e9138cc108fbfd2063af88 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/util/src/main/ets/image/ImageUtil.ets | arkts | base64ToPixelMap | base64转PixelMap
@param {string} base64 图片base64字符串
@returns {Promise<image.PixelMap>} 返回图像的PixelMap对象 | static async base64ToPixelMap(base64: string): Promise<image.PixelMap> {
const reg: RegExp = new RegExp('data:image/\\w+;base64,');
const base64Str: string = base64.replace(reg, '');
const base64Helper: util.Base64Helper = new util.Base64Helper();
const uint8Array: Uint8Array = base64Helper.decodeSync(b... | AST#method_declaration#Left static async base64ToPixelMap AST#parameter_list#Left ( AST#parameter#Left base64 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#gener... | static async base64ToPixelMap(base64: string): Promise<image.PixelMap> {
const reg: RegExp = new RegExp('data:image/\\w+;base64,');
const base64Str: string = base64.replace(reg, '');
const base64Helper: util.Base64Helper = new util.Base64Helper();
const uint8Array: Uint8Array = base64Helper.decodeSync(b... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/util/src/main/ets/image/ImageUtil.ets#L81-L89 | 17333788da3da8d8db4837d913662a27b5a49e72 | github |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/model/Task.ets | arkts | Task insert/update data | export interface TaskData {
title: string;
due_time: number;
is_done: number;
created_at: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface TaskData AST#object_type#Left { AST#type_member#Left title : 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 due_time : AST#type_annotation#Left... | export interface TaskData {
title: string;
due_time: number;
is_done: number;
created_at: number;
} | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/Task.ets#L20-L25 | c84dc6787ccd9f2f587b1e93d81b569dcbc69384 | github | |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/proxy/ConfirmBuilderProxy.ets | arkts | secondaryTitle | 弹窗副标题
@param title
@returns | secondaryTitle(secondaryTitle: ResourceStr) {
(this.builderOptions as IAlertDialogOptions).secondaryTitle = secondaryTitle;
return this;
} | AST#method_declaration#Left secondaryTitle AST#parameter_list#Left ( AST#parameter#Left secondaryTitle : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression... | secondaryTitle(secondaryTitle: ResourceStr) {
(this.builderOptions as IAlertDialogOptions).secondaryTitle = secondaryTitle;
return this;
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/ConfirmBuilderProxy.ets#L29-L32 | 6c9644af92c094da3cc5dcc40aba4ec203f796b1 | github |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets | arkts | setAndLink | Called when a hyperlink is set.
@since 10 | static setAndLink<T>(propName: string, defaultValue: T): SubscribedAbstractProperty<T> {
return StorageMap.shared.setAndLink(propName, defaultValue)
} | AST#method_declaration#Left static setAndLink AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#param... | static setAndLink<T>(propName: string, defaultValue: T): SubscribedAbstractProperty<T> {
return StorageMap.shared.setAndLink(propName, defaultValue)
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L76-L78 | d50699afc4667e253b6dcaf6e32f32500a7a9beb | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/SearchPage.ets | arkts | buildContactResults | 构建联系人搜索结果 | @Builder
buildContactResults() {
Column({ space: 12 }) {
Text(`联系人 (${this.searchResult.contacts.length})`)
.fontSize(16)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.alignSelf(ItemAlign.Start)
Column({ space: 1 }) {
ForEach(this.searchResult.con... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContactResults AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component... | @Builder
buildContactResults() {
Column({ space: 12 }) {
Text(`联系人 (${this.searchResult.contacts.length})`)
.fontSize(16)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.alignSelf(ItemAlign.Start)
Column({ space: 1 }) {
ForEach(this.searchResult.con... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/SearchPage.ets#L437-L475 | 9ed7aa129b8e68178fde3a947f020aeceb2be52a | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/UniversalKeystoreKit/KeyProving/DevelopmentGuidelines/NonanonymousKeyProof/entry/src/main/ets/pages/NonAnonymousKeyProof.ets | arkts | attestKeyItem | 4.证明密钥 | function attestKeyItem(keyAlias: string, huksOptions: huks.HuksOptions, throwObject: ThrowObject) {
return new Promise<huks.HuksReturnResult>((resolve, reject) => {
try {
huks.attestKeyItem(keyAlias, huksOptions, (error, data) => {
if (error) {
reject(error);
} else {
res... | AST#function_declaration#Left function attestKeyItem AST#parameter_list#Left ( AST#parameter#Left keyAlias : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left huksOptions : AST#type_annotation#Left AST#primary_type#Left AST#qu... | function attestKeyItem(keyAlias: string, huksOptions: huks.HuksOptions, throwObject: ThrowObject) {
return new Promise<huks.HuksReturnResult>((resolve, reject) => {
try {
huks.attestKeyItem(keyAlias, huksOptions, (error, data) => {
if (error) {
reject(error);
} else {
res... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/UniversalKeystoreKit/KeyProving/DevelopmentGuidelines/NonanonymousKeyProof/entry/src/main/ets/pages/NonAnonymousKeyProof.ets#L139-L154 | b108477e0395a8bcb4aacc48f950b285bc2f8f1e | gitee |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/viewmodel/MainViewModel.ets | arkts | analyzeEmotion | 分析用户消息的情绪
@param message - 用户消息
@returns 情绪类型和强度 | private analyzeEmotion(message: string): EmotionAnalysisResult {
const text = message.toLowerCase();
// 开心/兴奋的关键词
const happyKeywords = ['哈哈', '😊', '😄', '开心', '高兴', '太好了', '棒', '赞', '喜欢', '爱', '谢谢', '感谢'];
const excitedKeywords = ['!!', '哇', '太棒了', '厉害', '牛', '酷', '🎉', '激动'];
// 悲伤的关键词
cons... | AST#method_declaration#Left private analyzeEmotion AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left EmotionAnalysis... | private analyzeEmotion(message: string): EmotionAnalysisResult {
const text = message.toLowerCase();
const happyKeywords = ['哈哈', '😊', '😄', '开心', '高兴', '太好了', '棒', '赞', '喜欢', '爱', '谢谢', '感谢'];
const excitedKeywords = ['!!', '哇', '太棒了', '厉害', '牛', '酷', '🎉', '激动'];
const sadKeywords = ['难过'... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/viewmodel/MainViewModel.ets#L181-L246 | 49e056580a52f370b356c53e0aabf2bbc91e2215 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/FlexLayout/entry/src/main/ets/common/constants/StyleConstants.ets | arkts | Style constants for all Component. | export default class StyleConstants {
/**
* Font weight.
*/
static readonly FONT_WEIGHT: number = 500;
/**
* One hundred percent.
*/
static readonly FULL_PERCENT: string = '100%';
/**
* Recent text height.
*/
static readonly RECENT_TEXT_HEIGHT: string = '2.7%';
/**
* Recent text wi... | AST#export_declaration#Left export default AST#class_declaration#Left class StyleConstants AST#class_body#Left { /**
* Font weight.
*/ AST#property_declaration#Left static readonly FONT_WEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression... | export default class StyleConstants {
static readonly FONT_WEIGHT: number = 500;
static readonly FULL_PERCENT: string = '100%';
static readonly RECENT_TEXT_HEIGHT: string = '2.7%';
static readonly RECENT_TEXT_WIDTH: string = '48.9%';
static readonly DELETE_IMAGE_HEIGHT: string = '4%';
... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/FlexLayout/entry/src/main/ets/common/constants/StyleConstants.ets#L19-L119 | c56e848cf5e05e21f95dc7cc62e59958acca11db | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SuperFeature/DistributedAppDev/DistributedFilemanager/Library/src/main/ets/mock/local/FileData.ets | arkts | 文件价\文件结构 | export class FileStructure {
// 名字
public name: string = "";
// 时间
public time: string = "";
// 子文件数量
public childrenNum?: number
// 数据类型 1:文件夹、2:文件
public type: number = 0;
// 文件大小
public size?: string
// 处理日期格式
private dateFormat(time: Date): string {
let date = time;
let year = date.g... | AST#export_declaration#Left export AST#class_declaration#Left class FileStructure AST#class_body#Left { // 名字 AST#property_declaration#Left public name : 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_de... | export class FileStructure {
public name: string = "";
public time: string = "";
public childrenNum?: number
public type: number = 0;
public size?: string
private dateFormat(time: Date): string {
let date = time;
let year = date.getFullYear();
let month: string | number = date.... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SuperFeature/DistributedAppDev/DistributedFilemanager/Library/src/main/ets/mock/local/FileData.ets#L17-L55 | e2780a30f25935e9ffe4efb2ff514944bab528c1 | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/videocache/src/main/ets/model/VideoPlayerManager.ets | arkts | setAVPlayerCallback | 状态机函数,监听视频状态
@param callback 回调函数
@returns | async setAVPlayerCallback(callback: (avPlayer: media.AVPlayer) => void): Promise<void> {
logger.info(TAG, `setAVPlayerCallback start`);
if (this.avPlayer === null) {
logger.info(TAG, 'avPlayer has not init');
return;
}
// seek操作结果回调函数
this.avPlayer.on('seekDone', (seekDoneTime) => {
... | AST#method_declaration#Left async setAVPlayerCallback AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left avPlayer : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left media . AVPlayer AST#qualified_type... | async setAVPlayerCallback(callback: (avPlayer: media.AVPlayer) => void): Promise<void> {
logger.info(TAG, `setAVPlayerCallback start`);
if (this.avPlayer === null) {
logger.info(TAG, 'avPlayer has not init');
return;
}
this.avPlayer.on('seekDone', (seekDoneTime) => {
logger.info(T... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videocache/src/main/ets/model/VideoPlayerManager.ets#L69-L92 | f16ebd4481bab866faac407c6b0083793291be17 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_axios/src/main/ets/axios/EfClientApi.ets | arkts | delete | delete请求
@param efClientParams 删除请求入参实体
@returns | async delete<E>(efClientParams: efClientParams<null>, cls?: ClassConstructor<E>): Promise<E | EfAxiosError> {
try {
//如果当前请求efClientParams.loadingTxt传入参数 则 更改当前的loading文本
if (efClientParams.loadingTxt) {
efAxiosParams.loadingTxt = efClientParams.loadingTxt;
}
let response: AxiosResp... | AST#method_declaration#Left async delete AST#type_parameters#Left < AST#type_parameter#Left E AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left efClientParams : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left efClientParams AST#type_arguments#Left < A... | async delete<E>(efClientParams: efClientParams<null>, cls?: ClassConstructor<E>): Promise<E | EfAxiosError> {
try {
if (efClientParams.loadingTxt) {
efAxiosParams.loadingTxt = efClientParams.loadingTxt;
}
let response: AxiosResponse<E> = await efAxios.delete<E, AxiosResponse<E>, nul... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_axios/src/main/ets/axios/EfClientApi.ets#L266-L295 | 5716a84e780d5e7c1e078a2d8ac4b304889902bf | gitee |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/view/Detail/dialog/IntervalDialog.ets | arkts | IntervalDialog | 尺寸工具类 定义一个自定义的对话框组件,用于设置闹钟的间隔时间 | @CustomDialog
export default struct IntervalDialog {
// 使用DetailConstants中的默认提供器键来消费AlarmItem
@Consume(DetailConstants.DEFAULT_PROVIDER_KEY) alarmItem: AlarmItem;
// 定义状态变量:间隔分钟和间隔次数
@State intervalMinuteSelect: number = 0;
@State intervalTimesSelect: number = 0;
// 对话框控制器
controller?: CustomDialogContr... | AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export default struct IntervalDialog AST#component_body#Left { // 使用DetailConstants中的默认提供器键来消费AlarmItem AST#property_declaration#Left AST#decorator#Left @ Consume ( AST#expression#Left AST#member_expression#Left AST#expression#L... | @CustomDialog
export default struct IntervalDialog {
@Consume(DetailConstants.DEFAULT_PROVIDER_KEY) alarmItem: AlarmItem;
@State intervalMinuteSelect: number = 0;
@State intervalTimesSelect: number = 0;
controller?: CustomDialogController;
aboutToAppear(): void {
this.intervalMinuteSel... | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/view/Detail/dialog/IntervalDialog.ets#L9-L101 | e77c05d4ad6f2a454253ee817eb20033d9f3c925 | github |
anhao0226/harmony-music-player.git | 4bc1d8f9f5fdb573af387d3ba9ad333c9beb8073 | entry/src/main/ets/api/SongApi.ets | arkts | @param artistId
@returns | export function fetchAlbumDetail(albumId: number) {
const params = { id: albumId };
return new Promise <AlbumDetailResult>((resolve, reject) => {
httpRequestGet<AlbumDetailResponse>(AccessUrls.AlbumDetail, { queryParams: params })
.then((res) => {
if (res.code === 200) {
resolve({ songs:... | AST#export_declaration#Left export AST#function_declaration#Left function fetchAlbumDetail AST#parameter_list#Left ( AST#parameter#Left albumId : 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... | export function fetchAlbumDetail(albumId: number) {
const params = { id: albumId };
return new Promise <AlbumDetailResult>((resolve, reject) => {
httpRequestGet<AlbumDetailResponse>(AccessUrls.AlbumDetail, { queryParams: params })
.then((res) => {
if (res.code === 200) {
resolve({ songs:... | https://github.com/anhao0226/harmony-music-player.git/blob/4bc1d8f9f5fdb573af387d3ba9ad333c9beb8073/entry/src/main/ets/api/SongApi.ets#L197-L213 | 6efceeed3ad049ec1ed8360f8e915bed5dfe55a9 | github | |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/utils/HttpUtil.ets | arkts | request | 发送HTTP请求
@param url 请求URL
@param config 请求配置
@returns Promise<HttpResponse> | static async request<T = Object>(url: string, config: RequestConfig = {}): Promise<HttpResponse<T>> {
const httpRequest = http.createHttp();
try {
const fullUrl = url.startsWith('http') ? url : `${HttpUtil.BASE_URL}${url}`;
console.info(`[HttpUtil] 发起请求: ${fullUrl}`);
// 合并headers
... | AST#method_declaration#Left static async request AST#type_parameters#Left < AST#type_parameter#Left T = AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left url : AST#type_... | static async request<T = Object>(url: string, config: RequestConfig = {}): Promise<HttpResponse<T>> {
const httpRequest = http.createHttp();
try {
const fullUrl = url.startsWith('http') ? url : `${HttpUtil.BASE_URL}${url}`;
console.info(`[HttpUtil] 发起请求: ${fullUrl}`);
const ... | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/utils/HttpUtil.ets#L30-L124 | 0baf8e42618ce8e60c6c1852af7bc37f42767f32 | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/function_call/library_function/map_lib_func_008_F.ets | arkts | Introduction 库函数-map_values | export function map_lib_func_008_F(taint_src : string) {
let map = new Map<string,string>();
map.set("t","_");
map.set("tt","a");
taint.Sink(map.values());
} | AST#export_declaration#Left export AST#function_declaration#Left function map_lib_func_008_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#... | export function map_lib_func_008_F(taint_src : string) {
let map = new Map<string,string>();
map.set("t","_");
map.set("tt","a");
taint.Sink(map.values());
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/library_function/map_lib_func_008_F.ets#L7-L12 | 968233018153f59795f67708fb7940d34aa58ec0 | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/SM4.ets | arkts | encryptGCMSegment | 加密(GCM模式)分段,异步
@param dataBlob 加密或者解密的数据。dataBlob不能为null。
@param key 指定加密或解密的密钥。
@param gcmParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。
@param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(SM4_128|GCM|PKCS7、SM4_128|GCM|PKCS5、等)
@param len 自定义的数据拆分长度。
@returns | static async encryptGCMSegment(dataBlob: cryptoFramework.DataBlob, key: cryptoFramework.Key,
gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7',
len: number = 128): Promise<cryptoFramework.DataBlob> {
let cipher = cryptoFramework.createCipher(transformation);
await ci... | AST#method_declaration#Left static async encryptGCMSegment AST#parameter_list#Left ( AST#parameter#Left dataBlob : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#paramet... | static async encryptGCMSegment(dataBlob: cryptoFramework.DataBlob, key: cryptoFramework.Key,
gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7',
len: number = 128): Promise<cryptoFramework.DataBlob> {
let cipher = cryptoFramework.createCipher(transformation);
await ci... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SM4.ets#L269-L287 | 07bc8dafb535006bbb6ff449e900d63c846b4eda | gitee |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/model/OptionTypes.ets | arkts | 选项接口定义
用于下拉选择框等组件的数据结构 | export interface Option {
value: number;
label: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Option AST#object_type#Left { AST#type_member#Left value : 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 label : AST#type_annotation#Left AST#... | export interface Option {
value: number;
label: string;
} | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/model/OptionTypes.ets#L5-L8 | 3a33f6dc63d765678666e5b92cc5540e2cdca4d3 | github | |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets | arkts | 任务模型 | export interface Task {
id: number;
dreamId: number;
userId: number;
title: string;
description: string;
status: number;
priority: number;
startDate: string;
dueDate: string;
completedAt: string | null;
reminderTime: string | null;
parentTaskId: number | null;
createdAt: string;
updatedAt: s... | AST#export_declaration#Left export AST#interface_declaration#Left interface Task 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 dreamId : AST#type_annotation#Left AST#pri... | export interface Task {
id: number;
dreamId: number;
userId: number;
title: string;
description: string;
status: number;
priority: number;
startDate: string;
dueDate: string;
completedAt: string | null;
reminderTime: string | null;
parentTaskId: number | null;
createdAt: string;
updatedAt: s... | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets#L99-L118 | 7ee104c9ed672589887fd531bcd75af2c41f9844 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/timeto/TimeToManager.ets | arkts | clearSavedTimeByName | 清空指定 typeName 的时间和结果 | public static clearSavedTimeByName(typeName: string): void {
try {
const prefs = TimeToManager._getPrefs();
prefs.putSync(TimeToKeys.lastTime(typeName), '');
prefs.putSync(TimeToKeys.lastResult(typeName), '');
prefs.flushSync();
DebugLog.d(`cleared savedTime for: ${typeName}`);
} c... | AST#method_declaration#Left public static clearSavedTimeByName AST#parameter_list#Left ( AST#parameter#Left typeName : 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 vo... | public static clearSavedTimeByName(typeName: string): void {
try {
const prefs = TimeToManager._getPrefs();
prefs.putSync(TimeToKeys.lastTime(typeName), '');
prefs.putSync(TimeToKeys.lastResult(typeName), '');
prefs.flushSync();
DebugLog.d(`cleared savedTime for: ${typeName}`);
} c... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/timeto/TimeToManager.ets#L131-L141 | 512c9bb0f7487c866603d99c80edcd4babfffb93 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/BasicDataSource.ets | arkts | notifyDataDelete | 通知LazyForEach组件需要在index对应索引处删除该子组件 | notifyDataDelete(index: number): void {
this.listeners.forEach((listener: DataChangeListener) => {
listener.onDataDelete(index);
})
} | AST#method_declaration#Left notifyDataDelete AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#R... | notifyDataDelete(index: number): void {
this.listeners.forEach((listener: DataChangeListener) => {
listener.onDataDelete(index);
})
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/BasicDataSource.ets#L68-L72 | d9e837db75fbea28e8d25849a18db7ce2e846bf1 | gitee |
fourseas1998/hos.ArkTSComponents.git | 5f0dbd0038f17067722cb035c88fe826e4846e69 | entry/src/main/ets/viewmodel/MainViewModel.ets | arkts | getSwiperImages | 获取轮播图资源 | getSwiperImages(): Array<Resource>{
let swiperImages: Resource[]=[
$r('app.media.fig1'),
$r('app.media.fig2'),
$r('app.media.fig3'),
$r('app.media.fig4'),
];
return swiperImages;
} | AST#method_declaration#Left getSwiperImages AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right > AST#type_argu... | getSwiperImages(): Array<Resource>{
let swiperImages: Resource[]=[
$r('app.media.fig1'),
$r('app.media.fig2'),
$r('app.media.fig3'),
$r('app.media.fig4'),
];
return swiperImages;
} | https://github.com/fourseas1998/hos.ArkTSComponents.git/blob/5f0dbd0038f17067722cb035c88fe826e4846e69/entry/src/main/ets/viewmodel/MainViewModel.ets#L8-L16 | 3e359ea643b7b109e2020e742a155b272509d68b | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/AxisBase.ets | arkts | setAxisLineWidth | Sets the width of the border surrounding the chart in dp.
@param width | public setAxisLineWidth(width: number): void {
this.mAxisLineWidth = Utils.convertDpToPixel(width);
} | AST#method_declaration#Left public setAxisLineWidth 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 setAxisLineWidth(width: number): void {
this.mAxisLineWidth = Utils.convertDpToPixel(width);
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/AxisBase.ets#L276-L278 | b26ac0cde01815dd5b55749f25bd7e49928532a1 | gitee |
fmtjava/Ohs_ArkTs_Eyepetizer.git | 79578f394ccb926da1455e63b7fe0722df9b9a22 | entry/src/main/ets/datasource/BasicDataSource.ets | arkts | notifyDataReload | 通知数据重载 | notifyDataReload(): void {
this.listeners.forEach(listener => {
listener.onDataReloaded();
})
} | AST#method_declaration#Left notifyDataReload 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#express... | notifyDataReload(): void {
this.listeners.forEach(listener => {
listener.onDataReloaded();
})
} | https://github.com/fmtjava/Ohs_ArkTs_Eyepetizer.git/blob/79578f394ccb926da1455e63b7fe0722df9b9a22/entry/src/main/ets/datasource/BasicDataSource.ets#L85-L89 | 32f573be70f53b9cb26fe8ba09e5d9cfa28ac91f | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/settings/SettingsService.ets | arkts | isVersionCompatible | 检查版本兼容性
@param version 版本号
@returns 是否兼容 | private isVersionCompatible(version: string): boolean {
// 简单的版本兼容性检查
const currentMajor = parseInt(BusinessConstants.SETTINGS_VERSION.toString().split('.')[0]);
const importMajor = parseInt(version.split('.')[0]);
return importMajor <= currentMajor;
} | AST#method_declaration#Left private isVersionCompatible AST#parameter_list#Left ( AST#parameter#Left version : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AS... | private isVersionCompatible(version: string): boolean {
const currentMajor = parseInt(BusinessConstants.SETTINGS_VERSION.toString().split('.')[0]);
const importMajor = parseInt(version.split('.')[0]);
return importMajor <= currentMajor;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/settings/SettingsService.ets#L937-L943 | 172e89936a058f5914e2f04493c86914f834594e | github |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/commons/network/ConnectionUtils.ets | arkts | openRegister | The method of opening register. | openRegister() {
this.netConnection.register((error: BusinessError) => {
hilog.info(0x0000, TAG, JSON.stringify(error));
});
} | AST#method_declaration#Left openRegister AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this... | openRegister() {
this.netConnection.register((error: BusinessError) => {
hilog.info(0x0000, TAG, JSON.stringify(error));
});
} | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/network/ConnectionUtils.ets#L52-L56 | 4d39bc632e6fc1ecfa45ff045fe9ce4ae3589444 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/nativeembed/src/main/ets/view/NativeEmbedView.ets | arkts | getEmbedId | 获取EmbedId | getEmbedId(): string {
return this.embedId;
} | AST#method_declaration#Left getEmbedId AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Le... | getEmbedId(): string {
return this.embedId;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/nativeembed/src/main/ets/view/NativeEmbedView.ets#L117-L119 | ed6952a8751f0c9232ade9b316df06272dfeb7da | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/CoreFile/DistributedFileSample/entry/src/main/ets/pages/Index.ets | arkts | copyDistributedFile | [End copy_distributed_to_sand] B设备在获取A端沙箱文件时,从B设备的分布式路径下将对应的文件拷贝走,以此完成跨设备拷贝。 | function copyDistributedFile(): void {
// 待拷贝文件的目标沙箱路径
let filePath: string = pathDir + '/dest.txt';
// 获取目标路径uri
let destUri = fileUri.getUriFromPath(filePath);
// 获取分布式路径下的源文件
let srcUri: string = fileUri.getUriFromPath(distributedPathDir + '/src.txt');
// 定义拷贝回调
let progressListener: fs.ProgressListe... | AST#function_declaration#Left function copyDistributedFile AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // 待拷贝文件的目标沙箱路径 AST#statement#Left AST#variable_declaration#Left let AST#varia... | function copyDistributedFile(): void {
let filePath: string = pathDir + '/dest.txt';
let destUri = fileUri.getUriFromPath(filePath);
let srcUri: string = fileUri.getUriFromPath(distributedPathDir + '/src.txt');
let progressListener: fs.ProgressListener = (progress: fs.Progress) => {
Logger.info(... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/CoreFile/DistributedFileSample/entry/src/main/ets/pages/Index.ets#L194-L222 | 87ec862418f7cfbd285d7574be0309d0c44538ab | gitee |
buqiuz/Account.git | b843a38c24a833a9a4386f63cffec5fa5dadc674 | oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/highlight/RadarHighlighter.ets | arkts | getHighlightsAtIndex | Returns an array of Highlight objects for the given index. The Highlight
objects give information about the value at the selected index and the
DataSet it belongs to. INFORMATION: This method does calculations at
runtime. Do not over-use in performance critical situations.
@param index
@return | protected getHighlightsAtIndex(index: number): Highlight[] {
if (this.mChart == null || this.mChart.getData() == null) {
return [];
}
const highlightBuffer: Highlight[] = [];
let animator = this.mChart.getAnimator();
if (!animator) {
return [];
}
const phaseX = animator.getPhase... | AST#method_declaration#Left protected getHighlightsAtIndex 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 AST#array... | protected getHighlightsAtIndex(index: number): Highlight[] {
if (this.mChart == null || this.mChart.getData() == null) {
return [];
}
const highlightBuffer: Highlight[] = [];
let animator = this.mChart.getAnimator();
if (!animator) {
return [];
}
const phaseX = animator.getPhase... | https://github.com/buqiuz/Account.git/blob/b843a38c24a833a9a4386f63cffec5fa5dadc674/oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/highlight/RadarHighlighter.ets#L60-L102 | fbf03022865779d211956dc2d6d54bc80678f723 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | eventbus/src/main/ets/EventBus.ets | arkts | on | 注册事件监听
@param eventName 事件名
@param handler 监听回调
@param isSticky 是否粘性
@returns | static on(eventName: string, handler: Function, isSticky = false) {
EventBusCore.getInstance().on(eventName, handler, isSticky);
} | AST#method_declaration#Left static on AST#parameter_list#Left ( AST#parameter#Left eventName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left handler : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_typ... | static on(eventName: string, handler: Function, isSticky = false) {
EventBusCore.getInstance().on(eventName, handler, isSticky);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/eventbus/src/main/ets/EventBus.ets#L13-L15 | a7229b56f5b31de2d257ff504314e3dac90bd652 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customscan/src/main/ets/viewmodel/CustomScanViewModel.ets | arkts | releaseCustomScan | 释放自定义扫码资源
@returns {Promise<void>} | async releaseCustomScan(): Promise<void> {
logger.info('releaseCustomScan');
try {
await customScan.release();
} catch (error) {
logger.error('Catch: release error: ' + JSON.stringify(error));
}
} | AST#method_declaration#Left async releaseCustomScan 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#typ... | async releaseCustomScan(): Promise<void> {
logger.info('releaseCustomScan');
try {
await customScan.release();
} catch (error) {
logger.error('Catch: release error: ' + JSON.stringify(error));
}
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customscan/src/main/ets/viewmodel/CustomScanViewModel.ets#L361-L368 | c4ce74641627c383850132068d639b4b212d4da2 | gitee |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/common/UIUtils.ets | arkts | ActionMenu配置 | export class ActionMenuOptions {
title: string = '';
buttons: ButtonOptions[] = [];
constructor(title?: string, buttons?: ButtonOptions[]) {
this.title = title || '';
this.buttons = buttons || [];
}
} | AST#export_declaration#Left export AST#class_declaration#Left class ActionMenuOptions 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#expression#Left '' AST#expression#Right ; AST#property_declaratio... | export class ActionMenuOptions {
title: string = '';
buttons: ButtonOptions[] = [];
constructor(title?: string, buttons?: ButtonOptions[]) {
this.title = title || '';
this.buttons = buttons || [];
}
} | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/common/UIUtils.ets#L46-L54 | f31a7b85eeeb452840fd6203c3b99f5dc7a31bcc | github | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/Current.ets | arkts | initCurveData | 初始化数据
@param count 曲线图点的个数
@param range y轴范围 | private initCurveData(): LineData {
let values = new JArrayList<EntryOhos>();
for (let index: number = 0; index < this.gpData.length; index++) {
const gpDataCur = this.gpData[index];
if (String(gpDataCur.currentNow) == '') {
parseInt
continue
}
if (this.gpData.length ==... | AST#method_declaration#Left private initCurveData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left LineData AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left v... | private initCurveData(): LineData {
let values = new JArrayList<EntryOhos>();
for (let index: number = 0; index < this.gpData.length; index++) {
const gpDataCur = this.gpData[index];
if (String(gpDataCur.currentNow) == '') {
parseInt
continue
}
if (this.gpData.length ==... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/Current.ets#L104-L149 | 67e1cb4d03ccaa4d36815bdc7c8bba0053c6fb35 | gitee |
wustcat404/time-bar | d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8 | time_bar/src/main/ets/components/viewModel/TimeBarModel.ets | arkts | onDataChange | Register a callback for data changes. External code can react to data updates (e.g., to redraw the component).
@param callback Callback invoked when data changes. | public onDataChange(callback: (type: 'timeRange' | 'currentTime') => void) {
this._onDataChange = callback;
} | AST#method_declaration#Left public onDataChange AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left type AST#parameter#Right AST#ERROR#Left : 'timeRange' | 'currentTime' AST#ERROR#Right ) AST#parameter_list#Right => AST#typ... | public onDataChange(callback: (type: 'timeRange' | 'currentTime') => void) {
this._onDataChange = callback;
} | https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/time_bar/src/main/ets/components/viewModel/TimeBarModel.ets#L116-L118 | f20a2e467254a13558229f22bb83cdeb42b87888 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/SettingsTypes.ets | arkts | 通知设置接口 | export interface NotificationSettings {
enabled: boolean;
channels: Record<NotificationChannel, NotificationChannelConfig>;
quietHours: QuietHoursConfig;
sound: NotificationSoundConfig;
vibration: NotificationVibrationConfig;
reminderSettings: ReminderSettings;
methods: NotificationMethod[];
showPreview... | AST#export_declaration#Left export AST#interface_declaration#Left interface NotificationSettings AST#object_type#Left { AST#type_member#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left channels : AST#type_... | export interface NotificationSettings {
enabled: boolean;
channels: Record<NotificationChannel, NotificationChannelConfig>;
quietHours: QuietHoursConfig;
sound: NotificationSoundConfig;
vibration: NotificationVibrationConfig;
reminderSettings: ReminderSettings;
methods: NotificationMethod[];
showPreview... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L46-L55 | a9d282bac11ca1fa1cbf9d949c782a4352100e92 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/clickanimation/src/main/ets/components/ClickAnimationComponent.ets | arkts | setVibrator | 设置振动效果。 | setVibrator() {
// 查询设备是否支持预设振动效果
vibrator.isSupportEffect(this.presetVibration, (err: BusinessError, state: boolean) => {
if (err) {
logger.error(TAG, `Failed to query effect. Code: ${err.code}, message: ${err.message}`);
return;
}
if (state) {
// 触发马达振动,使用预设效果HapticFe... | AST#method_declaration#Left setVibrator AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 查询设备是否支持预设振动效果 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left vibrator AST#expression#Right . is... | setVibrator() {
vibrator.isSupportEffect(this.presetVibration, (err: BusinessError, state: boolean) => {
if (err) {
logger.error(TAG, `Failed to query effect. Code: ${err.code}, message: ${err.message}`);
return;
}
if (state) {
vibrator.startVibration({
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/clickanimation/src/main/ets/components/ClickAnimationComponent.ets#L140-L164 | 40fbba849a4a2511566bc086c5387d11b77e9503 | gitee |
xinkai-hu/MyDay.git | dcbc82036cf47b8561b0f2a7783ff0078a7fe61d | entry/src/main/ets/pages/MyDay.ets | arkts | selectedFolderChanged | 在批量管理中,当用户选择日程被移动或复制的目标文件夹时的回调函数。
将被选中的日程,即 batchEditList 中的所有日程移动或复制到目标文件夹。 | public selectedFolderChanged(): void {
if (this.batchSelectedFolder === null) {
return;
} else if (this.isBatchMove) {
let editList: Array<Schedule> = ArrayUtil.copy(this.batchEditList);
editList.forEach((value: Schedule) => {
value.folderName = this.batchSelectedFolder.folderName;
... | AST#method_declaration#Left public selectedFolderChanged AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_exp... | public selectedFolderChanged(): void {
if (this.batchSelectedFolder === null) {
return;
} else if (this.isBatchMove) {
let editList: Array<Schedule> = ArrayUtil.copy(this.batchEditList);
editList.forEach((value: Schedule) => {
value.folderName = this.batchSelectedFolder.folderName;
... | https://github.com/xinkai-hu/MyDay.git/blob/dcbc82036cf47b8561b0f2a7783ff0078a7fe61d/entry/src/main/ets/pages/MyDay.ets#L465-L491 | c80c9daed7e966d6117008d201e069e164a7b903 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/LogUtil.ets | arkts | print | 打印JSON对象和JSON字符串
@param msg | static print(msg: object | string) {
try {
let content = '';
if (typeof msg === 'object') {
if (msg instanceof Error) {
content = content + LogUtil.getErrorStr(msg, false);
} else {
content = content + LogUtil.getObjectToJson(msg, false);
}
} else if (ty... | AST#method_declaration#Left static print AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left object AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#para... | static print(msg: object | string) {
try {
let content = '';
if (typeof msg === 'object') {
if (msg instanceof Error) {
content = content + LogUtil.getErrorStr(msg, false);
} else {
content = content + LogUtil.getObjectToJson(msg, false);
}
} else if (ty... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LogUtil.ets#L127-L157 | 53fa0c904db5ce99f8318015f23af54cf2415682 | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/BaseEntry.ets | arkts | setY | Sets the y-value for the Entry.
@param y | public setY(y: number): void {
this.y = y;
} | AST#method_declaration#Left public setY AST#parameter_list#Left ( AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#... | public setY(y: number): void {
this.y = y;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/BaseEntry.ets#L69-L71 | 747db192507152ace21f1dfd7612edf7a71920c0 | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/BarLineScatterCandleBubbleRenderer.ets | arkts | shouldDrawValues | Returns true if the DataSet values should be drawn, false if not.
@param set
@return | protected shouldDrawValues(dataSet: IDataSet<any>): boolean {
return dataSet.isVisible() && (dataSet.isDrawValuesEnabled() || dataSet.isDrawIconsEnabled());
} | AST#method_declaration#Left protected shouldDrawValues AST#parameter_list#Left ( AST#parameter#Left dataSet : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left IDataSet AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left any AST#primary_type#Right AST#type_annotation#Right > AST#... | protected shouldDrawValues(dataSet: IDataSet<any>): boolean {
return dataSet.isVisible() && (dataSet.isDrawValuesEnabled() || dataSet.isDrawIconsEnabled());
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/BarLineScatterCandleBubbleRenderer.ets#L93-L95 | 6f9e82e78bf3e1e9a3e7a7bfeed6c15434aa8473 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/SHASync.ets | arkts | digestSHA512 | SHA512摘要
@param str 带摘要的字符串
@param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
@returns 摘要后的字符串 | static digestSHA512(str: string, resultCoding: buffer.BufferEncoding = 'base64'): string {
return CryptoSyncUtil.digest(str, 'SHA512', resultCoding);
} | AST#method_declaration#Left static digestSHA512 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_t... | static digestSHA512(str: string, resultCoding: buffer.BufferEncoding = 'base64'): string {
return CryptoSyncUtil.digest(str, 'SHA512', resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/SHASync.ets#L75-L77 | 9c440ac831c5a7f134c3f2a565c6739b271ced63 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Sounds/Cloud/Manager/CSoundManager.ets | arkts | removeAllCachedSounds | 删除所有缓存 | async removeAllCachedSounds() {
await CSoundDbAccessor.shared.deleteAll()
} | AST#method_declaration#Left async removeAllCachedSounds AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expre... | async removeAllCachedSounds() {
await CSoundDbAccessor.shared.deleteAll()
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Manager/CSoundManager.ets#L125-L127 | f64998ade5693e6df2be9936962d025462faba81 | github |
ccccjiemo/egl.git | d18849c3da975ccf9373fd09874aa5637ccbe6bd | src/main/ets/constants/Index.ets | arkts | *
KHR ext | export const EGL_CL_EVENT_HANDLE_KHR = 0x309C; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left EGL_CL_EVENT_HANDLE_KHR = AST#expression#Left 0x309C AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const EGL_CL_EVENT_HANDLE_KHR = 0x309C; | https://github.com/ccccjiemo/egl.git/blob/d18849c3da975ccf9373fd09874aa5637ccbe6bd/src/main/ets/constants/Index.ets#L235-L235 | 4b97b82e8d42bceb56768d70312075693cb23d00 | github | |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/proxy/TextInputBuilderProxy.ets | arkts | inputType | 输入框类型
@default InputType.Normal 、InputType.Password | inputType(inputType: InputType) {
this.builderOptions.inputType = inputType;
return this
} | AST#method_declaration#Left inputType AST#parameter_list#Left ( AST#parameter#Left inputType : AST#type_annotation#Left AST#primary_type#Left InputType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#L... | inputType(inputType: InputType) {
this.builderOptions.inputType = inputType;
return this
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/TextInputBuilderProxy.ets#L18-L21 | 988768bf30aae73e853dd19daed7bc3f4484ccf8 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2Convert.ets | arkts | @Author csx
@DateTime 2024/3/18 10:39:03
@TODO SM2Convert SM2ASN.1跟C1C3C2转换类 | export class SM2Convert {
/**
* C1C3C2格式的字符串转换成ASN.1格式的字符
* @param primal_data C1C3C2格式的字符
* @returns ASN.1格式的字符
*/
i2dSM2(primal_data: string): string {
let sm2_sequence = new SM2Sequence();
sm2_sequence.C1x = primal_data.slice(0, 64);
primal_data = primal_data.slice(64, primal_data.length)... | AST#export_declaration#Left export AST#class_declaration#Left class SM2Convert AST#class_body#Left { /**
* C1C3C2格式的字符串转换成ASN.1格式的字符
* @param primal_data C1C3C2格式的字符
* @returns ASN.1格式的字符
*/ AST#method_declaration#Left i2dSM2 AST#parameter_list#Left ( AST#parameter#Left primal_data : AST#type_annotation#Lef... | export class SM2Convert {
i2dSM2(primal_data: string): string {
let sm2_sequence = new SM2Sequence();
sm2_sequence.C1x = primal_data.slice(0, 64);
primal_data = primal_data.slice(64, primal_data.length);
sm2_sequence.C1y = primal_data.slice(0, 64);
primal_data = primal_data.slice(64, primal_dat... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2Convert.ets#L42-L262 | a098096d769d4239c810a18b95cd9ea0954c125d | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/card/detailstyle/DetailStyle.ets | arkts | init | ---------------- 初始化 ---------------- 根据 value 初始化 | static init(fromValue: number): number {
switch (fromValue) {
case DetailStyle.Style0: return DetailStyle.Style0;
case DetailStyle.Style1: return DetailStyle.Style1;
case DetailStyle.Style2: return DetailStyle.Style2;
default: return DetailStyle.Style0;
} | AST#method_declaration#Left static init AST#parameter_list#Left ( AST#parameter#Left fromValue : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#... | static init(fromValue: number): number {
switch (fromValue) {
case DetailStyle.Style0: return DetailStyle.Style0;
case DetailStyle.Style1: return DetailStyle.Style1;
case DetailStyle.Style2: return DetailStyle.Style2;
default: return DetailStyle.Style0;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/card/detailstyle/DetailStyle.ets#L29-L35 | 617a913f6f433b7c63b2e48bd6c097b6d0c2099b | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/myData/WordUser.ets | arkts | get | 获取错误日期字符串 | get wrangDateString(): string {
return `${this.wrangYear}/${this.wrangMonth}/${this.wrangDay}`;
} | AST#method_declaration#Left get AST#ERROR#Left wrangDateStr in g AST#ERROR#Right 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 AS... | get wrangDateString(): string {
return `${this.wrangYear}/${this.wrangMonth}/${this.wrangDay}`;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/myData/WordUser.ets#L68-L70 | 65676aac3aa71935b36a8aa83e19f66dd4f6e1ac | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Solutions/Tools/FlipClock/entry/src/main/ets/common/FlipClock.ets | arkts | FlipClock | Copyright (c) 2022-2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | @Component
export struct FlipClock {
@State timeOne: Array<number> = [];
@State timeTwo: Array<number> = [];
@State timeThree: Array<number> = [];
@State timeFour: Array<number> = [];
@State angleOne: Array<number> = [0, 0, 0, 0, 0, 0];
@State angleTwo: Array<number> = [-90, -90, -90, -90, -90, -90];
abo... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FlipClock AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right timeOne : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#... | @Component
export struct FlipClock {
@State timeOne: Array<number> = [];
@State timeTwo: Array<number> = [];
@State timeThree: Array<number> = [];
@State timeFour: Array<number> = [];
@State angleOne: Array<number> = [0, 0, 0, 0, 0, 0];
@State angleTwo: Array<number> = [-90, -90, -90, -90, -90, -90];
abo... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/Tools/FlipClock/entry/src/main/ets/common/FlipClock.ets#L16-L214 | 99366102447e2fceecb4a2f7fbc5332609a3538c | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/recommendation/RecommendationEngine.ets | arkts | 推荐类型枚举 | export enum RecommendationType {
GREETING = 'greeting', // 祝福语推荐
GIFT = 'gift', // 礼物推荐
ACTIVITY = 'activity', // 活动推荐
CONTACT = 'contact', // 联系人推荐
REMINDER = 'reminder', // 提醒推荐
THEME = 'theme', // 主题推荐
TEMPLATE = 'template' ... | AST#export_declaration#Left export AST#enum_declaration#Left enum RecommendationType AST#enum_body#Left { AST#enum_member#Left GREETING = AST#expression#Left 'greeting' AST#expression#Right AST#enum_member#Right , // 祝福语推荐 AST#enum_member#Left GIFT = AST#expression#Left 'gift' AST#expression#Right AST#enum_member#Right... | export enum RecommendationType {
GREETING = 'greeting',
GIFT = 'gift',
ACTIVITY = 'activity',
CONTACT = 'contact',
REMINDER = 'reminder',
THEME = 'theme',
TEMPLATE = 'template'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/recommendation/RecommendationEngine.ets#L17-L25 | f97a9aafd5f3acf0d028b1e955f9118139f1a536 | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | entry/src/main/ets/entryability/EntryAbility.ets | arkts | onWindowStageDestroy | 窗口销毁时调用
释放窗口资源
@returns {void} 无返回值 | onWindowStageDestroy(): void {
} | AST#method_declaration#Left onWindowStageDestroy AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right | onWindowStageDestroy(): void {
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/entry/src/main/ets/entryability/EntryAbility.ets#L65-L66 | b87575bab7b9c2e5e200a9aa6351498e90892c66 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/data/src/main/ets/repository/PageRepository.ets | arkts | @file 页面数据仓库,封装页面聚合数据请求
@author Joker.X | export class PageRepository {
/**
* 页面网络数据源
*/
private networkDataSource: PageNetworkDataSource;
/**
* 构造函数
* @param networkDataSource 页面网络数据源
*/
constructor(networkDataSource?: PageNetworkDataSource) {
this.networkDataSource = networkDataSource ?? new PageNetworkDataSourceImpl();
}
/**... | AST#export_declaration#Left export AST#class_declaration#Left class PageRepository AST#class_body#Left { /**
* 页面网络数据源
*/ AST#property_declaration#Left private networkDataSource : AST#type_annotation#Left AST#primary_type#Left PageNetworkDataSource AST#primary_type#Right AST#type_annotation#Right ; AST#property_d... | export class PageRepository {
private networkDataSource: PageNetworkDataSource;
constructor(networkDataSource?: PageNetworkDataSource) {
this.networkDataSource = networkDataSource ?? new PageNetworkDataSourceImpl();
}
async getHomeData(): Promise<NetworkResponse<Home>> {
return this.networkDa... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/PageRepository.ets#L8-L46 | 2b9e08e7272031f7e888018b4029d979851ef4ce | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | entry/src/main/ets/entryability/EntryAbility.ets | arkts | onBackPressed | 返回true表示UIAbility将会被移到后台不销毁,返回false表示UIAbility将正常销毁。 | onBackPressed(): boolean {
return true;
} | AST#method_declaration#Left onBackPressed AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#boolean_literal#... | onBackPressed(): boolean {
return true;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/entry/src/main/ets/entryability/EntryAbility.ets#L100-L102 | f0375700857dca7b97acebeabc6c8f72f70c0fc2 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/charts/RadarChartModel.ets | arkts | getWebAlpha | Returns the alpha value for all web lines.
@return | public getWebAlpha(): number {
return this.mWebAlpha;
} | AST#method_declaration#Left public getWebAlpha AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expre... | public getWebAlpha(): number {
return this.mWebAlpha;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/RadarChartModel.ets#L270-L272 | 8e14f8c78b00886e005516cf053527a52439921b | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/pageturninganimation/src/main/ets/view/PageTurningAnimation.ets | arkts | aboutToAppear | 旋转中心点参数y。 在UI显示前,传入各项变量的具体值 | aboutToAppear(): void {
// 通过setInterval函数每秒调用一次动画效果,实现连续翻页
setInterval(() => {
this.pageTurningAnimate();
}, 1000) // 函数调用周期要大于每次动画持续的时长
} | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { // 通过setInterval函数每秒调用一次动画效果,实现连续翻页 AST#arkts_ui_element#Left AST#ui_element_with_modifie... | aboutToAppear(): void {
setInterval(() => {
this.pageTurningAnimate();
}, 1000)
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pageturninganimation/src/main/ets/view/PageTurningAnimation.ets#L82-L87 | 4cc066389b14ca9b1690d816c6ec3a1616ac373b | gitee |
weboose/jellyfin-sdk-arkts.git | 826b1dabd29c5d4702d3d4a31e358114fb5b7c91 | entry/src/main/ets/pages/ItemsPage.ets | arkts | toolbarBuilder | toolbar | @Builder
private toolbarBuilder(){
Row({space: 12}){
if(this.result?.TotalRecordCount && this.result?.TotalRecordCount > 0){
Text(`${this.result?.TotalRecordCount || 0} 中的 ${(this.result?.StartIndex || 0) + 1} - ${Math.min(this.page * this.limit, this.result?.TotalRecordCount)}`)... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private toolbarBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( AST#component_parameters#Left { AST#component... | @Builder
private toolbarBuilder(){
Row({space: 12}){
if(this.result?.TotalRecordCount && this.result?.TotalRecordCount > 0){
Text(`${this.result?.TotalRecordCount || 0} 中的 ${(this.result?.StartIndex || 0) + 1} - ${Math.min(this.page * this.limit, this.result?.TotalRecordCount)}`)... | https://github.com/weboose/jellyfin-sdk-arkts.git/blob/826b1dabd29c5d4702d3d4a31e358114fb5b7c91/entry/src/main/ets/pages/ItemsPage.ets#L131-L171 | 104d687adf3287a4afb9ac28bc5fc138300013b3 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/common/IntroductionTitle.ets | arkts | IntroductionTitle | Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License")
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | @Component
export struct IntroductionTitle {
private introduction!: Resource | string;
build() {
Column() {
Blank()
Text(this.introduction)
.fontSize(14)
.fontWeight(FontWeight.Medium)
.fontColor($r('app.color.font_color_grey'))
}
.height(56)
.width('100%')
.... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct IntroductionTitle AST#component_body#Left { AST#property_declaration#Left private introduction AST#ERROR#Left ! AST#ERROR#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Resource AST#primary... | @Component
export struct IntroductionTitle {
private introduction!: Resource | string;
build() {
Column() {
Blank()
Text(this.introduction)
.fontSize(14)
.fontWeight(FontWeight.Medium)
.fontColor($r('app.color.font_color_grey'))
}
.height(56)
.width('100%')
.... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/common/IntroductionTitle.ets#L16-L33 | eea6b2a0f72fa6eddfa64d605beb6d682627d2be | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/DialogBuilder.ets | arkts | DialogAttachBuilder | 挂件 | @Builder
export function DialogAttachBuilder(dialogId: string, w: Length, h: Length,
attaches: AttachType[],
attachAction?: NumberCallback,) {
RelativeContainer() {
ForEach(attaches, (item: IPresetAttachImage, index) => {
if (item) {
Column() {
Image(item.image)
.width(item... | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function DialogAttachBuilder AST#parameter_list#Left ( AST#parameter#Left dialogId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Le... | @Builder
export function DialogAttachBuilder(dialogId: string, w: Length, h: Length,
attaches: AttachType[],
attachAction?: NumberCallback,) {
RelativeContainer() {
ForEach(attaches, (item: IPresetAttachImage, index) => {
if (item) {
Column() {
Image(item.image)
.width(item... | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogBuilder.ets#L52-L84 | 76db44b5d462add002f9bdc60c29e6a7f32d2304 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/app/views/SegmentButton.ets | arkts | aboutToAppear | ========== 生命周期:计算每个按钮宽度 ========== | aboutToAppear() {
// 按钮数量
this.btnCount = this.items.length > 0 ? this.items.length : 1
// totalWidth 为数字(像素)时,直接平均分配(返回数字)
if (typeof this.totalWidth === 'number') {
const numWidth = (this.totalWidth as number) / this.btnCount
this.computedBtnWidth = Math.floor(numWidth) // 使用整数像素(可按需保留小数)... | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 按钮数量 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . btnCount AST#member_expressi... | aboutToAppear() {
this.btnCount = this.items.length > 0 ? this.items.length : 1
if (typeof this.totalWidth === 'number') {
const numWidth = (this.totalWidth as number) / this.btnCount
this.computedBtnWidth = Math.floor(numWidth)
return
}
if (typeof this.totalWidth ===... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/SegmentButton.ets#L50-L75 | bab689adc576196499c40e3f2eca966132cbb176 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Solutions/InputMethod/KikaInputMethod/entry/src/main/ets/components/DeleteItem.ets | arkts | DeleteItem | 删除组件 | @Component
export struct DeleteItem {
@StorageLink('inputStyle') inputStyle: KeyStyle = StyleConfiguration.getSavedInputStyle();
build() {
Stack() {
Image($rawfile('delete.svg'))
.width(this.inputStyle.featurePicSize)
.height(this.inputStyle.featurePicSize)
}
.backgroundColor($r('... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct DeleteItem AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'inputStyle' AST#expression#Right ) AST#decorator#Right inputStyle : AST#type_annotation#Left A... | @Component
export struct DeleteItem {
@StorageLink('inputStyle') inputStyle: KeyStyle = StyleConfiguration.getSavedInputStyle();
build() {
Stack() {
Image($rawfile('delete.svg'))
.width(this.inputStyle.featurePicSize)
.height(this.inputStyle.featurePicSize)
}
.backgroundColor($r('... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/InputMethod/KikaInputMethod/entry/src/main/ets/components/DeleteItem.ets#L28-L50 | ff0c8ca59ba4973645c90eac445374f6d6c95d4b | gitee |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.file.PhotoPickerComponent.d.ets | arkts | PickerController | The class for PickerController
@syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
@atomicservice
@since 12 | @Observed
export declare class PickerController {
/**
* Set data to picker component
*
* @param { DataType } dataType - data type
* @param { Object } data - data
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 12
*/
setData(dataT... | AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right class PickerController AST#class_body#Left { /**
* Set data to picker component
*
* @param { DataType } dataType - data type
* @param { Object } data - data
* @s... | @Observed
export declare class PickerController {
setData(dataType: DataType, data: Object): void;
setMaxSelected(maxSelected: MaxSelected): void;
setPhotoBrowserItem(uri: string, photoBrowserRange?: PhotoBrowserRange): void;
exitPhotoBrowser(): void;
setPhotoBrowserUIElemen... | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.file.PhotoPickerComponent.d.ets#L184-L233 | 2d398a6aaf0c2d53897869e01f81e5bca4295f58 | github |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/ui/animation/AnimationUtils.ets | arkts | scale | 缩放动画 | static scale(from: number = 0, to: number = 1, duration: number = 300): object {
return {
duration: duration,
curve: curve.EaseOut
};
} | AST#method_declaration#Left static scale AST#parameter_list#Left ( AST#parameter#Left from : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right AST#parameter#Right , AST#parameter#Left to : AST#type_annotation#Left AST#prim... | static scale(from: number = 0, to: number = 1, duration: number = 300): object {
return {
duration: duration,
curve: curve.EaseOut
};
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/ui/animation/AnimationUtils.ets#L31-L36 | 68f02c34cd5c6b8cbf9eb95bdd1d78816512ccc4 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/charts/BarLineChartBaseModel.ets | arkts | /** the approximator object used for data filtering private Approximator mApproximator; | constructor() {
super();
this.init();
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left super AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST... | constructor() {
super();
this.init();
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/BarLineChartBaseModel.ets#L183-L186 | 90d634de3d924b8e65f36684c4c8f68d9cafbb8a | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/analytics/AdvancedAnalyticsService.ets | arkts | 设备信息接口 | export interface DeviceInfo {
deviceId: string;
platform: string;
osVersion: string;
appVersion: string;
screenResolution: string;
language: string;
timezone: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface DeviceInfo AST#object_type#Left { AST#type_member#Left deviceId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left platform : AST#type_annotation... | export interface DeviceInfo {
deviceId: string;
platform: string;
osVersion: string;
appVersion: string;
screenResolution: string;
language: string;
timezone: string;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/analytics/AdvancedAnalyticsService.ets#L133-L141 | 7090148a02e7a275fb7af0b5d5bfb80887de8ae5 | github | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | avscreen-capture-screen-record-master/entry/src/main/ets/model/MyAVScreenCapture.ets | arkts | startRecording | 开始屏幕录制 | public async startRecording(filesDir: string) {
// [Start create_record]
// 获取fd
this.updateFileFd(filesDir);
// 实例化对象
try {
this.screenCapture = await media.createAVScreenCaptureRecorder();
} catch (error) {
let err = error as BusinessError;
hilog.error(0x0000, 'testTag',
... | AST#method_declaration#Left public async startRecording AST#parameter_list#Left ( AST#parameter#Left filesDir : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left { // [Start create_record] // 获取fd AST#stat... | public async startRecording(filesDir: string) {
this.updateFileFd(filesDir);
try {
this.screenCapture = await media.createAVScreenCaptureRecorder();
} catch (error) {
let err = error as BusinessError;
hilog.error(0x0000, 'testTag',
`createAVScreenCaptureRecorder fail... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/avscreen-capture-screen-record-master/entry/src/main/ets/model/MyAVScreenCapture.ets#L32-L63 | 7fe74d3f95e8f81daaae2e693937c9ecc3497839 | gitee |
wustcat404/time-bar | d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8 | entry/src/main/ets/common/contants/CommonConstants.ets | arkts | Small epsilon to stay at the last frame when pausing | export const LOG_DOMAIN = 0x0001; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left LOG_DOMAIN = AST#expression#Left 0x0001 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const LOG_DOMAIN = 0x0001; | https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/entry/src/main/ets/common/contants/CommonConstants.ets#L81-L81 | 0f7e242501d4019443b8e9bb7ae7befd496b1b0f | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/viewmodel/CartViewModel.ets | arkts | get | 获取选中的商品总数量
@returns {number} 选中商品数量 | get selectedCount(): number {
return this.selectedSpecIds.size;
} | AST#method_declaration#Left get AST#ERROR#Left selectedCount AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#ex... | get selectedCount(): number {
return this.selectedSpecIds.size;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/viewmodel/CartViewModel.ets#L46-L48 | fbd0fbb1f79b8bdde4db1bd809edb6050d81eb8b | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/accessibility/AccessibilityService.ets | arkts | 无障碍设置接口 | export interface AccessibilitySettings {
// 基础设置
isEnabled: boolean;
currentMode: AccessibilityMode;
// 视觉辅助
fontSize: FontSizeLevel;
contrast: ContrastLevel;
colorBlindFriendly: boolean;
reduceMotion: boolean;
highContrastMode: boolean;
// 听觉辅助
voiceOverEnabled: boolean;
speechRate: Speec... | AST#export_declaration#Left export AST#interface_declaration#Left interface AccessibilitySettings AST#object_type#Left { // 基础设置 AST#type_member#Left isEnabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left currentMo... | export interface AccessibilitySettings {
isEnabled: boolean;
currentMode: AccessibilityMode;
fontSize: FontSizeLevel;
contrast: ContrastLevel;
colorBlindFriendly: boolean;
reduceMotion: boolean;
highContrastMode: boolean;
voiceOverEnabled: boolean;
speechRate: SpeechRate;
soundFeedbac... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/accessibility/AccessibilityService.ets#L70-L105 | 2bea0262eb487ec52aab61d3c4efbbdb8de4d2cc | github | |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/ciphers/VigenereCipher.ets | arkts | encrypt | 加密文本
@param text 要加密的文本
@param key 密钥
@returns 加密后的文本 | static encrypt(text: string, key: string): string {
if (!text || !key) {
return '';
}
const normalizedKey = key.toUpperCase();
let result = '';
let keyIndex = 0;
for (let i = 0; i < text.length; i++) {
const char = text[i];
if (char >= 'A' && char <= 'Z') {
// 大写字母
... | AST#method_declaration#Left static encrypt 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#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Righ... | static encrypt(text: string, key: string): string {
if (!text || !key) {
return '';
}
const normalizedKey = key.toUpperCase();
let result = '';
let keyIndex = 0;
for (let i = 0; i < text.length; i++) {
const char = text[i];
if (char >= 'A' && char <= 'Z') {
c... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/ciphers/VigenereCipher.ets#L12-L40 | b874e968d13385cbe88baac595b6a9951d4b3ae3 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/livedetectionandencryptiond/src/main/ets/components/StartFacialFecognition.ets | arkts | privateStartDetection | 校验CAMERA权限,跳转人脸活体验证控件
@param routerOptions 活体检测参数
@param permissionArr 权限列表 | public static privateStartDetection(routerOptions: interactiveLiveness.InteractiveLivenessConfig,
permissionArr: Array<Permissions>) {
let context = getContext();
// 向用户申请权限,此处为相机权限
abilityAccessCtrl.createAtManager().requestPermissionsFromUser(context, permissionArr).then((res) => {
for (let i = ... | AST#method_declaration#Left public static privateStartDetection AST#parameter_list#Left ( AST#parameter#Left routerOptions : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left interactiveLiveness . InteractiveLivenessConfig AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AS... | public static privateStartDetection(routerOptions: interactiveLiveness.InteractiveLivenessConfig,
permissionArr: Array<Permissions>) {
let context = getContext();
abilityAccessCtrl.createAtManager().requestPermissionsFromUser(context, permissionArr).then((res) => {
for (let i = 0; i < res.permiss... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/livedetectionandencryptiond/src/main/ets/components/StartFacialFecognition.ets#L29-L42 | c9bbf10bba0cfe59538db04199760f143b04c646 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/LocationUtil.ets | arkts | isGeocoderAvailable | 判断地理编码与逆地理编码服务是否可用
@returns | static isGeocoderAvailable() {
return geoLocationManager.isGeocoderAvailable();
} | AST#method_declaration#Left static isGeocoderAvailable AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left geoLocationManager AS... | static isGeocoderAvailable() {
return geoLocationManager.isGeocoderAvailable();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LocationUtil.ets#L196-L198 | 3481edfda0b312f97c8eeff8c21d21e8edcb9dd3 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/user/src/main/ets/view/ProfilePage.ets | arkts | 构建个人中心页面
@returns {void} 无返回值 | build() {
AppNavDestination({
title: $r("app.string.profile_title"),
viewModel: this.vm
}) {
this.ProfileContent();
IBestDialog({
visible: this.vm.showLogoutDialog,
title: $r("app.string.logout_confirm_title"),
message: $r("app.string.logout_confirm_message"),
... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left AppNavDestination ( AST#component_parameters#Left { AST#component_parameter#Left title : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.profile_... | build() {
AppNavDestination({
title: $r("app.string.profile_title"),
viewModel: this.vm
}) {
this.ProfileContent();
IBestDialog({
visible: this.vm.showLogoutDialog,
title: $r("app.string.logout_confirm_title"),
message: $r("app.string.logout_confirm_message"),
... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/view/ProfilePage.ets#L29-L48 | b8a373ce8330590afe359e2987cc81541b32774e | github | |
iamhyc/Aigis.git | 585de9128882d868484438d32832ca9b9b50442d | entry/src/main/ets/components/settings.ets | arkts | fp | build() {
Column({space:3}) {
Row() {
Text(this.title)
.fontWeight(FontWeight.Medium)
.fontSize(this.titleFontSize)
.fontColor(this.disabled ? $r('sys.color.font_tertiary') : $r('sys.color.font_primary'))
}
... | 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#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 3 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right... | build() {
Column({space:3}) {
Row() {
Text(this.title)
.fontWeight(FontWeight.Medium)
.fontSize(this.titleFontSize)
.fontColor(this.disabled ? $r('sys.color.font_tertiary') : $r('sys.color.font_primary'))
}
... | https://github.com/iamhyc/Aigis.git/blob/585de9128882d868484438d32832ca9b9b50442d/entry/src/main/ets/components/settings.ets#L21-L46 | 9d43a416c04009f02025d16dfc9978926fa80904 | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@system.router.d.ets | arkts | enableAlertBeforeBackPage | Pop up dialog to ask whether to back
@param { EnableAlertBeforeBackPageOptions } options Options.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 6
@deprecated since 8 | static enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void; | AST#method_declaration#Left static enableAlertBeforeBackPage AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left EnableAlertBeforeBackPageOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left A... | static enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@system.router.d.ets#L321-L321 | 10b03104fa12e3a6fd378f92de87715344743f18 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.