nwo stringclasses 304
values | sha stringclasses 304
values | path stringlengths 9 214 | language stringclasses 1
value | identifier stringlengths 0 49 | docstring stringlengths 1 34.2k | function stringlengths 8 59.4k | ast_function stringlengths 71 497k | obf_function stringlengths 8 39.4k | url stringlengths 102 324 | function_sha stringlengths 40 40 | source stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | NetworkManagement/entry/src/main/ets/pages/WiFiQuery.ets | arkts | NavDestinationTitle | [End add_candidate_config] | @Builder
NavDestinationTitle() {
Column() {
Text($r('app.string.wifi_query'))
.fontSize(20)
.lineHeight(40)
.fontWeight(700)
.width('100%')
.padding({ left: 12 })
}
.width('100%')
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right NavDestinationTitle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts... | @Builder
NavDestinationTitle() {
Column() {
Text($r('app.string.wifi_query'))
.fontSize(20)
.lineHeight(40)
.fontWeight(700)
.width('100%')
.padding({ left: 12 })
}
.width('100%')
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NetworkManagement/entry/src/main/ets/pages/WiFiQuery.ets#L109-L120 | 0eaf5641bbe537876f04023becd8a1f0865d5e2c | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_core/src/main/ets/core/util/StrUtil.ets | arkts | isEmptyIfStr | 判断传入的对象是否是空
@param obj
@returns | static isEmptyIfStr(obj: Object): boolean {
if (null == obj) {
return true;
} else if (obj instanceof String) {
return 0 == (obj).length;
} else {
return false;
}
} | AST#method_declaration#Left static isEmptyIfStr AST#parameter_list#Left ( AST#parameter#Left obj : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_ty... | static isEmptyIfStr(obj: Object): boolean {
if (null == obj) {
return true;
} else if (obj instanceof String) {
return 0 == (obj).length;
} else {
return false;
}
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/StrUtil.ets#L86-L94 | 042e14c6cc35eb9c1bb3258933f7ff31758484be | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/common/types/ContactTypes.ets | arkts | 联系人创建参数接口 | export interface CreateContactParams {
name: string;
relation: RelationType;
birthday: BirthdayInfo;
gender?: Gender;
phone?: string;
email?: string;
avatar?: string;
tags?: string[];
notes?: string;
intimacyLevel?: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface CreateContactParams AST#object_type#Left { AST#type_member#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left relation : AST#type_annot... | export interface CreateContactParams {
name: string;
relation: RelationType;
birthday: BirthdayInfo;
gender?: Gender;
phone?: string;
email?: string;
avatar?: string;
tags?: string[];
notes?: string;
intimacyLevel?: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/ContactTypes.ets#L135-L146 | 7edbb646a42406ca43d39e33df5d437ad2082c55 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/common/types/SettingsTypes.ets | arkts | 语言设置接口 | export interface LanguageSettings {
current: Language;
fallback: Language;
autoDetect: boolean;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface LanguageSettings AST#object_type#Left { AST#type_member#Left current : AST#type_annotation#Left AST#primary_type#Left Language AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left fallback : AST#type_ann... | export interface LanguageSettings {
current: Language;
fallback: Language;
autoDetect: boolean;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/SettingsTypes.ets#L602-L606 | e8e7720372b81f0b67c715466b0a5aa78a53e5c9 | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/AppUtil.ets | arkts | isPortrait | 设备当前是否以竖屏方式显示(竖屏) | static isPortrait(): Boolean {
const direction = DeviceUtil.getDirection();
return direction === resourceManager.Direction.DIRECTION_VERTICAL;
} | AST#method_declaration#Left static isPortrait 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#variable_declaration#Left const AST#variable_declarator#Left dire... | static isPortrait(): Boolean {
const direction = DeviceUtil.getDirection();
return direction === resourceManager.Direction.DIRECTION_VERTICAL;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/AppUtil.ets#L351-L354 | 6829dff94f292dd7799024868c961eb7dcb0d6cd | gitee |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/sorting/SelectionSort.ets | arkts | optimizedSort | 优化的选择排序算法(同时找最大值和最小值)
@param arr 需要排序的数组
@returns 排序后的数组 | public static optimizedSort(arr: number[]): number[] {
const result = [...arr];
const n = result.length;
for (let i = 0; i < Math.floor(n / 2); i++) {
let minIdx = i;
let maxIdx = n - 1 - i;
// 如果最大值在最小值的位置,需要特殊处理
if (result[maxIdx] < result[minIdx]) {
const temp = result[m... | AST#method_declaration#Left public static optimizedSort AST#parameter_list#Left ( AST#parameter#Left arr : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotat... | public static optimizedSort(arr: number[]): number[] {
const result = [...arr];
const n = result.length;
for (let i = 0; i < Math.floor(n / 2); i++) {
let minIdx = i;
let maxIdx = n - 1 - i;
if (result[maxIdx] < result[minIdx]) {
const temp = result[minIdx];
result... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/sorting/SelectionSort.ets#L39-L78 | 31f1b66d34634ca890eb433fede370811495a114 | github |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/models/UserModel.ets | arkts | getAllUsers | 获取所有用户 | private static async getAllUsers(): Promise<Record<string, UserInfo>> {
if (!UserManager.preferencesInstance) {
const emptyUsers: Record<string, UserInfo> = {};
return emptyUsers;
}
try {
const usersJson = await UserManager.preferencesInstance.get(UserManager.KEY_USERS, '{}');
const... | AST#method_declaration#Left private static async getAllUsers AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left <... | private static async getAllUsers(): Promise<Record<string, UserInfo>> {
if (!UserManager.preferencesInstance) {
const emptyUsers: Record<string, UserInfo> = {};
return emptyUsers;
}
try {
const usersJson = await UserManager.preferencesInstance.get(UserManager.KEY_USERS, '{}');
const... | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/models/UserModel.ets#L120-L135 | b653a2d843ea9c8c1dbd7ace35820f661ed169ee | github |
xinkai-hu/MyDay.git | dcbc82036cf47b8561b0f2a7783ff0078a7fe61d | entry/src/main/ets/view/NewScheduleDialog.ets | arkts | aboutToAppear | 根据页面跳转的来源文件夹补充新日程的相关信息。 | public aboutToAppear(): void {
this.newSchedule.username = this.sourceFolder.owner;
this.newSchedule.folderName = this.sourceFolder.folderType === FolderType.NORMAL
? this.sourceFolder.folderName : '';
switch (this.sourceFolder.folderType) {
case FolderType.NORMAL:
this.newSchedule.folde... | AST#method_declaration#Left public aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expres... | public aboutToAppear(): void {
this.newSchedule.username = this.sourceFolder.owner;
this.newSchedule.folderName = this.sourceFolder.folderType === FolderType.NORMAL
? this.sourceFolder.folderName : '';
switch (this.sourceFolder.folderType) {
case FolderType.NORMAL:
this.newSchedule.folde... | https://github.com/xinkai-hu/MyDay.git/blob/dcbc82036cf47b8561b0f2a7783ff0078a7fe61d/entry/src/main/ets/view/NewScheduleDialog.ets#L115-L124 | 17cda20e81ba5e7607557b46b5bd1a34bead2c7f | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/strings/StringUtils.ets | arkts | containsDuplicates | 是否包含重复字符(空格和换行不算重复)
@param str 输入字符串
@returns 是否包含 | static containsDuplicates(str: string): boolean {
const set = new Set<string>();
const chars = Array.from(str);
for (const c of chars) {
if (!emptyStr.includes(c)) {
if (set.has(c)) {
return true;
}
set.add(c);
}
}
return false;
} | AST#method_declaration#Left static containsDuplicates 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_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#prim... | static containsDuplicates(str: string): boolean {
const set = new Set<string>();
const chars = Array.from(str);
for (const c of chars) {
if (!emptyStr.includes(c)) {
if (set.has(c)) {
return true;
}
set.add(c);
}
}
return false;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/strings/StringUtils.ets#L73-L86 | 148dc24425e4286c173d990eaeafe9c653ee6c7e | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/UniversalKeystoreKit/KeyGenerationImport/KeyImport/DevelopmentGuidelines/ImportEncryptedKey/entry/src/main/ets/pages/ImportEncryptedKey.ets | arkts | ImportWrappedKey | 模拟加密导入密钥场景,设备A为远端设备(导入设备),设备B为本端设备(被导入设备) | async function ImportWrappedKey() {
/**
* 1.设备A将待导入密钥转换成HUKS密钥材料格式To_Import_Key(仅针对非对称密钥,若待导入密钥是对称密钥则可省略此步骤),
* 本示例使用importedAes256PlainKey(对称密钥)作为模拟
*/
/* 2.设备B生成一个加密导入用途的、用于协商的非对称密钥对Wrapping_Key(公钥Wrapping_Pk,私钥Wrapping_Sk),
* 其密钥用途设置为unwrap,导出Wrapping_Key公钥Wrapping_Pk存放在变量huksPubKey中
*/
con... | AST#function_declaration#Left async function ImportWrappedKey AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { /**
* 1.设备A将待导入密钥转换成HUKS密钥材料格式To_Import_Key(仅针对非对称密钥,若待导入密钥是对称密钥则可省略此步骤),
* 本示例使用importedAes256PlainKey(对称密钥)作为模拟
*/ /* 2.设备B生成一个加密导入用途的、用于协商的非对称密钥对Wrapping_Key(公钥Wrap... | async function ImportWrappedKey() {
const srcKeyAliasWrap = 'HUKS_Basic_Capability_Import_0200';
await generateAndExportPublicKey(srcKeyAliasWrap, genWrappingKeyParams, false);
await generateAndExportPublicKey(callerKeyAlias, genCallerEcdhParams, true);
await importKekAndAgreeSharedSecret(callerK... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/UniversalKeystoreKit/KeyGenerationImport/KeyImport/DevelopmentGuidelines/ImportEncryptedKey/entry/src/main/ets/pages/ImportEncryptedKey.ets#L579-L622 | 9a1472f410067a8e96a48ad9a777da6a9fcdc326 | gitee |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/common/models/ThemeModel.ets | arkts | 主题应用状态接口 | export interface ThemeApplicationState {
isTransitioning: boolean;
transitionDuration: number;
appliedPages: string[];
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ThemeApplicationState AST#object_type#Left { AST#type_member#Left isTransitioning : 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 transitionD... | export interface ThemeApplicationState {
isTransitioning: boolean;
transitionDuration: number;
appliedPages: string[];
} | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/models/ThemeModel.ets#L131-L135 | cec5533ce9f7b84bf9bab293a529147b56b5cf5e | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customstepper/src/main/ets/common/DataModel.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class TableInfoWrapper {
public username: string | undefined = undefined;
public age: number | undefined = undefined;
} | AST#export_declaration#Left export AST#class_declaration#Left class TableInfoWrapper AST#class_body#Left { AST#property_declaration#Left public username : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_t... | export class TableInfoWrapper {
public username: string | undefined = undefined;
public age: number | undefined = undefined;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customstepper/src/main/ets/common/DataModel.ets#L17-L20 | 53400854eb223db900af228079f8db588dd09ae6 | gitee | |
lulululing/calendar.git | c87b7e3ffb50a34941a5db50afe6a513c113bd0b | entry/src/main/ets/manager/NotificationManager.ets | arkts | 通知管理器 | export class NotificationManager {
private static instance: NotificationManager
private timers: Map<string, number> = new Map() // 存储定时器ID
private constructor() {}
static getInstance(): NotificationManager {
if (!NotificationManager.instance) {
NotificationManager.instance = new NotificationManager(... | AST#export_declaration#Left export AST#class_declaration#Left class NotificationManager AST#class_body#Left { AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#primary_type#Left NotificationManager AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#pr... | export class NotificationManager {
private static instance: NotificationManager
private timers: Map<string, number> = new Map()
private constructor() {}
static getInstance(): NotificationManager {
if (!NotificationManager.instance) {
NotificationManager.instance = new NotificationManager()
}
... | https://github.com/lulululing/calendar.git/blob/c87b7e3ffb50a34941a5db50afe6a513c113bd0b/entry/src/main/ets/manager/NotificationManager.ets#L8-L214 | f835356d0b6e441b5d48b72e20d457d39a1aee02 | github | |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/utils/PromptUtils.ets | arkts | 显示确认对话框
@param title 标题
@param message 消息内容
@param confirmText 确认按钮文本
@param cancelText 取消按钮文本
@returns Promise<boolean> 用户是否确认 | export function showConfirmDialog(
title: string,
message: string,
confirmText: string = '确定',
cancelText: string = '取消'
): Promise<boolean> {
return new Promise((resolve) => {
try {
// 创建按钮数组
const buttons: DialogButton[] = [
{
text: cancelText,
color: '#666666'
... | AST#export_declaration#Left export AST#function_declaration#Left function showConfirmDialog AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left message : AST#type_annotation#L... | export function showConfirmDialog(
title: string,
message: string,
confirmText: string = '确定',
cancelText: string = '取消'
): Promise<boolean> {
return new Promise((resolve) => {
try {
const buttons: DialogButton[] = [
{
text: cancelText,
color: '#666666'
},
... | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/utils/PromptUtils.ets#L32-L70 | 20b76f485e86e4d472707182ee804692a10913d5 | github | |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/viewmodel/TaskViewModel.ets | arkts | incrementPomodoroCount | 增加番茄钟数量 | async incrementPomodoroCount(id: number): Promise<boolean> {
const task = this.getTaskById(id);
if (!task) return false;
const currentTimeRecord: TaskTimeRecord = task.timeRecord || {
startTime: undefined,
endTime: undefined,
totalTimeSpent: 0,
focusTime: 0,
breakTime: 0,
... | AST#method_declaration#Left async incrementPomodoroCount 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_ty... | async incrementPomodoroCount(id: number): Promise<boolean> {
const task = this.getTaskById(id);
if (!task) return false;
const currentTimeRecord: TaskTimeRecord = task.timeRecord || {
startTime: undefined,
endTime: undefined,
totalTimeSpent: 0,
focusTime: 0,
breakTime: 0,
... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/TaskViewModel.ets#L386-L412 | 75ea65aa23369491d332786849a5560b0aa8d2b1 | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | VideoProcessBaseWeb/entry/src/main/ets/utils/WebDownloadManager.ets | arkts | [StartExclude manage] | private constructor() {
super()
} | AST#constructor_declaration#Left private 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#R... | private constructor() {
super()
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/VideoProcessBaseWeb/entry/src/main/ets/utils/WebDownloadManager.ets#L56-L58 | 4f72df500a62ff28bb9f700b0e60c025eb3ed0fb | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/common/Index.ets | arkts | CommonGraph | @file common 模块统一导出
@author Joker.X | export { CommonGraph } from "./src/main/ets/navigation/CommonGraph"; | AST#export_declaration#Left export { CommonGraph } from "./src/main/ets/navigation/CommonGraph" ; AST#export_declaration#Right | export { CommonGraph } from "./src/main/ets/navigation/CommonGraph"; | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/Index.ets#L6-L6 | 247b25bbbb25e439f721b90b4de150f96a7d0a0a | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.ChipGroup.d.ets | arkts | Defines IconItemOptions.
@interface IconItemOptions
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export interface IconItemOptions {
/**
* IconOptions.
*
* @type { IconOptions }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
icon: IconOptions;
/**
* Icon Action.
*
* @type { Callback<void> }
* @sysc... | AST#export_declaration#Left export AST#interface_declaration#Left interface IconItemOptions AST#object_type#Left { /**
* IconOptions.
*
* @type { IconOptions }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/ AST#type_member#Left icon :... | export interface IconItemOptions {
icon: IconOptions;
action: Callback<void>;
accessibilityText?: ResourceStr;
accessibilityDescription?: ResourceStr;
accessibilityLevel?: string;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ChipGroup.d.ets#L396-L452 | 78262fc80b7f63834b8552c1e1fc5141d203eaa7 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/auth/src/main/ets/viewmodel/LoginViewModel.ets | arkts | onAlipayLoginClick | 支付宝登录点击
@returns {void} 无返回值 | onAlipayLoginClick(): void {
// 第三方登录暂未接入,等待后续实现
} | AST#method_declaration#Left onAlipayLoginClick 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 | onAlipayLoginClick(): void {
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/auth/src/main/ets/viewmodel/LoginViewModel.ets#L28-L30 | 32c1b7ca4d8705667c8c3aa8c572dd3fa4c69674 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Connectivity/NetworkObserver/entry/src/main/ets/utils/NetUtils.ets | arkts | getSignalLevel | 获取当前连接Wi-Fi的信号强度
通过获取信号强度,用户可以初步判断当前网络是否能够满足其对速度的需求。
取值范围为[0, 4],取值越大表示信号越强
@returns 信号强度,取值范围[0, 4],-1表示报错 | async getSignalLevel(): Promise<number> {
try {
let wifiLinkedInfo: wifiManager.WifiLinkedInfo = await wifiManager.getLinkedInfo();
let rssi = wifiLinkedInfo.rssi;
let band = wifiLinkedInfo.band;
let level = wifiManager.getSignalLevel(rssi, band);
logger.info('level:' + JSON.stringify(... | AST#method_declaration#Left async getSignalLevel 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 number AST#primary_type#Right AST#type_annotation#Right > AST#type... | async getSignalLevel(): Promise<number> {
try {
let wifiLinkedInfo: wifiManager.WifiLinkedInfo = await wifiManager.getLinkedInfo();
let rssi = wifiLinkedInfo.rssi;
let band = wifiLinkedInfo.band;
let level = wifiManager.getSignalLevel(rssi, band);
logger.info('level:' + JSON.stringify(... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/NetworkObserver/entry/src/main/ets/utils/NetUtils.ets#L252-L264 | da4ae3e644e271fc656cd61f0403ec566f400e22 | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/components/menu/VHInviteDialog.ets | arkts | aboutToAppear | 目标组件ID | aboutToAppear() {
let liveDetailUrl = VHSaaSDK.getInstance()
.getLiveDetailUrl(this.webinars?.webinar!.id.toString(), this.webinars?.join_info!.user_id.toString(),
this.inviteCard?.invite_code!);
this.rqCodeUrl = 'https://aliqr.e.vhall.com/qr.png?s=7&t=' + encodeURIComponent(liveDetailUrl);
} | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left liveDetailUrl = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expr... | aboutToAppear() {
let liveDetailUrl = VHSaaSDK.getInstance()
.getLiveDetailUrl(this.webinars?.webinar!.id.toString(), this.webinars?.join_info!.user_id.toString(),
this.inviteCard?.invite_code!);
this.rqCodeUrl = 'https://aliqr.e.vhall.com/qr.png?s=7&t=' + encodeURIComponent(liveDetailUrl);
} | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/menu/VHInviteDialog.ets#L46-L51 | 4a2f7629e9893c2691d1d2a8186ce7c023bbcf26 | gitee |
mhtcgr/ToDoList_For_Harmony.git | 356d4c9a507205f02870e970203022a380c8a2a1 | entry/src/main/ets/common/utils/Logger.ets | arkts | info | Outputs info-level logs.
@param args Indicates the log parameters. | info(...args: string[]) {
hilog.info(this.domain, this.prefix, this.format, args);
} | AST#method_declaration#Left info AST#parameter_list#Left ( AST#parameter#Left ... args : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST... | info(...args: string[]) {
hilog.info(this.domain, this.prefix, this.format, args);
} | https://github.com/mhtcgr/ToDoList_For_Harmony.git/blob/356d4c9a507205f02870e970203022a380c8a2a1/entry/src/main/ets/common/utils/Logger.ets#L47-L49 | f940e06d5a9cc6ce9120a3d6f1dcdfb88e42d411 | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alicon/2.0.0/package/index.ets | arkts | formatQueryString | 实现查询字符串处理(替换querystring) | function formatQueryString(params: Record<string, string>): string {
const searchParams = new URLSearchParams();
for (const [key, value] of Object.entries(params)) {
searchParams.append(key, value);
} | AST#function_declaration#Left function formatQueryString AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AS... | function formatQueryString(params: Record<string, string>): string {
const searchParams = new URLSearchParams();
for (const [key, value] of Object.entries(params)) {
searchParams.append(key, value);
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alicon/2.0.0/package/index.ets#L33-L37 | 6cda19b84ff38c9a46e1dc057310ad58372c4566 | github |
lime-zz/Ark-ui_RubbishRecycleApp.git | c2a9bff8fbb5bc46d922934afad0327cc1696969 | rubbish/rubbish/entry/src/main/ets/pages/gouwuche.ets | arkts | toggleSelectAll | 更新全选状态 | toggleSelectAll() {
const newSelectedState = !this.isSelectedAll;
const newDatas: Type1[] = this.datas.map((item: Type1): Type1 => {
return {
img: item.img,
contents: item.contents,
dvalue: item.dvalue,
cvalue: item.cvalue,
amount: item.amount,
avalue: item... | AST#method_declaration#Left toggleSelectAll AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left newSelectedState = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ... | toggleSelectAll() {
const newSelectedState = !this.isSelectedAll;
const newDatas: Type1[] = this.datas.map((item: Type1): Type1 => {
return {
img: item.img,
contents: item.contents,
dvalue: item.dvalue,
cvalue: item.cvalue,
amount: item.amount,
avalue: item... | https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/gouwuche.ets#L113-L131 | ade783ea05d04a610b99073ab608cf0cb2b8fbd4 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/common/ErrorHandler.ets | arkts | createAIServiceError | 创建AI服务错误 | static createAIServiceError(originalError: Error, operation: string): ErrorInfo {
const contextData: ErrorContext = { operation: operation };
const errorInfo: ErrorInfo = {
type: ErrorType.AI_SERVICE,
message: `AI service operation failed: ${operation}`,
originalError,
context: contextDa... | AST#method_declaration#Left static createAIServiceError AST#parameter_list#Left ( AST#parameter#Left originalError : AST#type_annotation#Left AST#primary_type#Left Error AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left operation : AST#type_annotation#Left AST#primary_type#Left s... | static createAIServiceError(originalError: Error, operation: string): ErrorInfo {
const contextData: ErrorContext = { operation: operation };
const errorInfo: ErrorInfo = {
type: ErrorType.AI_SERVICE,
message: `AI service operation failed: ${operation}`,
originalError,
context: contextDa... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/common/ErrorHandler.ets#L247-L262 | e42c8651a045c28eec16859594a633a745efb093 | github |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/pages/community/PostEditPage.ets | arkts | loadUserDreams | 加载用户的梦想列表 | async loadUserDreams() {
try {
this.isLoadingDreams = true;
const userId = this.userSession.getUserId();
if (!userId) {
promptAction.showToast({
message: '无法获取用户信息',
duration: 2000
});
return;
}
// 调用API获取用户的梦想列表
const dreams = a... | AST#method_declaration#Left async loadUserDreams AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_express... | async loadUserDreams() {
try {
this.isLoadingDreams = true;
const userId = this.userSession.getUserId();
if (!userId) {
promptAction.showToast({
message: '无法获取用户信息',
duration: 2000
});
return;
}
const dreams = await ApiService.g... | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/community/PostEditPage.ets#L229-L256 | 94685a8172b7260e947a2911f658d17664d96251 | github |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.DownloadFileButton.d.ets | arkts | Defines the DownloadFileButton style option.
@interface DownloadStyleOptions
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export interface DownloadStyleOptions {
/**
* Icon size.
*
* @type { ?Dimension }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
iconSize?: Dimension;
/**
* Layout direction.
*
* @type { ?DownloadLayoutDirec... | AST#export_declaration#Left export AST#interface_declaration#Left interface DownloadStyleOptions AST#object_type#Left { /**
* Icon size.
*
* @type { ?Dimension }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/ AST#type_member#Left icon... | export interface DownloadStyleOptions {
iconSize?: Dimension;
layoutDirection?: DownloadLayoutDirection;
fontSize?: Dimension;
fontStyle?: FontStyle;
fontWeight?: number | FontWeight | string;
fontFamily?: string | Resource;
fontColor?: ResourceColor;
... | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.DownloadFileButton.d.ets#L200-L291 | 3099a13099886224421d921a6daee2b2ba5a41b5 | github | |
openharmony/multimedia_camera_framework | 9873dd191f59efda885bc06897acf9b0660de8f2 | frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets | arkts | previewOutputCallBack | 监听预览事件 | previewOutputCallBack(previewOutput: camera.PreviewOutput): void {
Logger.info(TAG, 'previewOutputCallBack is called');
try {
previewOutput.on('frameStart', (): void => {
Logger.debug(TAG, 'Preview frame started');
AppStorage.setOrCreate('frameStart', ++this.frameStartFlag);
});
... | AST#method_declaration#Left previewOutputCallBack AST#parameter_list#Left ( AST#parameter#Left previewOutput : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left camera . PreviewOutput AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#... | previewOutputCallBack(previewOutput: camera.PreviewOutput): void {
Logger.info(TAG, 'previewOutputCallBack is called');
try {
previewOutput.on('frameStart', (): void => {
Logger.debug(TAG, 'Preview frame started');
AppStorage.setOrCreate('frameStart', ++this.frameStartFlag);
});
... | https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets#L617-L633 | 0de7f0e1adf7e23b7cd7c04a9710f91577ffadf7 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Security/DLP/entry/src/main/ets/feature/FileManager.ets | arkts | handleFileData | 处理文件数据 | async handleFileData(dlpFileInfos: Array<TestDlpFileInfo>) {
if (dlpFileInfos.length > 0) {
for (let index = 0; index < this.fileInfos.length && index < RECENT_MAX; index++) {
dlpFileInfos.forEach(async (item: TestDlpFileInfo, ind: number) => {
let uriInfo: fileUri.FileUri = await this.getFi... | AST#method_declaration#Left async handleFileData AST#parameter_list#Left ( AST#parameter#Left dlpFileInfos : 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 TestDlpFileInfo AST#primary_type#Right AST#type_annotation#Righ... | async handleFileData(dlpFileInfos: Array<TestDlpFileInfo>) {
if (dlpFileInfos.length > 0) {
for (let index = 0; index < this.fileInfos.length && index < RECENT_MAX; index++) {
dlpFileInfos.forEach(async (item: TestDlpFileInfo, ind: number) => {
let uriInfo: fileUri.FileUri = await this.getFi... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Security/DLP/entry/src/main/ets/feature/FileManager.ets#L110-L122 | 6024c775f744d7d3354f55270dec15c465349958 | gitee |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/services/AgvMovementService.ets | arkts | heartbeat | 查询AGV心跳状态
@returns AGV心跳状态 | static async heartbeat(): Promise<HeartbeatResult> {
try {
console.info('[AgvMovementService] 💓 查询AGV心跳状态');
const response = await HttpUtil.get('/agv/movement/heartbeat');
interface HeartbeatData {
status?: string;
}
const heartbeatData = response.data as HeartbeatData;
... | AST#method_declaration#Left static async heartbeat 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 HeartbeatResult AST#primary_type#Right AST#type_annotation#Right... | static async heartbeat(): Promise<HeartbeatResult> {
try {
console.info('[AgvMovementService] 💓 查询AGV心跳状态');
const response = await HttpUtil.get('/agv/movement/heartbeat');
interface HeartbeatData {
status?: string;
}
const heartbeatData = response.data as HeartbeatData;
... | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/AgvMovementService.ets#L29-L54 | 08381a16ebc9797322a98a7fc5d729a1949e03fa | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example3/common/CommonText.ets | arkts | CommonText | column间隙
自定义封装公共文本组件 | @Component
export struct CommonText {
build() {
Row() {
Text($r('app.string.dynamicattributes_text_one'))
.fontSize(12)
.fontColor($r('app.color.dynamicattributes_orange'))
.textAlign(TextAlign.Center)
Text($r('app.string.dynamicattributes_text_two'))
.fontSize(12)
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CommonText AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { A... | @Component
export struct CommonText {
build() {
Row() {
Text($r('app.string.dynamicattributes_text_one'))
.fontSize(12)
.fontColor($r('app.color.dynamicattributes_orange'))
.textAlign(TextAlign.Center)
Text($r('app.string.dynamicattributes_text_two'))
.fontSize(12)
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example3/common/CommonText.ets#L64-L83 | 29f39ca08479465434c2d546f5a6ddcf74fb05d0 | gitee |
de8gemaker/AccountApp.git | b5156cd90ac02239b39fd0f91d32851acad8ba42 | entry/src/main/ets/service/account.ets | arkts | deleteById | 根据id删除一条记录 | deleteById(id: number) {
return AccountModel.deleteById(id);
} | AST#method_declaration#Left deleteById AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AS... | deleteById(id: number) {
return AccountModel.deleteById(id);
} | https://github.com/de8gemaker/AccountApp.git/blob/b5156cd90ac02239b39fd0f91d32851acad8ba42/entry/src/main/ets/service/account.ets#L22-L24 | 4aadd2c273dba7e6557a31498572bb915c2e086c | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets | arkts | encode2048PKCS1Segment | 2048位加密-分段
@param str 待加密的字符串
@param pubKey 2048位RSA公钥
@param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式
@param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
@param isPem 秘钥是否为pem格式 - 默认为false | static encode2048PKCS1Segment(str: string, pubKey: string, keyCoding: buffer.BufferEncoding,
resultCoding: buffer.BufferEncoding = 'base64', isPem: boolean = false): OutDTO<string> {
return CryptoSyncUtil.encodeAsymSegment(str, pubKey, 'RSA2048', 'RSA2048|PKCS1', 2048, keyCoding, resultCoding,
isPem);
} | AST#method_declaration#Left static encode2048PKCS1Segment 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 pubKey : AST#type_annotation#Left AST#primary_type#Left string AST#... | static encode2048PKCS1Segment(str: string, pubKey: string, keyCoding: buffer.BufferEncoding,
resultCoding: buffer.BufferEncoding = 'base64', isPem: boolean = false): OutDTO<string> {
return CryptoSyncUtil.encodeAsymSegment(str, pubKey, 'RSA2048', 'RSA2048|PKCS1', 2048, keyCoding, resultCoding,
isPem);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets#L96-L100 | bdcb28eb1d32e304d2d8841d6fded929caf8eddd | gitee |
xinkai-hu/MyDay.git | dcbc82036cf47b8561b0f2a7783ff0078a7fe61d | entry/src/main/ets/common/database/ScheduleTable.ets | arkts | 日程数据表的数据存储及操作。 | export default class scheduleTable {
private scheduleTable = new Rdb(
CommonConstants.SCHEDULE_TABLE.tableName,
CommonConstants.SCHEDULE_TABLE.sqlCreate,
CommonConstants.SCHEDULE_TABLE.columns);
constructor(callback: Function = () => {
}) {
this.scheduleTable.getRdbStore(callback);
}
getRdbS... | AST#export_declaration#Left export default AST#class_declaration#Left class scheduleTable AST#class_body#Left { AST#property_declaration#Left private scheduleTable = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Rdb AST#expression#Right AST#new_expressi... | export default class scheduleTable {
private scheduleTable = new Rdb(
CommonConstants.SCHEDULE_TABLE.tableName,
CommonConstants.SCHEDULE_TABLE.sqlCreate,
CommonConstants.SCHEDULE_TABLE.columns);
constructor(callback: Function = () => {
}) {
this.scheduleTable.getRdbStore(callback);
}
getRdbS... | https://github.com/xinkai-hu/MyDay.git/blob/dcbc82036cf47b8561b0f2a7783ff0078a7fe61d/entry/src/main/ets/common/database/ScheduleTable.ets#L27-L102 | 2f3ad383eae671cfdf0c46f7dcff2bf3d962ebcc | github | |
kinghy949/kinghy_zufang.git | 471cc1273fbea66b88a4b7803e3f08c83a2de7ce | entry/src/main/ets/constants/size.ets | arkts | 阴影 | export const SHADOW_RADIUS = 7.8; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left SHADOW_RADIUS = AST#expression#Left 7.8 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const SHADOW_RADIUS = 7.8; | https://github.com/kinghy949/kinghy_zufang.git/blob/471cc1273fbea66b88a4b7803e3f08c83a2de7ce/entry/src/main/ets/constants/size.ets#L12-L12 | 19ccc1fae2a94f104db7668da2736d8111215ed5 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Speech/Recorder/SpeechRecordManager.ets | arkts | stopPlay | 停止播放 | async stopPlay(): Promise<void> {
await this.stopPlaying();
} | AST#method_declaration#Left async stopPlay 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_argumen... | async stopPlay(): Promise<void> {
await this.stopPlaying();
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Speech/Recorder/SpeechRecordManager.ets#L84-L86 | b7eecb1d45efa7dfe012fdfe834aca77beef20db | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/viewmodel/CategoryViewModel.ets | arkts | clampIndex | 校验侧边栏索引合法性
@param {number} index - 原始索引
@returns {number} 合法索引,不合法返回 -1 | private clampIndex(index: number): number {
const total: number = this.categoryTrees.length;
if (total <= 0) {
return 0;
}
if (index < 0) {
return 0;
}
if (index >= total) {
return total - 1;
}
return index;
} | AST#method_declaration#Left private clampIndex 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 number AST#primary_ty... | private clampIndex(index: number): number {
const total: number = this.categoryTrees.length;
if (total <= 0) {
return 0;
}
if (index < 0) {
return 0;
}
if (index >= total) {
return total - 1;
}
return index;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/viewmodel/CategoryViewModel.ets#L126-L138 | ab4f1d14e54f5b5a01b7d306591d09cfbd87aad8 | github |
PureHarmonyProject/ScanKit_SampleCode_Clientdemo_ArkTS.git | 3b5fa45c650dcae2773a19f122161935e0c0e2bc | entry/src/main/ets/pages/customScan/model/ScanService.ets | arkts | retryOnCondition | start回调时,根据error判断是否做重试操作 | retryOnCondition(error: BusinessError, options: scanBarcode.ScanOptions, viewControl: customScan.ViewControl,
callback: AsyncCallback<Array<scanBarcode.ScanResult>>): boolean {
if (error) {
Logger.error(TAG,
`An error is returned during customCallbackScan. Code: ${error.code}, message: ${error.mes... | AST#method_declaration#Left retryOnCondition AST#parameter_list#Left ( AST#parameter#Left error : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left AST#qualified_... | retryOnCondition(error: BusinessError, options: scanBarcode.ScanOptions, viewControl: customScan.ViewControl,
callback: AsyncCallback<Array<scanBarcode.ScanResult>>): boolean {
if (error) {
Logger.error(TAG,
`An error is returned during customCallbackScan. Code: ${error.code}, message: ${error.mes... | https://github.com/PureHarmonyProject/ScanKit_SampleCode_Clientdemo_ArkTS.git/blob/3b5fa45c650dcae2773a19f122161935e0c0e2bc/entry/src/main/ets/pages/customScan/model/ScanService.ets#L219-L240 | 1989fbd1fbf8fdb649e3745cfe2bd06672d0d130 | github |
toly1994328/HarmonyUnit | 318c99f475e5457350405fc905343d9b3e81812c | entry/src/main/ets/pages/muyu/model/ImageOption.ets | arkts | 每次点击时功德最大值 | constructor(name: string, src: ResourceStr, min: number, max: number) {
this.name = name;
this.src = src;
this.min = min;
this.max = max;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left src : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_ty... | constructor(name: string, src: ResourceStr, min: number, max: number) {
this.name = name;
this.src = src;
this.min = min;
this.max = max;
} | https://github.com/toly1994328/HarmonyUnit/blob/318c99f475e5457350405fc905343d9b3e81812c/entry/src/main/ets/pages/muyu/model/ImageOption.ets#L7-L12 | 2ec2d7a131d42d0208fcf62afbe5586aea5715b0 | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/BarDataSet.ets | arkts | getBarBorderColor | Returns the color drawing borders around the bars.
@return | public getBarBorderColor(): number {
return this.mBarBorderColor;
} | AST#method_declaration#Left public getBarBorderColor 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... | public getBarBorderColor(): number {
return this.mBarBorderColor;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L262-L264 | 54ccaf7fb19a0d0c6f76b2f8e1efe2ccfc6fa40f | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/utils/environment_tools.ets | arkts | Retrieves the context from AppStorage (from abilityStage).
@returns Context. | export function meowContext() {
return AppStorage.get('context') as Context;
} | AST#export_declaration#Left export AST#function_declaration#Left function meowContext AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#expression... | export function meowContext() {
return AppStorage.get('context') as Context;
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/environment_tools.ets#L7-L9 | a9eff2adf04fabc84937f7704e076111103579bd | gitee | |
zhongte/TaoYao | 80850f3800dd6037216d3f7c58a2bf34a881c93f | taoyao/src/main/ets/shijing/taoyao/origin/UIAbilityOrigin.ets | arkts | 在UIAbility中申请权限 | export class UIAbilityOrigin extends Origin {
private uiAbility: UIAbility
constructor | AST#export_declaration#Left export AST#ERROR#Left class UIAbilityOrigin extends AST#type_annotation#Left AST#primary_type#Left Origin AST#primary_type#Right AST#type_annotation#Right { private uiAbility : UIAbility AST#ERROR#Right AST#variable_declaration#Left const AST#variable_declarator#Left ructor AST#variable_decl... | export class UIAbilityOrigin extends Origin {
private uiAbility: UIAbility
constructor | https://github.com/zhongte/TaoYao/blob/80850f3800dd6037216d3f7c58a2bf34a881c93f/taoyao/src/main/ets/shijing/taoyao/origin/UIAbilityOrigin.ets#L7-L11 | fc10755594cafd0f5dfc877e2bafe07db9ec9731 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/view/OrderDetailPage.ets | arkts | OrderInfoCard | 订单信息卡片
@returns {void} 无返回值 | @Builder
private OrderInfoCard(order: Order) {
Card() {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
hasBorder: true,
titleBuilder: (): void => this.OrderInfoTitle()
});
IBestCe... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private OrderInfoCard AST#parameter_list#Left ( AST#parameter#Left order : AST#type_annotation#Left AST#primary_type#Left Order AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_functio... | @Builder
private OrderInfoCard(order: Order) {
Card() {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
hasBorder: true,
titleBuilder: (): void => this.OrderInfoTitle()
});
IBestCe... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderDetailPage.ets#L284-L329 | a4e0eef862d4324355bef51dd634fc6443a4b262 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/StrUtil.ets | arkts | isNotNull | 判断字符串是否为非空。true为非空空,否则false
@param str
@returns | static isNotNull(str: string | number | undefined | null): boolean {
return false === StrUtil.isNull(str);
} | AST#method_declaration#Left static isNotNull AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right | AST#primary_ty... | static isNotNull(str: string | number | undefined | null): boolean {
return false === StrUtil.isNull(str);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/StrUtil.ets#L44-L46 | 57ad048a41293a1c7a1b4e775cbecb2fe4247529 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plancurve/Plan.ets | arkts | boxForWord | MARK: - Utils for box / 获取指定wordId在某天dayOf上的 box | boxForWord(wordId: number, dayOf: DayOf): Box | null {
let pieceNos = new Set(dayOf.pieceNos());
let piece = this.pieces.find((p) => pieceNos.has(p.pieceNo!) && (p.wordIds ?? []).includes(wordId));
if (piece !== null && piece !== undefined) {
return dayOf.boxes.find((b) => b.pieceNo === piece?.piec... | AST#method_declaration#Left boxForWord AST#parameter_list#Left ( AST#parameter#Left wordId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dayOf : AST#type_annotation#Left AST#primary_type#Left DayOf AST#primary_type#Right... | boxForWord(wordId: number, dayOf: DayOf): Box | null {
let pieceNos = new Set(dayOf.pieceNos());
let piece = this.pieces.find((p) => pieceNos.has(p.pieceNo!) && (p.wordIds ?? []).includes(wordId));
if (piece !== null && piece !== undefined) {
return dayOf.boxes.find((b) => b.pieceNo === piece?.piec... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L396-L403 | a711db947fa6f48e5dd63b5d429da240850596f1 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/palette/src/main/ets/model/RenderNodeModel.ets | arkts | aboutToResize | 绑定的NodeContainer布局时触发,获取NodeContainer的宽高 | aboutToResize(size: Size): void {
if (this.rootRenderNode !== null) {
// NodeContainer布局完成后设置rootRenderNode的背景透明
this.rootRenderNode.backgroundColor = 0X00000000;
// rootRenderNode的位置从组件NodeContainer的左上角(0,0)坐标开始,大小为NodeContainer的宽高
this.rootRenderNode.frame = {
x: 0,
y: 0,
... | AST#method_declaration#Left aboutToResize AST#parameter_list#Left ( AST#parameter#Left size : AST#type_annotation#Left AST#primary_type#Left Size 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 A... | aboutToResize(size: Size): void {
if (this.rootRenderNode !== null) {
this.rootRenderNode.backgroundColor = 0X00000000;
this.rootRenderNode.frame = {
x: 0,
y: 0,
width: size.width,
height: size.height
};
}
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/palette/src/main/ets/model/RenderNodeModel.ets#L74-L86 | b17bb22bad80c8795d74fb7a766d0b164fda9eba | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/AppUtil.ets | arkts | onAbilityLifecycle | 注册监听应用内生命周期。使用callback异步回调。仅支持主线程调用。
@param callback 回调方法,返回注册监听事件的ID。
@returns | static onAbilityLifecycle(callback: AbilityLifecycleCallback): number {
return AppUtil.getApplicationContext().on('abilityLifecycle', callback);
} | AST#method_declaration#Left static onAbilityLifecycle AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left AbilityLifecycleCallback AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_typ... | static onAbilityLifecycle(callback: AbilityLifecycleCallback): number {
return AppUtil.getApplicationContext().on('abilityLifecycle', callback);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/AppUtil.ets#L303-L305 | 6b728b54102b31dd50f10a0beb8c9727370c952b | gitee |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/strings/ZFunction.ets | arkts | computeZArray | 计算字符串的 Z 函数数组
@param str 输入字符串
@returns Z 函数数组 | static computeZArray(str: string): number[] {
const n = str.length;
if (n === 0) {
return [];
}
const z: number[] = new Array(n).fill(0);
let left = 0;
let right = 0;
for (let i = 1; i < n; i++) {
if (i > right) {
// 暴力匹配
left = right = i;
while (right <... | AST#method_declaration#Left static computeZArray 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_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left n... | static computeZArray(str: string): number[] {
const n = str.length;
if (n === 0) {
return [];
}
const z: number[] = new Array(n).fill(0);
let left = 0;
let right = 0;
for (let i = 1; i < n; i++) {
if (i > right) {
left = right = i;
while (right < n && s... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/strings/ZFunction.ets#L11-L47 | a6fea3854a96113deaf7e7dfaf00cd8e99dc7a39 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/strings/StringMapUtility.ets | arkts | removedDuplicationsWithTrim | / 按指定的分隔符split之后去除重复项 / 返回的结果是按原来的seperator合并的 | public static removedDuplicationsWithTrim(
srcStr : string,
seperator : string,
trimedBeforeCompare : boolean
): string {
const array : Array<string> = [];
const transform = new RemoveDuplicateTransform(array, trimedBeforeCompare);
return StringMapUtility.map(srcStr, s... | AST#method_declaration#Left public static removedDuplicationsWithTrim AST#parameter_list#Left ( AST#parameter#Left srcStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left seperator : AST#type_annotation#Left AST#primary_typ... | public static removedDuplicationsWithTrim(
srcStr : string,
seperator : string,
trimedBeforeCompare : boolean
): string {
const array : Array<string> = [];
const transform = new RemoveDuplicateTransform(array, trimedBeforeCompare);
return StringMapUtility.map(srcStr, s... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/strings/StringMapUtility.ets#L17-L27 | ce266a64873d7772b1c3ddc7e66210bf49e1ff18 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/chat/AIAssistantPage.ets | arkts | buildMessageCard | 构建消息卡片 | @Builder
buildMessageCard(message: ChatMessage) {
// 可以根据消息metadata显示不同类型的卡片
Column({ space: 12 }) {
Text(message.content)
.fontSize(14)
.fontColor($r('app.color.text_primary'))
// 示例:生日卡片
if (message.metadata?.cardType === 'birthday') {
this.buildBirthdayCard(messag... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildMessageCard AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left ChatMessage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_func... | @Builder
buildMessageCard(message: ChatMessage) {
Column({ space: 12 }) {
Text(message.content)
.fontSize(14)
.fontColor($r('app.color.text_primary'))
if (message.metadata?.cardType === 'birthday') {
this.buildBirthdayCard(message.metadata)
}
}
.width... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/chat/AIAssistantPage.ets#L271-L286 | 0674c5df16e134d1f6c40f1f69519fe3b2e1320c | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ar/ARCardService.ets | arkts | 相机配置接口 | export interface CameraConfig {
position: Vector3D;
target: Vector3D;
fieldOfView: number;
nearPlane: number;
farPlane: number;
enableGestures: boolean;
zoomRange: [number, number];
} | AST#export_declaration#Left export AST#interface_declaration#Left interface CameraConfig AST#object_type#Left { AST#type_member#Left position : AST#type_annotation#Left AST#primary_type#Left Vector3D AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left target : AST#type_annotati... | export interface CameraConfig {
position: Vector3D;
target: Vector3D;
fieldOfView: number;
nearPlane: number;
farPlane: number;
enableGestures: boolean;
zoomRange: [number, number];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L66-L74 | 8a468aa6c5eb4575db258bfb199b368c24e30940 | github | |
Rayawa/dashboard.git | 9107efe7fb69a58d799a378b79ea8ffa4041cec8 | entry/src/main/ets/ability/entry.ets | arkts | onForeground | async resetImmersiveMode() { try { const windowClass = await window.getLastWindow(this.context); if (windowClass) { await windowClass.setWindowSystemBarProperties({ statusBarColor: '#00000000', navigationBarColor: '#00000000', statusBarContentColor: '#FFffffff', navigationBarContentColor: '#FFffffff' }); } } catch (err... | onForeground(): void {
// this.resetImmersiveMode();
} | AST#method_declaration#Left onForeground 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 { // this.resetImmersiveMode(); } AST#builder_function_body#Right AST#method_declaration#Rig... | onForeground(): void {
} | https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/ability/entry.ets#L90-L92 | ffbac1f6fd097dc236edcf7170f4086e5d0b65aa | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets | arkts | getCropRect | Get crop rect.
@returns | getCropRect(): RectF {
let crop = new RectF();
crop.set(this.cropRect.left, this.cropRect.top, this.cropRect.right, this.cropRect.bottom);
return crop;
} | AST#method_declaration#Left getCropRect AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left RectF AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left crop = AST#exp... | getCropRect(): RectF {
let crop = new RectF();
crop.set(this.cropRect.left, this.cropRect.top, this.cropRect.right, this.cropRect.bottom);
return crop;
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets#L94-L98 | 9e68a28369c62632523fe3bfbcc940974260df1f | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/textoverflow/Index.ets | arkts | TextOverflowPageComponent | 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 { TextOverflowPageComponent } from './src/main/ets/components/mainpage/TextOverflowPage'; | AST#export_declaration#Left export { TextOverflowPageComponent } from './src/main/ets/components/mainpage/TextOverflowPage' ; AST#export_declaration#Right | export { TextOverflowPageComponent } from './src/main/ets/components/mainpage/TextOverflowPage'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/textoverflow/Index.ets#L16-L16 | a39d3d35b536b0bbf6ea6ff94b8f82772a93eb53 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/state/src/main/ets/BreakpointState.ets | arkts | isMD | 是否为中断点
@returns {boolean} 是否中断点 | isMD(): boolean {
return this.current === BreakpointType.MD;
} | AST#method_declaration#Left isMD AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AS... | isMD(): boolean {
return this.current === BreakpointType.MD;
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/state/src/main/ets/BreakpointState.ets#L105-L107 | 9247a1e90dd6cc898374ca0bf2d4529c802dd914 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/DateUtil.ets | arkts | TODO 日期工具类
author: 桃花镇童长老ᥫ᭡
since: 2024/05/01 | export class DateUtil {
/**
* 获取格式化日期,将传入的日期格式化为Date
* @param date number类型的时间戳10-13位数据
* @returns
*/
static getFormatDate(date?: number | string | Date): Date {
if (date == undefined || date == null) { //无参数
date = new Date();
} else if (typeof date == "string") { //字符串日期
if (date.... | AST#export_declaration#Left export AST#class_declaration#Left class DateUtil AST#class_body#Left { /**
* 获取格式化日期,将传入的日期格式化为Date
* @param date number类型的时间戳10-13位数据
* @returns
*/ AST#method_declaration#Left static getFormatDate AST#parameter_list#Left ( AST#parameter#Left date ? : AST#type_annotation#Left AS... | export class DateUtil {
static getFormatDate(date?: number | string | Date): Date {
if (date == undefined || date == null) {
date = new Date();
} else if (typeof date == "string") {
if (date.length == 0) {
date = new Date();
} else if (RegexUtil.isDigits(date)) {
date =... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DateUtil.ets#L26-L476 | bf2c0d54e5243c4275b34730454ac82a0b6b6660 | gitee | |
zl3624/harmonyos_network_samples | b8664f8bf6ef5c5a60830fe616c6807e83c21f96 | code/http/HttpRequestDownload/entry/src/main/ets/pages/Index.ets | arkts | downloadFile | 下载文件 | downloadFile() {
//http请求对象
let httpRequest = http.createHttp();
let opt: http.HttpRequestOptions = {
method: http.RequestMethod.GET,
header: { 'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9',
//这一步很关键,把登录成功后的cookie传递过去
'Cookie': 'sessionid=' +... | AST#method_declaration#Left downloadFile AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { //http请求对象 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left httpRequest = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left ... | downloadFile() {
let httpRequest = http.createHttp();
let opt: http.HttpRequestOptions = {
method: http.RequestMethod.GET,
header: { 'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Cookie': 'sessionid=' + this.sessionId,
'User-Agent... | https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/http/HttpRequestDownload/entry/src/main/ets/pages/Index.ets#L134-L170 | 8bf1b28ef1f195ca0b3d1a51a13515a232db8ec3 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Sounds/Cloud/Download/Downloader/CosDownloader.ets | arkts | private downloadQueue: taskpool.TaskPool = new taskpool.TaskPool("com.ou.TencentCos.Downloader.Queue"); MARK: - 构造函数 | private constructor() {
// 初始化腾讯云服务
CosService.shared;
} | AST#constructor_declaration#Left private constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 初始化腾讯云服务 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#member_expression#Left AST#expression#Left CosService AST#expression#Right . shared AST#member_express... | private constructor() {
CosService.shared;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Download/Downloader/CosDownloader.ets#L30-L33 | af5c11098d930663401352935dd426889645939b | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/model/SearchManager.ets | arkts | deleteReviewList | 清空复习列表 | async deleteReviewList(): Promise<void> {
this.allWords.forEach(word => {
word.lastResultType = SearchConstants.TEST_RESULT_NONE;
});
await WordUserDbAccess.shared.clearReviewList();
} | AST#method_declaration#Left async deleteReviewList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type... | async deleteReviewList(): Promise<void> {
this.allWords.forEach(word => {
word.lastResultType = SearchConstants.TEST_RESULT_NONE;
});
await WordUserDbAccess.shared.clearReviewList();
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/SearchManager.ets#L817-L822 | 55f88dd563f61d6d046c8bf30c942322ba8cb23c | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | FoldableGuilde/entry/src/main/ets/modules/PopupComponent.ets | arkts | PopupExample | [Start PopupExample] | @Component
export struct PopupExample {
@State customPopup1: boolean = false;
@State customPopup2: boolean = false;
build() {
Row() {
Button('popup1')
.onClick(() => {
this.customPopup1 = !this.customPopup1;
})
// Bind the Popup window to the component and align it nea... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct PopupExample AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right customPopup1 : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type... | @Component
export struct PopupExample {
@State customPopup1: boolean = false;
@State customPopup2: boolean = false;
build() {
Row() {
Button('popup1')
.onClick(() => {
this.customPopup1 = !this.customPopup1;
})
.bindPopup(this.customPopup1, {
message... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/FoldableGuilde/entry/src/main/ets/modules/PopupComponent.ets#L17-L47 | 944cf820eedfac3df1c99a4bfba0054dbbab7a17 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/GreetingTypes.ets | arkts | AI联系人信息接口 | export interface ContactInfoForAI {
name: string;
age?: number;
gender: string;
relation: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ContactInfoForAI AST#object_type#Left { AST#type_member#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left age ? : AST#type_annotation#... | export interface ContactInfoForAI {
name: string;
age?: number;
gender: string;
relation: string;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GreetingTypes.ets#L13-L18 | 39411788b51e2fd724f6642ec613f05bce955ab9 | github | |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.atomicservice.AtomicServiceNavigation.d.ets | arkts | AtomicServiceNavigation | Defines AtomicServiceNavigation.
@struct AtomicServiceNavigation
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 12 | @Component
export declare struct AtomicServiceNavigation {
/**
* the information of route page.Providers methods for controlling destination page in the stack.
*
* @type { ?NavPathStack }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 12
*/
@State
n... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct AtomicServiceNavigation AST#component_body#Left { /**
* the information of route page.Providers methods for controlling destination page in the stack.
*
* @type { ... | @Component
export declare struct AtomicServiceNavigation {
@State
navPathStack?: NavPathStack;
@BuilderParam
navigationContent?: Callback<void>;
@Prop
title?: ResourceStr;
@Prop
titleOptions?: TitleOptions;
@Prop
hideTitleBar?: boolean;
@Prop
... | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.atomicservice.AtomicServiceNavigation.d.ets#L28-L151 | 56b0574a127fcacab0d854761abce4ad428eec1d | github |
didi/dimina.git | 7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2 | harmony/dimina/src/main/ets/Service/DMPSendableObjects.ets | arkts | @Sendable 不支持下面这种类型定义,编译能通过,但是会在运行时报错 | export type WorkerMessageType = number | string | boolean; | AST#export_declaration#Left export AST#type_declaration#Left type WorkerMessageType = AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left boolean AST#primary_type#Right AST#union_type#Right AST#typ... | export type WorkerMessageType = number | string | boolean; | https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Service/DMPSendableObjects.ets#L76-L76 | fe5c79ab92ef024a54a63caa5efcc41cec933c66 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/lunar/OnlineLunarService.ets | arkts | 节气信息接口 | export interface SolarTermInfo {
name: string;
date: string;
time: string;
description: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface SolarTermInfo AST#object_type#Left { AST#type_member#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left date : AST#type_annotation#Left... | export interface SolarTermInfo {
name: string;
date: string;
time: string;
description: string;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/lunar/OnlineLunarService.ets#L28-L33 | 830ff57a2cc84ec0889d1f80012d0827fc6ccaaf | github | |
wenqi1/MallHomepage.git | a09765bee60b214f73b875570f8721a004d0bc3b | entry/src/main/ets/model/CommodityModel.ets | arkts | key | key-value | export type KV = {
key: string;
value: string,
image?: string
}; | AST#export_declaration#Left export AST#ERROR#Left type KV = AST#ERROR#Right { key AST#ERROR#Left : string ; value : string AST#ERROR#Right , image AST#ERROR#Left ? : string AST#ERROR#Right } ; AST#export_declaration#Right | export type KV = {
key: string;
value: string,
image?: string
}; | https://github.com/wenqi1/MallHomepage.git/blob/a09765bee60b214f73b875570f8721a004d0bc3b/entry/src/main/ets/model/CommodityModel.ets#L2-L6 | 06581fc250e7b2fc783db0c55cbdacd4aa994067 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/TargetManagement/entry/src/main/ets/pages/MainPage.ets | arkts | onProgressChanged | Listening targetData. | onProgressChanged() {
this.totalTasksNumber = this.targetData.length;
this.completedTasksNumber = this.targetData.filter((item: TaskItemViewModel) => {
return item.progressValue === CommonConstants.SLIDER_MAX_VALUE;
}).length;
this.latestUpdateDate = getCurrentTime();
} | AST#method_declaration#Left onProgressChanged 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 . totalTasksNumber AST#member_expr... | onProgressChanged() {
this.totalTasksNumber = this.targetData.length;
this.completedTasksNumber = this.targetData.filter((item: TaskItemViewModel) => {
return item.progressValue === CommonConstants.SLIDER_MAX_VALUE;
}).length;
this.latestUpdateDate = getCurrentTime();
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/TargetManagement/entry/src/main/ets/pages/MainPage.ets#L49-L55 | 33b7c35fae3d7ec2a1cc6effb013139217428b57 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/utils/DateHelper.ets | arkts | TODO 日期工具类
author: 桃花镇童长老ᥫ᭡
since: 2024/08/18 | export class DateHelper {
/**
* 判断是否是闰年
*/
static isLeapYear(year: number): boolean {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
}
/**
* 获取指定月份的天数
*/
static getDaysByMonth(year: number, month: number): number {
if (month == 2) {
if (DateHelper.isLeapYear(yea... | AST#export_declaration#Left export AST#class_declaration#Left class DateHelper AST#class_body#Left { /**
* 判断是否是闰年
*/ AST#method_declaration#Left static isLeapYear AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#R... | export class DateHelper {
static isLeapYear(year: number): boolean {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
}
static getDaysByMonth(year: number, month: number): number {
if (month == 2) {
if (DateHelper.isLeapYear(year)) {
return 29;
} else {
... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/utils/DateHelper.ets#L25-L363 | 5dbd72c3e7da5b3b4562a9477aeaafe96a986fbf | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/Rect.ets | arkts | width | @return the rectangle's width. This does not check for a valid rectangle
(i.e. left <= right) so the result may be negative. | public width(): number {
return this.right - this.left;
} | AST#method_declaration#Left public width AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#... | public width(): number {
return this.right - this.left;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/Rect.ets#L94-L96 | 069022ce950cbd31a3d07e65088ccad184d97032 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/bottompanelslide/src/main/ets/view/BottomPanelSlide.ets | arkts | BottomPanelSlideComponent | 功能描述: 本示例主要介绍了利用panel实现底部面板内嵌套列表,分阶段滑动效果场景。
推荐场景: 实现底部抽屉滑动效果场景
核心组件:
1. LazyForEach
2. Component
实现步骤:
1. 通过mode来设置panel的不同展开模式的高度
2. 通过panel的onChange事件,来改变panel的展开模式
3. 通过panel内嵌套列表的onTouch属性,来控制嵌套列表的滑动,和mode值的改变 | @Component
export struct BottomPanelSlideComponent {
private listScroller = new ListScroller(); // panel中的list滚动控制器
@State isShown: boolean = false; // panel是否显示
@State mainContentData: VideoDataSource = new VideoDataSource(); // 视频展示列表
@State panelList: PanelDataSource = new PanelDataSource(); // panel中的list数据... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct BottomPanelSlideComponent AST#component_body#Left { AST#property_declaration#Left private listScroller = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left... | @Component
export struct BottomPanelSlideComponent {
private listScroller = new ListScroller();
@State isShown: boolean = false;
@State mainContentData: VideoDataSource = new VideoDataSource();
@State panelList: PanelDataSource = new PanelDataSource();
@State isOpen: boolean = false;
@State startIndex:... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bottompanelslide/src/main/ets/view/BottomPanelSlide.ets#L35-L216 | afd93c3dafcd2d85834d4aaac1bc439895044f30 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_core/src/main/ets/core/util/IdCardUtil.ets | arkts | init | 初始化数据 | private static init(): void {
for (let province of Object.entries(cityJSON)) {
//设置省
IdCardUtil.PROVINCE_CODES.set(province[0].split('&')[1], province[0].split('&')[0]);
if (province.length > 1) {
//设置城市
let cityList = province[1];
for (let city of Object.entries(cityList))... | AST#method_declaration#Left private static init AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#for_statement#Left for ( let province of AST#expression#Left AST#c... | private static init(): void {
for (let province of Object.entries(cityJSON)) {
IdCardUtil.PROVINCE_CODES.set(province[0].split('&')[1], province[0].split('&')[0]);
if (province.length > 1) {
let cityList = province[1];
for (let city of Object.entries(cityList)) {
... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/IdCardUtil.ets#L58-L77 | 98d1a7fe1684ab08939e74164e79e9996b7baa43 | gitee |
ccccjiemo/egl.git | d18849c3da975ccf9373fd09874aa5637ccbe6bd | Index.d.ets | arkts | createImageKHR | https://registry.khronos.org/EGL/sdk/docs/man/html/eglCreateImage.xhtml
@parm attr_list EGL_GL_TEXTURE_LEVEL / EGL_GL_TEXTURE_ZOFFSET / EGL_IMAGE?PRESERVER | createImageKHR(target: number, context: EGLContext, buffer: NativeBuffer,
attrib_list?: number[]): EGLImageKHR | undefined; | AST#method_declaration#Left createImageKHR AST#parameter_list#Left ( AST#parameter#Left target : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left EGLContext AST#primary... | createImageKHR(target: number, context: EGLContext, buffer: NativeBuffer,
attrib_list?: number[]): EGLImageKHR | undefined; | https://github.com/ccccjiemo/egl.git/blob/d18849c3da975ccf9373fd09874aa5637ccbe6bd/Index.d.ets#L244-L245 | 7ef10c9ac1d063525de759c10052821124f38853 | github |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/commons/utils/SpeechRecognizerManager.ets | arkts | startListening | 开始监听 | static startListening() {
// 设置开始识别的相关参数
let recognizerParams: speechRecognizer.StartParams = {
// 会话id
sessionId: SpeechRecognizerManager.sessionId,
// 音频配置信息。
audioInfo: {
// 音频类型。 当前仅支持“pcm”
audioType: 'pcm',
// 音频的采样率。 当前仅支持16000采样率
sampleRate: 16000,
... | AST#method_declaration#Left static startListening AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 设置开始识别的相关参数 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left recognizerParams : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left spe... | static startListening() {
let recognizerParams: speechRecognizer.StartParams = {
sessionId: SpeechRecognizerManager.sessionId,
audioInfo: {
audioType: 'pcm',
sampleRate: 16000,
soundChannel: 1,
sampleBit: 16
},
... | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/utils/SpeechRecognizerManager.ets#L77-L103 | 5846d6b41e1919b0e2686a41ced07b2761a5cd15 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | entry/src/main/ets/constants/Constants.ets | arkts | Copyright (C) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export default class Constants {
// 切换是否显示数值
static readonly TOGGLE_VALUES: string = 'Toggle Values';
// 切换是否显示填充
static readonly TOGGLE_FILLED: string = 'Toggle Filled';
// 切换是否显示圆形
static readonly TOGGLE_CIRCLES: string = 'Toggle Circles';
// 切换三次曲线
static readonly TOGGLE_CUBIC: string = 'Toggle Cubic... | AST#export_declaration#Left export default AST#class_declaration#Left class Constants AST#class_body#Left { // 切换是否显示数值 AST#property_declaration#Left static readonly TOGGLE_VALUES : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'Toggle Value... | export default class Constants {
static readonly TOGGLE_VALUES: string = 'Toggle Values';
static readonly TOGGLE_FILLED: string = 'Toggle Filled';
static readonly TOGGLE_CIRCLES: string = 'Toggle Circles';
static readonly TOGGLE_CUBIC: string = 'Toggle Cubic';
static readonly TOGGLE_STEPPED: st... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/entry/src/main/ets/constants/Constants.ets#L16-L68 | d2028b8a78cbc33e8a2725c142cb802c618130e2 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/MD5.ets | arkts | digestSegment | MD5摘要,分段,同步
@param data 待摘要的数据
@param resultCoding 摘要的编码方式(base64/hex),默认不传为hex。
@param len 自定义的数据拆分长度
@returns | static async digestSegment(data: string, resultCoding: crypto.BhCoding = 'hex', len: number = 128): Promise<string> {
return CryptoUtil.digestSegment(data, 'MD5', resultCoding, len);
} | AST#method_declaration#Left static async digestSegment 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 resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qua... | static async digestSegment(data: string, resultCoding: crypto.BhCoding = 'hex', len: number = 128): Promise<string> {
return CryptoUtil.digestSegment(data, 'MD5', resultCoding, len);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/MD5.ets#L59-L61 | 907bfc7b6e2fb11905f575a4ba2b422cad4090c7 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/utils/CommonUtils.ets | arkts | debounce | 防抖函数 | static debounce<T extends (...args: any[]) => any>(
func: T,
wait: number
): (...args: Parameters<T>) => void {
let timeout: number = -1;
return function (this: any, ...args: Parameters<T>) {
clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(this, args);
}, wait)... | AST#method_declaration#Left static debounce AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left ... args : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left any [ ] AST#array_type#Right AST#primary_typ... | static debounce<T extends (...args: any[]) => any>(
func: T,
wait: number
): (...args: Parameters<T>) => void {
let timeout: number = -1;
return function (this: any, ...args: Parameters<T>) {
clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(this, args);
}, wait)... | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/CommonUtils.ets#L29-L40 | 847a73797f4bbfa46db651d3563f15e7b9a2813f | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/Ready.ets | arkts | 应用约束:60. 不支持require和import赋值表达式,改用export | export default ReadyHandler; | AST#export_declaration#Left export default AST#expression#Left ReadyHandler AST#expression#Right ; AST#export_declaration#Right | export default ReadyHandler; | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/Ready.ets#L105-L105 | 6a43b2ee51ef7aa386a7782f0ed9153a2a757fed | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/view/OrderLogisticsPage.ets | arkts | 构建订单物流页面
@returns {void} 无返回值 | build() {
AppNavDestination({
title: $r("app.string.order_logistics"),
viewModel: this.vm,
paddingValue: {
top: this.windowSafeAreaState.topInset,
left: this.windowSafeAreaState.leftInset,
right: this.windowSafeAreaState.rightInset
}
}) {
this.PageContent();... | 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.order_lo... | build() {
AppNavDestination({
title: $r("app.string.order_logistics"),
viewModel: this.vm,
paddingValue: {
top: this.windowSafeAreaState.topInset,
left: this.windowSafeAreaState.leftInset,
right: this.windowSafeAreaState.rightInset
}
}) {
this.PageContent();... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderLogisticsPage.ets#L43-L55 | 2a6e4ee4bd76151539af314c6b133287e132c3c7 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/card/detail/DetailCardsView.ets | arkts | saveLearn | 保存学习进度 | async saveLearn(){
await SearchManager.shared.incrementLearnTimesForWord(this.word)
//记忆曲线保存记录
if (this.plan && this.dayOf && this.word.idx) {
this.plan?.saveLearned(this.word.idx, this.dayOf)
}
} | AST#method_declaration#Left async saveLearn 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 A... | async saveLearn(){
await SearchManager.shared.incrementLearnTimesForWord(this.word)
if (this.plan && this.dayOf && this.word.idx) {
this.plan?.saveLearned(this.word.idx, this.dayOf)
}
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/card/detail/DetailCardsView.ets#L698-L706 | 87f86b818d5c452a9fc1f09541a015714ced1818 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets | arkts | decodeCBC | 解密-CBC模式
@param str 加密的字符串
@param aesKey 给定秘钥规格密钥
@param iv iv偏移量字符串
@param symAlgName 秘钥规格
@param symEncryptName 加密规格
@returns | static async decodeCBC(str: string, key: string, iv: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<OutDTO<string>> {
//转换密钥
let symKey = await CryptoUtil.convertKeyFromStr(key, symAlgName, keyName);
// 初始化加解密操作环境:开始解密
let mode = crypto.CryptoMode.DECRYPT_MODE;
//创建解密器... | AST#method_declaration#Left static async decodeCBC 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 key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty... | static async decodeCBC(str: string, key: string, iv: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<OutDTO<string>> {
let symKey = await CryptoUtil.convertKeyFromStr(key, symAlgName, keyName);
let mode = crypto.CryptoMode.DECRYPT_MODE;
let cipher = crypto.create... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets#L179-L192 | 73b0a384e0597fdc72b6d419e21786cd075cb104 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/user/src/main/ets/navigation/ProfileNav.ets | arkts | ProfileNav | @file 个人中心导航入口
@returns {void} 无返回值
@author Joker.X | @Builder
export function ProfileNav(): void {
ProfilePage();
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function ProfileNav AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_custom_com... | @Builder
export function ProfileNav(): void {
ProfilePage();
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/user/src/main/ets/navigation/ProfileNav.ets#L8-L11 | f7a83a1de987d5465463731bc84f33acb6c5c41b | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/bluetooth/src/main/ets/pages/BluetoothAdvertiser.ets | arkts | onBluetoothEnableChange | 侦听蓝牙状态变化 | onBluetoothEnableChange(): void {
Log.showInfo(TAG, `onBluetoothEnableChange: bluetoothEnable = ${this.bluetoothEnable}`);
if (this.bluetoothEnable) {
this.toggleAdvertiser();
}
} | AST#method_declaration#Left onBluetoothEnableChange 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#... | onBluetoothEnableChange(): void {
Log.showInfo(TAG, `onBluetoothEnableChange: bluetoothEnable = ${this.bluetoothEnable}`);
if (this.bluetoothEnable) {
this.toggleAdvertiser();
}
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bluetooth/src/main/ets/pages/BluetoothAdvertiser.ets#L76-L81 | 3a8e2e56c0c94e3b877a5214a07454e14e0634a6 | gitee |
openharmony/update_update_app | 0157b7917e2f48e914b5585991e8b2f4bc25108a | feature/ota/src/main/ets/manager/StateManager.ets | arkts | 状态--下载成功
@since 2022-06-10 | export class DownloadSuccess extends BaseState {
constructor() {
super();
this.actionSet.push(UpdateAction.INSTALL);
this.actionSet.push(UpdateAction.SHOW_NEW_VERSION);
this.actionSet.push(UpdateAction.SHOW_PROCESS_VIEW);
this.state = UpdateState.DOWNLOAD_SUCCESS;
this.percent = 100;
this.... | AST#export_declaration#Left export AST#class_declaration#Left class DownloadSuccess extends AST#type_annotation#Left AST#primary_type#Left BaseState AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#constructor_declaration#Left constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AS... | export class DownloadSuccess extends BaseState {
constructor() {
super();
this.actionSet.push(UpdateAction.INSTALL);
this.actionSet.push(UpdateAction.SHOW_NEW_VERSION);
this.actionSet.push(UpdateAction.SHOW_PROCESS_VIEW);
this.state = UpdateState.DOWNLOAD_SUCCESS;
this.percent = 100;
this.... | https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/manager/StateManager.ets#L442-L483 | e273f8d9b6b6ff0e1a90b38a03b72e04fec85a2e | gitee | |
JackJiang2011/harmonychat.git | bca3f3e1ce54d763720510f99acf595a49e37879 | entry/src/main/ets/pages/components/msg_content_view/MsgContentView_file.ets | arkts | FileMsgContentView | Copyright (C) 2024 即时通讯网(52im.net) & Jack Jiang.
The MobileIMSDK-鸿蒙Next客户端 Project. All rights reserved.
联系邮件:jack.jiang@52im.net
联系微信:hellojackjiang
联系QQ: 413980957
技术社区:http://www.52im.net
普通聊天消息内容组件(文件消息)。
@author Jack Jiang(http://www.52im.net/thread-2792-1-1.html) | @Component
export struct FileMsgContentView {
build() {
// TODO: 待实现。。。
}
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FileMsgContentView AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { // TODO: 待实现。。。 } AST#build_body#Right AST#build_method#Right } AST#component_body#Right AST#decorated_export_declarat... | @Component
export struct FileMsgContentView {
build() {
}
} | https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/components/msg_content_view/MsgContentView_file.ets#L16-L21 | 9f664a286030fe267dcef0c548c0e127366e55ad | github |
0dot618/my_PCB_detection_harmony_app.git | 58217366ac936b5f4c246191701b333f4d3c5513 | MyApplication2/entry/src/main/ets/dialog/uploadDialog/ListMenu.ets | arkts | 菜单 | export interface ListMenu {
id: string;
text: string | Resource;
icon?: Resource;
fontColor?: ResourceColor;
onItemClick?: () => void;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ListMenu 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 text : AST#type_annotation#Left AST#un... | export interface ListMenu {
id: string;
text: string | Resource;
icon?: Resource;
fontColor?: ResourceColor;
onItemClick?: () => void;
} | https://github.com/0dot618/my_PCB_detection_harmony_app.git/blob/58217366ac936b5f4c246191701b333f4d3c5513/MyApplication2/entry/src/main/ets/dialog/uploadDialog/ListMenu.ets#L4-L10 | 58f1c61cdf086428617fef4a34f8307c7c32a0ae | github | |
zhongte/TaoYao | 80850f3800dd6037216d3f7c58a2bf34a881c93f | taoyao/src/main/ets/shijing/taoyao/TaoYao.ets | arkts | requestCameraGlobalSwitch | 拉起全局开关弹窗,通过异步的方式告知是否关闭了超级隐私模式
@param context
@returns true 关闭了超级隐私模式,相机可用 | static requestCameraGlobalSwitch(context: Context): Promise<boolean> {
const cameraGlobalSwitch = new CameraGlobalSwitch()
return cameraGlobalSwitch.requestGlobalSwitch(context)
} | AST#method_declaration#Left static requestCameraGlobalSwitch AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#... | static requestCameraGlobalSwitch(context: Context): Promise<boolean> {
const cameraGlobalSwitch = new CameraGlobalSwitch()
return cameraGlobalSwitch.requestGlobalSwitch(context)
} | https://github.com/zhongte/TaoYao/blob/80850f3800dd6037216d3f7c58a2bf34a881c93f/taoyao/src/main/ets/shijing/taoyao/TaoYao.ets#L136-L139 | 8f46a993f8d30787e06fa622cd250bd3dc773498 | gitee |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | AtomicService/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets | arkts | setDefaultMessage | 设置默认消息函数 | private setDefaultMessage(roleType: ChatRoleType, content: string) {
if (content) {
let systemMsg = new ChatMessage({
roleType: roleType,
content: content
})
this.messageArr.clearData();
this.messageArr.pushData(systemMsg);
} else {
this.messageArr.clearData();
... | AST#method_declaration#Left private setDefaultMessage AST#parameter_list#Left ( AST#parameter#Left roleType : AST#type_annotation#Left AST#primary_type#Left ChatRoleType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left content : AST#type_annotation#Left AST#primary_type#Left str... | private setDefaultMessage(roleType: ChatRoleType, content: string) {
if (content) {
let systemMsg = new ChatMessage({
roleType: roleType,
content: content
})
this.messageArr.clearData();
this.messageArr.pushData(systemMsg);
} else {
this.messageArr.clearData();
... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/AtomicService/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets#L274-L285 | f5435f3d378318f43b84be9e11c9b1f641428c48 | gitee |
openharmony/multimedia_camera_framework | 9873dd191f59efda885bc06897acf9b0660de8f2 | frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets | arkts | startVideo | 启动录制 | async startVideo(): Promise<void> {
Logger.info(TAG, 'startVideo is called');
try {
await this.videoOutput?.start();
await this.avRecorder?.start();
this.isRecording = true;
} catch (error) {
let err = error as BusinessError;
Logger.error(TAG, `startVideo err: ${JSON.stringify(... | AST#method_declaration#Left async startVideo 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_argum... | async startVideo(): Promise<void> {
Logger.info(TAG, 'startVideo is called');
try {
await this.videoOutput?.start();
await this.avRecorder?.start();
this.isRecording = true;
} catch (error) {
let err = error as BusinessError;
Logger.error(TAG, `startVideo err: ${JSON.stringify(... | https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets#L750-L761 | 4c29682a3f22ee880b09524f268c15cb12c23836 | gitee |
linhanlove/hormany-os-notion | a65f47bfc1a2bbce531b9af97831eb1ba934c2f8 | entry/src/main/ets/pages/home/Index.ets | arkts | TabBarBuilder | 构建tab | @Builder TabBarBuilder(idx: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === idx ?StyleConstants.BASE_STYLE.fontColor : $r('app.color.baseBlack'))
.fontSize($r('app.float.font_size_16fp'))
.fontWeight(this.currentIndex === idx ? 500 : 400)
.margin(... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right TabBarBuilder AST#parameter_list#Left ( AST#parameter#Left idx : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left name : AST#type_annotation#Left AS... | @Builder TabBarBuilder(idx: number, name: string) {
Column() {
Text(name)
.fontColor(this.currentIndex === idx ?StyleConstants.BASE_STYLE.fontColor : $r('app.color.baseBlack'))
.fontSize($r('app.float.font_size_16fp'))
.fontWeight(this.currentIndex === idx ? 500 : 400)
.margin(... | https://github.com/linhanlove/hormany-os-notion/blob/a65f47bfc1a2bbce531b9af97831eb1ba934c2f8/entry/src/main/ets/pages/home/Index.ets#L112-L127 | 62f8f958fc99d8b9dd5f4cdb98c741ec146e38ed | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/toolbox/src/main/ets/model/ClickListener.ets | arkts | 悬浮球点击事件监听器 | export interface ClickListener {
/**
* 点击事件响应
* @param {GestureEvent} event - 手势事件
*/
onAction: (event: GestureEvent) => void;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ClickListener AST#object_type#Left { /**
* 点击事件响应
* @param {GestureEvent} event - 手势事件
*/ AST#type_member#Left onAction : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left event : AST#type_ann... | export interface ClickListener {
onAction: (event: GestureEvent) => void;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/toolbox/src/main/ets/model/ClickListener.ets#L19-L25 | 8f0fd6bda0fea236dcba4fd4804eb5d27402751d | gitee | |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/utils/CommonUtils.ets | arkts | deepClone | 深拷贝 | static deepClone<T>(obj: T): T {
if (obj === null || typeof obj !== 'object') {
return obj;
}
if (obj instanceof Date) {
return new Date(obj.getTime()) as unknown as T;
}
if (obj instanceof Array) {
return obj.map(item => this.deepClone(item)) as unknown as T;
}
if (typeof ... | AST#method_declaration#Left static deepClone AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left obj : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ... | static deepClone<T>(obj: T): T {
if (obj === null || typeof obj !== 'object') {
return obj;
}
if (obj instanceof Date) {
return new Date(obj.getTime()) as unknown as T;
}
if (obj instanceof Array) {
return obj.map(item => this.deepClone(item)) as unknown as T;
}
if (typeof ... | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/CommonUtils.ets#L62-L80 | 8fe7b2e8d3e17cb5bfeaf3cffce648c7353d5229 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/analytics/ReportsPage.ets | arkts | buildSearchAndFilter | 构建搜索和筛选 | @Builder
buildSearchAndFilter() {
Column({ space: 12 }) {
// 搜索框
Row({ space: 8 }) {
Image($r('app.media.ic_search'))
.width(20)
.height(20)
.fillColor($r('app.color.text_secondary'))
TextInput({ text: this.searchText, placeholder: '搜索报告...' })
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSearchAndFilter 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#componen... | @Builder
buildSearchAndFilter() {
Column({ space: 12 }) {
Row({ space: 8 }) {
Image($r('app.media.ic_search'))
.width(20)
.height(20)
.fillColor($r('app.color.text_secondary'))
TextInput({ text: this.searchText, placeholder: '搜索报告...' })
.backg... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/analytics/ReportsPage.ets#L191-L271 | 2c890faf45ca2537a4cc3338e3313da4e6d42a99 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | Format of log. | export const FORMAT = `%{public}s, %{public}s`; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left FORMAT = AST#expression#Left AST#template_literal#Left ` %{public}s, %{public}s ` AST#template_literal#Right AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Righ... | export const FORMAT = `%{public}s, %{public}s`; | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets#L140-L140 | 71ad106d67f0ad9ee21b84f71f66fd8e081ec084 | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/listexchange/src/main/ets/model/ListExchangeCtrl.ets | arkts | deleteItem | 删除列表项
@param item: 列表项 | deleteItem(item: T): void {
try {
const index: number = this.deductionData.indexOf(item);
this.dragRefOffset = 0;
// TODO:知识点:左偏移以及透明度动画
animateTo({
// 总时间300ms
curve: Curve.Friction, duration: 300, onFinish: () => {
// TODO:知识点:列表项删除动画
animateTo({
... | AST#method_declaration#Left deleteItem AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#typ... | deleteItem(item: T): void {
try {
const index: number = this.deductionData.indexOf(item);
this.dragRefOffset = 0;
animateTo({
curve: Curve.Friction, duration: 300, onFinish: () => {
animateTo({
curve: Curve.Friction, duration: 5... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/listexchange/src/main/ets/model/ListExchangeCtrl.ets#L174-L201 | 320b297efaec2f92914acfe34e7bdc231d9fa601 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_axios/src/main/ets/axios/EfClientApi.ets | arkts | get | get请求 -rest 风格
@param efClientParams get请求入参实体
@returns 响应结果 | async get<E>(efClientParams: efClientParams<null>, cls?: ClassConstructor<E>): Promise<E | EfAxiosError> {
try {
//如果当前请求efClientParams.loadingTxt传入参数 则 更改当前的loading文本
if (efClientParams.loadingTxt) {
efAxiosParams.loadingTxt = efClientParams.loadingTxt;
}
let response: AxiosRespons... | AST#method_declaration#Left async get 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 < AST#... | async get<E>(efClientParams: efClientParams<null>, cls?: ClassConstructor<E>): Promise<E | EfAxiosError> {
try {
if (efClientParams.loadingTxt) {
efAxiosParams.loadingTxt = efClientParams.loadingTxt;
}
let response: AxiosResponse<E> = await efAxios.get<E, AxiosResponse<E>, null>(efC... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_axios/src/main/ets/axios/EfClientApi.ets#L156-L185 | d874ee9a8b02a8a50d6bea7484d075e052866cbe | gitee |
linyu13/ArkTSCloudMusic.git | ff9455dfe900164b04a45244aebfb05bab4e8e8d | entry/src/main/ets/pages/Start.ets | arkts | aboutToAppear | 计时自动跳转 页面打开开始计时 | aboutToAppear(): void {
// 生命周期 居然在这里遇到了吗(
setTimeout(() => {
this.pageStack.replacePathByName("LayOut", null, false) // 跳转之后无法返回到该页面
}, 3000) // 以毫秒为单位
} | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { // 生命周期 居然在这里遇到了吗( AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_co... | aboutToAppear(): void {
setTimeout(() => {
this.pageStack.replacePathByName("LayOut", null, false)
}, 3000)
} | https://github.com/linyu13/ArkTSCloudMusic.git/blob/ff9455dfe900164b04a45244aebfb05bab4e8e8d/entry/src/main/ets/pages/Start.ets#L13-L18 | ed44557d2a1375df9e27fe4ccd2442b052f7d85b | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.Chip.d.ets | arkts | Defines label margin.
@interface LabelMarginOptions
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@since 11
Defines label margin.
@interface LabelMarginOptions
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export interface LabelMarginOptions {
/**
* Left label margin length.
*
* @type { ?Dimension }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Left label margin length.
*
* @type { ?Dimension }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @cro... | AST#export_declaration#Left export AST#interface_declaration#Left interface LabelMarginOptions AST#object_type#Left { /**
* Left label margin length.
*
* @type { ?Dimension }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/ /**
* Left label margin length.
*
* @ty... | export interface LabelMarginOptions {
left?: Dimension;
right?: Dimension;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.Chip.d.ets#L454-L493 | 1d85eb080bc90abda8e85e4409e7a01e0f15583d | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/calendarswitch/src/main/ets/customcalendar/utils/TimeUtils.ets | arkts | lunarDayToChinese | 返回农历日期的中文表示
@param day 农历日
@returns | static lunarDayToChinese(day: number): string {
// 转换日期
return Constants.CHINESE_DAY[day - 1];
} | AST#method_declaration#Left static lunarDayToChinese AST#parameter_list#Left ( AST#parameter#Left day : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primar... | static lunarDayToChinese(day: number): string {
return Constants.CHINESE_DAY[day - 1];
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/calendarswitch/src/main/ets/customcalendar/utils/TimeUtils.ets#L99-L102 | eb0343ce1ca7933e1aa755ca33235f2802fab12c | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customscan/src/main/ets/viewmodel/CustomScanViewModel.ets | arkts | tryCloseFlashLight | 尝试把开启的闪光灯关闭
@returns {void} | tryCloseFlashLight() {
try {
// 闪光灯标记移除
this.cameraLightUpdateCb(false);
// 如果闪光灯开启,则关闭
if (customScan.getFlashLightStatus()) {
customScan.closeFlashLight();
}
} catch (error) {
logger.error('flashLight try close failed, error: ' + JSON.stringify(error));
}
} | AST#method_declaration#Left tryCloseFlashLight AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { // 闪光灯标记移除 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#... | tryCloseFlashLight() {
try {
this.cameraLightUpdateCb(false);
if (customScan.getFlashLightStatus()) {
customScan.closeFlashLight();
}
} catch (error) {
logger.error('flashLight try close failed, error: ' + JSON.stringify(error));
}
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customscan/src/main/ets/viewmodel/CustomScanViewModel.ets#L263-L274 | ffba68731d186f2ad4883f378846586a9b395ac1 | gitee |
lime-zz/Ark-ui_RubbishRecycleApp.git | c2a9bff8fbb5bc46d922934afad0327cc1696969 | rubbish/rubbish/entry/src/main/ets/pages/Shoucang.ets | arkts | getCollectData | 从数据库获取收藏数据 | async getCollectData(): Promise<void> {
try {
this.isLoading = true;
const httpRequest = http.createHttp();
const response = await httpRequest.request(
'http://192.168.32.1:8080/api/collect/get',
{
method: http.RequestMethod.GET,
header: {
'Content-T... | AST#method_declaration#Left async getCollectData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_a... | async getCollectData(): Promise<void> {
try {
this.isLoading = true;
const httpRequest = http.createHttp();
const response = await httpRequest.request(
'http://192.168.32.1:8080/api/collect/get',
{
method: http.RequestMethod.GET,
header: {
'Content-T... | https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/Shoucang.ets#L95-L127 | 97f55929f3ac583841ce5fa805550dc94246ed93 | github |
htliang128/arkts_oss.git | 9da4a87c36272873c649f556854bd793ac337a18 | htliang_oss/src/main/ets/common/comm/CustomHttpRequestOptions.ets | arkts | getCaPath | Getter and setter for caPath | getCaPath(): string | undefined {
return this.caPath;
} | AST#method_declaration#Left getCaPath AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left {... | getCaPath(): string | undefined {
return this.caPath;
} | https://github.com/htliang128/arkts_oss.git/blob/9da4a87c36272873c649f556854bd793ac337a18/htliang_oss/src/main/ets/common/comm/CustomHttpRequestOptions.ets#L119-L121 | 793b385eccae51e8ad99cc7d7aaf10208a7ecf71 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.