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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | entry/src/main/ets/common/component/TextMatchUtils.ets | arkts | momentDetector | 圈子匹配
@param text | static momentDetector(text: string): TextMatchResult[] {
const regs: TextMatchRegExp[] = [
new TopicMatchRegExp(),
]
return TextMatchUtils.detectorWithRegs(text, regs)
} | AST#method_declaration#Left static momentDetector AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left... | static momentDetector(text: string): TextMatchResult[] {
const regs: TextMatchRegExp[] = [
new TopicMatchRegExp(),
]
return TextMatchUtils.detectorWithRegs(text, regs)
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/entry/src/main/ets/common/component/TextMatchUtils.ets#L134-L139 | 87c1eb2299bcc9285956a2909bee5f139cf8dc31 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/CacheUtil.ets | arkts | get | 私有缓存对象
获取缓存中的数据
@param key 存入的key
@returns | static get<T>(key: string): T {
return CacheUtil.cache[key] as T;
} | AST#method_declaration#Left static get AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right )... | static get<T>(key: string): T {
return CacheUtil.cache[key] as T;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/CacheUtil.ets#L34-L36 | f0394bcc82b3cc2e800886ab571fb8b3300c58a4 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/blendmode/src/main/ets/view/BlendModeView.ets | arkts | getResourceString | Resource转化为string函数
@param resource
@returns string | getResourceString(resourceMsg: Resource): string {
return this.context.resourceManager.getStringSync(resourceMsg.id);
} | AST#method_declaration#Left getResourceString AST#parameter_list#Left ( AST#parameter#Left resourceMsg : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#pri... | getResourceString(resourceMsg: Resource): string {
return this.context.resourceManager.getStringSync(resourceMsg.id);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/blendmode/src/main/ets/view/BlendModeView.ets#L73-L75 | 1ef21117ae9388adc686b35192b4d609e014731f | gitee |
yycy134679/FoodieHarmony.git | e6971f0a8f7574ae278d02eb5c057e57e667dab5 | entry/src/main/ets/view/mine/StatsBar.ets | arkts | handleCouponClick | 处理优惠券点击 | private handleCouponClick(): void {
hilog.info(DOMAIN, TAG, 'Coupon stat clicked');
promptAction.showToast({
message: '暂无优惠券',
duration: 1500
});
} | AST#method_declaration#Left private handleCouponClick 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 AS... | private handleCouponClick(): void {
hilog.info(DOMAIN, TAG, 'Coupon stat clicked');
promptAction.showToast({
message: '暂无优惠券',
duration: 1500
});
} | https://github.com/yycy134679/FoodieHarmony.git/blob/e6971f0a8f7574ae278d02eb5c057e57e667dab5/entry/src/main/ets/view/mine/StatsBar.ets#L52-L58 | 28fb6301f9028f98bc9c0756806fad2eec793bf9 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/utils/FSize.ets | arkts | Class for describing width and height dimensions in some arbitrary | export default class FSize extends Poolable {
public width: number = 0;
public height: number = 0;
public static pool: ObjectPool<FSize> = ObjectPool.create(256, new FSize(0, 0))
.setReplenishPercentage(0.5) as ObjectPool<FSize>;
instantiate(): Poolable {
return new FSize(0, 0);
}
public static ge... | AST#export_declaration#Left export AST#ERROR#Left default class FSize extends AST#type_annotation#Left AST#primary_type#Left Poolable AST#primary_type#Right AST#type_annotation#Right { AST#property_declaration#Left public width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_anno... | export default class FSize extends Poolable {
public width: number = 0;
public height: number = 0;
public static pool: ObjectPool<FSize> = ObjectPool.create(256, new FSize(0, 0))
.setReplenishPercentage(0.5) as ObjectPool<FSize>;
instantiate(): Poolable {
return new FSize(0, 0);
}
public static ge... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/FSize.ets#L24-L51 | 0185ce7d6c57d8d778a084b9b1e5f1f3e5edda38 | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/h5cache/src/main/ets/common/DiskCacheManager.ets | arkts | 创建磁盘缓存
@param diskCachePath 磁盘缓存路径
@param diskCacheCapacity 磁盘缓存大小 | constructor(diskCachePath: string, diskCacheCapacity: number) {
this.cache = new DiskLruCache(diskCachePath, diskCacheCapacity);
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left diskCachePath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left diskCacheCapacity : AST#type_annotation#Left AST#primary_type#Left num... | constructor(diskCachePath: string, diskCacheCapacity: number) {
this.cache = new DiskLruCache(diskCachePath, diskCacheCapacity);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/h5cache/src/main/ets/common/DiskCacheManager.ets#L32-L34 | e00d0513babdcd37b317c82a4e6a99942f5e9c64 | gitee | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/ECDSA.ets | arkts | sign | 签名
@param str 需要签名的字符串
@param priKey 私钥
@returns string> 签名对象 | static async sign(str: string, priKey: string): Promise<string> {
return CryptoUtil.sign(str, priKey, 'ECC256', 'ECC256|SHA256', 256);
} | AST#method_declaration#Left static async sign AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type... | static async sign(str: string, priKey: string): Promise<string> {
return CryptoUtil.sign(str, priKey, 'ECC256', 'ECC256|SHA256', 256);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/ECDSA.ets#L42-L44 | 0f8683ed8f549382fbc9026a98f53246cb7cf0ba | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.ToolBarV2.d.ets | arkts | Declare ToolBarV2Modifier used in ToolBar
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 18 | export declare class ToolBarV2Modifier {
/**
* Sets the height of the toolBarV2.
*
* @param { LengthMetrics } height - toolBarV2's height.
* @returns { ToolBarV2Modifier } returns the instance of the ToolBarV2Modifier.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class ToolBarV2Modifier AST#class_body#Left { /**
* Sets the height of the toolBarV2.
*
* @param { LengthMetrics } height - toolBarV2's height.
* @returns { ToolBarV2Modifier } returns the instance of the To... | export declare class ToolBarV2Modifier {
height(height: LengthMetrics): ToolBarV2Modifier;
backgroundColor(backgroundColor: ColorMetrics): ToolBarV2Modifier;
padding(padding: LengthMetrics): ToolBarV2Modifier;
stateEffect(stateEffect: boolean): ToolBarV2Modifier;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ToolBarV2.d.ets#L546-L591 | 4cfc1853a4de86c0f71cf0f951af7c29ef90fe58 | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Connectivity/MultipleFilesDownload/casesfeature/multiplefilesdownload/src/main/ets/view/MultipleFilesDownload.ets | arkts | onSelectedChange | 当选择"下载列表"时,显示下载列表相应内容,选择其他选项时,不显示内容,仅用于ux展示 | onSelectedChange(): void {
// 显示下载列表内容
if (this.tabSelectedIndexes[0] === 1) {
this.downloadPageOpacity = 1;
this.isDownloadPageEnabled = true;
this.downloadPageVisibility = Visibility.Visible;
this.historyPageVisibility = Visibility.None;
} else if (this.tabSelectedIndexes[0] === 2)... | AST#method_declaration#Left onSelectedChange 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_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left... | onSelectedChange(): void {
if (this.tabSelectedIndexes[0] === 1) {
this.downloadPageOpacity = 1;
this.isDownloadPageEnabled = true;
this.downloadPageVisibility = Visibility.Visible;
this.historyPageVisibility = Visibility.None;
} else if (this.tabSelectedIndexes[0] === 2) {
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/MultipleFilesDownload/casesfeature/multiplefilesdownload/src/main/ets/view/MultipleFilesDownload.ets#L89-L113 | 48a9acec7b6f47364e6ba1d908eb96284429f947 | gitee |
zl3624/harmonyos_network_samples | b8664f8bf6ef5c5a60830fe616c6807e83c21f96 | code/tcp/SmtpClient/entry/src/main/ets/pages/Index.ets | arkts | string2Base64 | 对字符串base64编码 | function string2Base64(src: string) {
let textEncoder = new util.TextEncoder();
let encodeValue = textEncoder.encodeInto(src)
let tool = new util.Base64Helper()
return tool.encodeToStringSync(encodeValue)
} | AST#function_declaration#Left function string2Base64 AST#parameter_list#Left ( AST#parameter#Left src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declara... | function string2Base64(src: string) {
let textEncoder = new util.TextEncoder();
let encodeValue = textEncoder.encodeInto(src)
let tool = new util.Base64Helper()
return tool.encodeToStringSync(encodeValue)
} | https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/tcp/SmtpClient/entry/src/main/ets/pages/Index.ets#L356-L362 | 3d8198fbb0aa6a0351b89ca59a7bf5690a9af498 | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/data/MockData.ets | arkts | 轮播图数据 | export const mockBanners: Banner[] = [
{
id: 1,
pic: 'https://picsum.photos/800/400?random=1',
},
{
id: 2,
pic: 'https://picsum.photos/800/400?random=2',
},
{
id: 3,
pic: 'https://picsum.photos/800/400?random=3',
}
]; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left mockBanners : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Banner [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#express... | export const mockBanners: Banner[] = [
{
id: 1,
pic: 'https://picsum.photos/800/400?random=1',
},
{
id: 2,
pic: 'https://picsum.photos/800/400?random=2',
},
{
id: 3,
pic: 'https://picsum.photos/800/400?random=3',
}
]; | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/data/MockData.ets#L9-L22 | 2b08f37a8fb52bd91bc2e6ab482ff3de8ffb4e72 | github | |
kinghy949/kinghy_zufang.git | 471cc1273fbea66b88a4b7803e3f08c83a2de7ce | entry/src/main/ets/views/Home/SearchBar.ets | arkts | imageStyles | @Styles: 用来定义复用样式
@Extend: 用来扩展组件样式(只有这个组件能用)
@Styles 和 @Extend 都可以用来复用样式,有什么区别:
1. @Styles 只支持通用属性和通用事件。@Extend 即通用属性和通用事件,也支持定义组件私有属性和私有事件
2. @Styles 不支持传参。@Extend 支持传参(更灵活)
3. @Styles 可以定义组件内或全局。@Extend 只支持
注意:全局指的是当前文件内生效。不是真正的全局 | @Extend(Image)
function imageStyles(size: number) {
.width(size).height(size).objectFit(ImageFit.Fill)
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left Image AST#expression#Right ) AST#decorator#Right function imageStyles AST#parameter_list#Left ( AST#parameter#Left size : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#p... | @Extend(Image)
function imageStyles(size: number) {
.width(size).height(size).objectFit(ImageFit.Fill)
} | https://github.com/kinghy949/kinghy_zufang.git/blob/471cc1273fbea66b88a4b7803e3f08c83a2de7ce/entry/src/main/ets/views/Home/SearchBar.ets#L71-L74 | fc83b5ec8e9d3cd67d957186d7d00ab01d886514 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/GreetingTypes.ets | arkts | 祝福语排序字段枚举 | export enum GreetingSortField {
CREATED_AT = 'createdAt',
SENT_AT = 'sentAt',
RATING = 'rating',
USAGE = 'usage',
RELEVANCE = 'relevance',
CONTENT = 'content',
USAGE_COUNT = 'usage_count',
CREATED_AT_DB = 'created_at'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum GreetingSortField AST#enum_body#Left { AST#enum_member#Left CREATED_AT = AST#expression#Left 'createdAt' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left SENT_AT = AST#expression#Left 'sentAt' AST#expression#Right AST#enum_member#Right ,... | export enum GreetingSortField {
CREATED_AT = 'createdAt',
SENT_AT = 'sentAt',
RATING = 'rating',
USAGE = 'usage',
RELEVANCE = 'relevance',
CONTENT = 'content',
USAGE_COUNT = 'usage_count',
CREATED_AT_DB = 'created_at'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GreetingTypes.ets#L422-L431 | ac23169b67d70dec8bcc08d3c967f7d650bc3517 | github | |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/common/GlobalThemeState.ets | arkts | notifyThemeChange | 通知主题变化 | private notifyThemeChange(): void {
this.themeVersion++;
console.log(`GlobalThemeState: 通知主题变化, 版本: ${this.themeVersion}, 监听器数量: ${this.listeners.length}`);
this.listeners.forEach((listener, index) => {
try {
console.log(`GlobalThemeState: 调用监听器 ${index}`);
listener(this.themeVersion);... | AST#method_declaration#Left private notifyThemeChange 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#update_expression#Left ... | private notifyThemeChange(): void {
this.themeVersion++;
console.log(`GlobalThemeState: 通知主题变化, 版本: ${this.themeVersion}, 监听器数量: ${this.listeners.length}`);
this.listeners.forEach((listener, index) => {
try {
console.log(`GlobalThemeState: 调用监听器 ${index}`);
listener(this.themeVersion);... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/GlobalThemeState.ets#L45-L56 | e3bfa4ca424e0507cab10c7b37500c13176f3d23 | github |
azhuge233/ASFShortcut-HN.git | d1669c920c56317611b5b0375aa5315c1b91211b | entry/src/main/ets/asfcommandwidget/asfcommandwidgetentryability/ASFCommandWidgetEntryAbility.ets | arkts | onCreate | 如果UIAbility启动,在收到call事件后会触发onCreate生命周期回调 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
Logger.debug(this.LOG_TAG, `onCreate()`);
// Logger.warn(this.LOG_TAG, JSON.stringify(want));
// 直接通过 want 获取 call 事件参数
if (want.parameters && want.parameters.params) {
const params: Record<string, Objec... | AST#method_declaration#Left onCreate AST#parameter_list#Left ( AST#parameter#Left want : AST#type_annotation#Left AST#primary_type#Left Want AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left launchParam : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left Abil... | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
Logger.debug(this.LOG_TAG, `onCreate()`);
if (want.parameters && want.parameters.params) {
const params: Record<string, Object> = JSON.parse(want.parameters.params as string);
const method... | https://github.com/azhuge233/ASFShortcut-HN.git/blob/d1669c920c56317611b5b0375aa5315c1b91211b/entry/src/main/ets/asfcommandwidget/asfcommandwidgetentryability/ASFCommandWidgetEntryAbility.ets#L24-L42 | f0091c732701527779ea60e80ea3a34e795a5472 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/CitySearch/casesfeature/citysearch/src/main/ets/view/CitySearch.ets | arkts | CitySearch | 功能说明: 本示例介绍城市选择场景的使用:通过AlphabetIndexer实现首字母快速定位城市的索引条导航
推荐场景: 首字母快速定位的列表场景
核心组件:
1. AlphabetListView: 列表视图
实现步骤:
1. 数据准备。初始化城市列表和热门城市列表数组。
@example
// 热门城市列表
hotCityList: HotCityListItemView[] = [];
城市列表
cityList: CityListItemView[] = [];
aboutToAppear(): void {
CITY_DATA.forEach((cityItem: CityType) => {
this.city... | @Component
export struct CitySearch {
// 搜索值
@State changeValue: string = '';
// 热门城市列表
hotCityList: HotListItemView[] = [];
// 城市列表
cityList: AlphabetListItemView[] = [];
// 占位
placeholder: string = CommonConstants.PLACE_HOLDER_TEXT;
// 搜索控制器
controller: SearchController = new SearchController();
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CitySearch AST#component_body#Left { // 搜索值 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right changeValue : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#t... | @Component
export struct CitySearch {
@State changeValue: string = '';
hotCityList: HotListItemView[] = [];
cityList: AlphabetListItemView[] = [];
placeholder: string = CommonConstants.PLACE_HOLDER_TEXT;
controller: SearchController = new SearchController();
@State isSearchState: boolean =... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CitySearch/casesfeature/citysearch/src/main/ets/view/CitySearch.ets#L65-L223 | 21fd28c3133e59a89ffca8cdb178533f59a8b321 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/storage/DatabaseService.ets | arkts | commit | 提交事务 | async commit(): Promise<void> {
try {
this.checkInitialized();
await this.store!.commit();
hilog.debug(LogConstants.DOMAIN_DATABASE, LogConstants.TAG_DATABASE, 'Transaction committed');
} catch (error) {
const businessError = error as BusinessError;
hilog.error(LogConstants.DOMAIN_... | AST#method_declaration#Left async commit 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_arguments... | async commit(): Promise<void> {
try {
this.checkInitialized();
await this.store!.commit();
hilog.debug(LogConstants.DOMAIN_DATABASE, LogConstants.TAG_DATABASE, 'Transaction committed');
} catch (error) {
const businessError = error as BusinessError;
hilog.error(LogConstants.DOMAIN_... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/storage/DatabaseService.ets#L510-L520 | b8b3b7bb2196bbb38d353abc0e0a328e0bc01a36 | github |
L1rics06/arkTS-.git | 991fd131bfdb11e2933152133c97453d86092ac0 | entry/src/main/ets/pages/NetworkUtil.ets | arkts | 消息列表响应 | export interface MessageListResponse {
pageInfo: PageInfo;
sessionId: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface MessageListResponse AST#object_type#Left { AST#type_member#Left pageInfo : AST#type_annotation#Left AST#primary_type#Left PageInfo AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left sessionId : AST#typ... | export interface MessageListResponse {
pageInfo: PageInfo;
sessionId: string;
} | https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L166-L169 | 8ffa36984fe8a00293a94e1889cdc47d7c3079e7 | github | |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/rest/RequestHandlers/RequestHandler.ets | arkts | get | Getter/Setter类型标注(约束1) | get globalLimit(): boolean {
return this.restManager.globallyRateLimited;
} | AST#method_declaration#Left get AST#ERROR#Left globalLimit AST#ERROR#Right 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#exp... | get globalLimit(): boolean {
return this.restManager.globallyRateLimited;
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/rest/RequestHandlers/RequestHandler.ets#L20-L22 | 9e6f2e820a69e1318df8bff4a65cbfa1c0423bca | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/utils/DownloadUtils.ets | arkts | sendNotification | 下载文件,发送通知
@param notificationKey
@param fileName 文件名
@param percent 进度
@param state 0-下载中,-1-下载失败,1-下载成功, | static async sendNotification(notificationKey: string, fileName: string, percent: number | undefined, state: number) {
const notificationId = GlobalContext.getContext().get<number>(notificationKey);
let content = Tools.getStringSync($r('app.string.harmony_web_download_tip1').id);
if (state === 1) {
co... | AST#method_declaration#Left static async sendNotification AST#parameter_list#Left ( AST#parameter#Left notificationKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fileName : AST#type_annotation#Left AST#primary_type#Le... | static async sendNotification(notificationKey: string, fileName: string, percent: number | undefined, state: number) {
const notificationId = GlobalContext.getContext().get<number>(notificationKey);
let content = Tools.getStringSync($r('app.string.harmony_web_download_tip1').id);
if (state === 1) {
co... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/DownloadUtils.ets#L118-L148 | 25afca1587e64760cdeee038c60d337c608da772 | gitee |
openharmony-tpc/ImageKnife | bc55de9e2edd79ed4646ce37177ad94b432874f7 | library/src/main/ets/model/ImageKnifeData.ets | arkts | onComplete成功回调 | export interface EventImage {
width: number;
height: number;
componentWidth: number;
componentHeight: number;
loadingStatus: number;
contentWidth: number;
contentHeight: number;
contentOffsetX: number;
contentOffsetY: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface EventImage AST#object_type#Left { AST#type_member#Left width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left height : AST#type_annotation#Left... | export interface EventImage {
width: number;
height: number;
componentWidth: number;
componentHeight: number;
loadingStatus: number;
contentWidth: number;
contentHeight: number;
contentOffsetX: number;
contentOffsetY: number;
} | https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/model/ImageKnifeData.ets#L74-L84 | c75a965134cbf76f178baaa1a0c3a19dd44a7c3e | gitee | |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/utils/ScreenUtils.ets | arkts | isLandscape | 检查是否为横屏 | static isLandscape(): boolean {
return ScreenUtils.getScreenWidth() > ScreenUtils.getScreenHeight();
} | AST#method_declaration#Left static isLandscape 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#call_expres... | static isLandscape(): boolean {
return ScreenUtils.getScreenWidth() > ScreenUtils.getScreenHeight();
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/ScreenUtils.ets#L98-L100 | ec126b0762593bdcb5fd1df36a2658a96b91198b | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/ui/src/main/ets/component/network/BaseNetWorkView.ets | arkts | buildDefaultLoading | 默认加载视图
@returns {void} 无返回值 | @Builder
buildDefaultLoading(): void {
PageLoading();
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildDefaultLoading AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#... | @Builder
buildDefaultLoading(): void {
PageLoading();
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/ui/src/main/ets/component/network/BaseNetWorkView.ets#L42-L45 | f15bbdbc88e41a55e6a6fce06a769fb90848721e | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/card/wordcard/WordCardOne.ets | arkts | buildPronunciationRow | 构建发音显示行 | @Builder
buildPronunciationRow() {
Text(`${this.word.pronEn}`)
.width('100%')
.fontSize(18)
.fontColor($r('app.color.color_card_detail'))
.textAlign(TextAlign.Start)
.margin({ left: 30 })
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildPronunciationRow 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 Text ( AST#expression#Left AST#template_literal#Left... | @Builder
buildPronunciationRow() {
Text(`${this.word.pronEn}`)
.width('100%')
.fontSize(18)
.fontColor($r('app.color.color_card_detail'))
.textAlign(TextAlign.Start)
.margin({ left: 30 })
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/card/wordcard/WordCardOne.ets#L209-L217 | 0ae4280c26aac0ad402b28a7e07076da91d3ca13 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/highlight/Highlight.ets | arkts | getStackIndex | Only needed if a stacked-barchart entry was highlighted. References the
selected value within the stacked-entry.
@return | public getStackIndex(): number {
return this.mStackIndex;
} | AST#method_declaration#Left public getStackIndex 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_exp... | public getStackIndex(): number {
return this.mStackIndex;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/highlight/Highlight.ets#L160-L162 | 9b662d43431831c195000b5dec958e48e1b12cee | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/DriverLicenseExam-master/components/exam/src/main/ets/components/Exam.ets | arkts | convertToTime | 时间转换-将剩余秒数转换为 mm:ss
@param time
@returns | convertToTime(time: number): string {
let minute: number = Math.floor(time / 60);
let second: number = time % 60;
return (minute < 10 ? '0' + minute : minute + '') + ':' + (second < 10 ? '0' + second : second) + '';
}
}
@Builder
export function showSettingSheet() {
Column({ space: 20 }) {
Row() {
... | AST#method_declaration#Left convertToTime AST#parameter_list#Left ( AST#parameter#Left time : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#p... | convertToTime(time: number): string {
let minute: number = Math.floor(time / 60);
let second: number = time % 60;
return (minute < 10 ? '0' + minute : minute + '') + ':' + (second < 10 ? '0' + second : second) + '';
}
}
@Builder
export function showSettingSheet() {
Column({ space: 20 }) {
Row() {
... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/components/exam/src/main/ets/components/Exam.ets#L418-L466 | 5a6828be4a663cbe824fe250c0eea2e8b466dbeb | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_audio/src/main/ets/ui/Ef_audio_player/type/index.ets | arkts | 播放模式相关的图标和文字 | export interface SAPlayModeIcon {
url: ResourceStr
mode: SAPlayMode
name: string
} | AST#export_declaration#Left export AST#interface_declaration#Left interface SAPlayModeIcon AST#object_type#Left { AST#type_member#Left url : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right AST#type_member#Left mode : AST#type_annotation#L... | export interface SAPlayModeIcon {
url: ResourceStr
mode: SAPlayMode
name: string
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_audio/src/main/ets/ui/Ef_audio_player/type/index.ets#L25-L29 | 16b1e9ec6c93a83e8ad82e5b06a5f814ebaf2848 | gitee | |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/common/models/ThemeModel.ets | arkts | isDarkTheme | 判断是否为深色主题 | isDarkTheme(): boolean {
return this.currentTheme.type === ThemeType.TECH || this.currentTheme.type === ThemeType.BUSINESS;
} | AST#method_declaration#Left isDarkTheme 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#... | isDarkTheme(): boolean {
return this.currentTheme.type === ThemeType.TECH || this.currentTheme.type === ThemeType.BUSINESS;
} | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/models/ThemeModel.ets#L264-L266 | 8f02b7ca88dc58edea0cdd804409a820248d2950 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/ui/src/main/ets/component/modal/SpecSelectModal.ets | arkts | SpecSelectModal | @file 规格选择弹窗组件
@author Joker.X | @ComponentV2
export struct SpecSelectModal {
/**
* 是否显示弹窗
*/
@Param
@Require
visible: boolean = false;
/**
* 关闭回调
*/
@Param
onDismiss: () => void = () => {
};
/**
* 商品信息
*/
@Param
goods: Goods | null = null;
/**
* 网络请求状态
*/
@Param
uiState: BaseNetWorkUiState = BaseNet... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SpecSelectModal AST#component_body#Left { /**
* 是否显示弹窗
*/ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right AST#decorator#Left @ Require AST#decorator#Right visible : AST#type_annota... | @ComponentV2
export struct SpecSelectModal {
@Param
@Require
visible: boolean = false;
@Param
onDismiss: () => void = () => {
};
@Param
goods: Goods | null = null;
@Param
uiState: BaseNetWorkUiState = BaseNetWorkUiState.LOADING;
@Param
specList: GoodsSpec[] = [];
@Param
onS... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/ui/src/main/ets/component/modal/SpecSelectModal.ets#L27-L222 | e008c6a24838e107ca53a62b0ec7372adc347b9f | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_cbc_encryption_decryption/aes_cbc_encryption_decryption_synchronous.ets | arkts | encryptMessage | 加密消息 | function encryptMessage(symKey: cryptoFramework.SymKey, plainText: cryptoFramework.DataBlob) {
let cipher = cryptoFramework.createCipher('AES128|CBC|PKCS7');
cipher.initSync(cryptoFramework.CryptoMode.ENCRYPT_MODE, symKey, iv);
let cipherData = cipher.doFinalSync(plainText);
return cipherData;
} | AST#function_declaration#Left function encryptMessage AST#parameter_list#Left ( AST#parameter#Left symKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . SymKey AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left p... | function encryptMessage(symKey: cryptoFramework.SymKey, plainText: cryptoFramework.DataBlob) {
let cipher = cryptoFramework.createCipher('AES128|CBC|PKCS7');
cipher.initSync(cryptoFramework.CryptoMode.ENCRYPT_MODE, symKey, iv);
let cipherData = cipher.doFinalSync(plainText);
return cipherData;
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_cbc_encryption_decryption/aes_cbc_encryption_decryption_synchronous.ets#L38-L43 | 9e15d27e15ba993ede174e8130de02e6ec4ee6a4 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/renderer/DataRenderer.ets | arkts | drawValue | Draws the value of the given entry by using the provided IValueFormatter.
@param c canvas
@param formatter formatter for custom value-formatting
@param value the value to be drawn
@param entry the entry the value belongs to
@param dataSetIndex the index of the DataSet the drawn Entry belong... | public drawValue(c: CanvasRenderingContext2D, formatter: IValueFormatter, value: number, entry: EntryOhos, dataSetIndex: number, x: number, y: number, color: number, isHorizontalFlip: boolean = false): void {
if (isHorizontalFlip) {
c.save();
c.scale(-1, 1);
}
this.mValuePaint.setColor(color);
... | AST#method_declaration#Left public drawValue AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left formatter : AST#type_annotation#Left AST#primary_type#Left IValu... | public drawValue(c: CanvasRenderingContext2D, formatter: IValueFormatter, value: number, entry: EntryOhos, dataSetIndex: number, x: number, y: number, color: number, isHorizontalFlip: boolean = false): void {
if (isHorizontalFlip) {
c.save();
c.scale(-1, 1);
}
this.mValuePaint.setColor(color);
... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/DataRenderer.ets#L168-L190 | 79ba20abbe249dfc2663cc91750c1b06392da594 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | SegmentedPhotograph/entry/src/main/ets/mode/CameraService.ets | arkts | releaseCamera | [End take_picture]
Release the session and related parameters | async releaseCamera(): Promise<void> {
Logger.info(TAG, 'releaseCamera is called');
try {
await this.previewOutput?.release();
} catch (error) {
let err = error as BusinessError;
Logger.error(TAG, `previewOutput release fail: error: ${JSON.stringify(err)}`);
} finally {
this.prev... | AST#method_declaration#Left async releaseCamera AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_ar... | async releaseCamera(): Promise<void> {
Logger.info(TAG, 'releaseCamera is called');
try {
await this.previewOutput?.release();
} catch (error) {
let err = error as BusinessError;
Logger.error(TAG, `previewOutput release fail: error: ${JSON.stringify(err)}`);
} finally {
this.prev... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/SegmentedPhotograph/entry/src/main/ets/mode/CameraService.ets#L273-L309 | 907fba67271c4342eee96b266fc07f0546cd9784 | gitee |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/viewmodel/LLMConfigManager.ets | arkts | getNetworkErrorMessage | 获取网络错误信息 | private getNetworkErrorMessage(message: string): string {
if (message.includes('timeout') || message.includes('超时')) {
return '连接超时,网络可能较慢';
} else if (message.includes('network') || message.includes('网络')) {
return '网络连接异常';
} else if (message.includes('DNS') || message.includes('域名')) {
... | AST#method_declaration#Left private getNetworkErrorMessage AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string ... | private getNetworkErrorMessage(message: string): string {
if (message.includes('timeout') || message.includes('超时')) {
return '连接超时,网络可能较慢';
} else if (message.includes('network') || message.includes('网络')) {
return '网络连接异常';
} else if (message.includes('DNS') || message.includes('域名')) {
... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/LLMConfigManager.ets#L708-L720 | 46a701a521c453cf1a66f77af75e61a71de91a1a | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets | arkts | isSymbol | Determines whether it is an operator.
@param value The symbol.
@return Is Operator. | isSymbol(value: string) {
if (CheckEmptyUtil.isEmpty(value)) {
return ;
}
return (CommonConstants.OPERATORS.indexOf(value) !== -1);
} | AST#method_declaration#Left isSymbol AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#exp... | isSymbol(value: string) {
if (CheckEmptyUtil.isEmpty(value)) {
return ;
}
return (CommonConstants.OPERATORS.indexOf(value) !== -1);
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets#L26-L31 | c2f853fbe9fa8b25d6a94e60d90a1e8a3a1aa367 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/toolbox/src/main/ets/pages/ToolBoxView.ets | arkts | tool | 工具项样式
@param {ToolInterface} $$ - 工具项入参 | @Builder
function tool($$: ToolInterface) {
Image(($$.params as ImgParams).imgRes)
.id("1")
.height(CommonConstants.TOOL_ITEM_HEIGHT)
.width(40)
.objectFit(ImageFit.Fill)
.visibility(($$.animation as VisibleAnimation).visible)
.onClick(() => {
promptAction.showToast({
message: '点... | AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function tool AST#parameter_list#Left ( AST#parameter#Left $$ : AST#type_annotation#Left AST#primary_type#Left ToolInterface AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builde... | @Builder
function tool($$: ToolInterface) {
Image(($$.params as ImgParams).imgRes)
.id("1")
.height(CommonConstants.TOOL_ITEM_HEIGHT)
.width(40)
.objectFit(ImageFit.Fill)
.visibility(($$.animation as VisibleAnimation).visible)
.onClick(() => {
promptAction.showToast({
message: '点... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/toolbox/src/main/ets/pages/ToolBoxView.ets#L243-L257 | 5422b2305b2b69d761f596c59fe185dae91e0417 | gitee |
htliang128/arkts_oss.git | 9da4a87c36272873c649f556854bd793ac337a18 | htliang_oss/src/main/ets/internal/signer/OSSSignerBase.ets | arkts | presign | public static createRequestSigner(version: SignVersion, signerParams: OSSSignerParams): RequestSigner { if (SignVersion.V4 == version) { return new OSSV4Signer(signerParams); } throw new Error("only support SignVersion.V4") } | presign(request: RequestMessage): void {
throw new Error('Method not implemented.');
} | AST#method_declaration#Left presign AST#parameter_list#Left ( AST#parameter#Left request : AST#type_annotation#Left AST#primary_type#Left RequestMessage 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#... | presign(request: RequestMessage): void {
throw new Error('Method not implemented.');
} | https://github.com/htliang128/arkts_oss.git/blob/9da4a87c36272873c649f556854bd793ac337a18/htliang_oss/src/main/ets/internal/signer/OSSSignerBase.ets#L58-L60 | 0445605d83484ac881d249b6579a5ab8912f5a36 | github |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/viewmodel/MainViewModel.ets | arkts | saveApiKey | 保存API密钥
@param apiKey - DeepSeek API密钥 | async saveApiKey(apiKey: string): Promise<void> {
await this.configService.saveApiKey(apiKey);
} | AST#method_declaration#Left async saveApiKey AST#parameter_list#Left ( AST#parameter#Left apiKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ... | async saveApiKey(apiKey: string): Promise<void> {
await this.configService.saveApiKey(apiKey);
} | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/viewmodel/MainViewModel.ets#L693-L695 | 6e627d18cb72b91c78a9b419eb453c9491e141b3 | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.atomicservice.AtomicServiceNavigation.d.ets | arkts | The builder function of NavDestination component.
@typedef { function } NavDestinationBuilder.
@param { string } name - The name of route page.
@param { ?Object } - param - The detailed parameter of the route page.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 12 | export type NavDestinationBuilder = (name: string, param?: Object) => void; | AST#export_declaration#Left export AST#type_declaration#Left type NavDestinationBuilder = AST#type_annotation#Left AST#function_type#Left 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#p... | export type NavDestinationBuilder = (name: string, param?: Object) => void; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.AtomicServiceNavigation.d.ets#L522-L522 | c21af650a87784539bb86cbfcb860d9995f206a4 | gitee | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/datasource/src/main/ets/ExamService.ets | arkts | getMiddleQuestionCount | 获取一般题数量
@returns | public getMiddleQuestionCount(): number {
return this.examDetails.filter(item => item.classificationType === ClassificationTypeEnum.MIDDLE).length;
} | AST#method_declaration#Left public getMiddleQuestionCount 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#m... | public getMiddleQuestionCount(): number {
return this.examDetails.filter(item => item.classificationType === ClassificationTypeEnum.MIDDLE).length;
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/datasource/src/main/ets/ExamService.ets#L228-L230 | 5968ea1b5a9df20b79f9aa5478da368996468dce | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ScaleMode.ets | arkts | reset | 重置 | public reset() {
this.scaleX = 1;
this.scaleY = 1;
this.moveX = 0;
this.moveY = 0;
this.centerX = 0;
this.centerY = 0;
this.preTouchScaleX = 1;
this.currentXSpace = 0;
this.currentYSpace = 0;
} | AST#method_declaration#Left public reset 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 . scaleX AST#member_expression#Right = ... | public reset() {
this.scaleX = 1;
this.scaleY = 1;
this.moveX = 0;
this.moveY = 0;
this.centerX = 0;
this.centerY = 0;
this.preTouchScaleX = 1;
this.currentXSpace = 0;
this.currentYSpace = 0;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ScaleMode.ets#L99-L109 | 9727b12e36b004e05a962a8c70e55e0919af951e | gitee |
YShelter/Accouting_ArkTS.git | 8c663c85f2c11738d4eabf269c23dc1ec84eb013 | entry/src/main/ets/common/database/Tables/DayInfoApi.ets | arkts | updateData | 更新数据 | updateData(dayInfo: DayInfo, callback: Function): void {
const valueBucket = generateBuket(dayInfo);
let predicates: dataRdb.RdbPredicates = new dataRdb.RdbPredicates('dayInfo');
predicates.equalTo('date', dayInfo.date);
RdbUtils.update(valueBucket, predicates).then((result: number) => {
callback(... | AST#method_declaration#Left updateData AST#parameter_list#Left ( AST#parameter#Left dayInfo : AST#type_annotation#Left AST#primary_type#Left DayInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_ty... | updateData(dayInfo: DayInfo, callback: Function): void {
const valueBucket = generateBuket(dayInfo);
let predicates: dataRdb.RdbPredicates = new dataRdb.RdbPredicates('dayInfo');
predicates.equalTo('date', dayInfo.date);
RdbUtils.update(valueBucket, predicates).then((result: number) => {
callback(... | https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Tables/DayInfoApi.ets#L20-L27 | 04344e9f1a8880e91a859546117299b877c5e04d | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/SettingsTypes.ets | arkts | 日期格式枚举 | export enum DateFormat {
YYYY_MM_DD = 'YYYY-MM-DD',
MM_DD_YYYY = 'MM/DD/YYYY',
DD_MM_YYYY = 'DD/MM/YYYY',
YYYY_MM_DD_CN = 'YYYY年MM月DD日',
MM_DD_CN = 'MM月DD日'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum DateFormat AST#enum_body#Left { AST#enum_member#Left YYYY_MM_DD = AST#expression#Left 'YYYY-MM-DD' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left MM_DD_YYYY = AST#expression#Left 'MM/DD/YYYY' AST#expression#Right AST#enum_member#Right ... | export enum DateFormat {
YYYY_MM_DD = 'YYYY-MM-DD',
MM_DD_YYYY = 'MM/DD/YYYY',
DD_MM_YYYY = 'DD/MM/YYYY',
YYYY_MM_DD_CN = 'YYYY年MM月DD日',
MM_DD_CN = 'MM月DD日'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L383-L389 | d6b175b6b3263dfd55db372504103de71e5a3247 | github | |
jjjjjjava/ffmpeg_tools.git | 6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161 | src/main/ets/ffmpeg/FFMpegUtils.ets | arkts | showLog | 启用或禁用 FFmpeg 日志输出
@param show true 显示日志,false 不显示 | static showLog(show: boolean): void {
try {
libAddon.showLog(show);
console.info(`[FFMpegUtils] FFmpeg logging ${show ? 'enabled' : 'disabled'}`);
} catch (e) {
console.error(`[FFMpegUtils] Failed to set logging:`, e);
}
} | AST#method_declaration#Left static showLog AST#parameter_list#Left ( AST#parameter#Left show : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Rig... | static showLog(show: boolean): void {
try {
libAddon.showLog(show);
console.info(`[FFMpegUtils] FFmpeg logging ${show ? 'enabled' : 'disabled'}`);
} catch (e) {
console.error(`[FFMpegUtils] Failed to set logging:`, e);
}
} | https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFMpegUtils.ets#L115-L122 | c3a70e957fa979c4caaacf3c0b813b57779aac24 | github |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/pages/TaskReviewView.ets | arkts | uploadInspectionRecord | 上传巡检记录 | async uploadInspectionRecord() {
try {
this.uploading = true;
this.uploadProgress = {
percentage: 0,
completed: 0,
total: 100,
current: '准备上传...'
};
// 获取上传信息
const uploadList = await this.getUploadInfo();
if (uploadList.length === 0) {
pr... | AST#method_declaration#Left async uploadInspectionRecord 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... | async uploadInspectionRecord() {
try {
this.uploading = true;
this.uploadProgress = {
percentage: 0,
completed: 0,
total: 100,
current: '准备上传...'
};
const uploadList = await this.getUploadInfo();
if (uploadList.length === 0) {
promptActio... | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/pages/TaskReviewView.ets#L476-L590 | c60d6953964893c3f1f9b7fe6bdd4b2b4911cb31 | github |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/animation/param/shared/utils/CardUtil.ets | arkts | getPostPageImageId | 一个卡片镜像被其他图片关联,弹出页上的图片需要标记id,在此统一设置id | public static getPostPageImageId(prePageClickedCardId: string | undefined): string | undefined {
if (!prePageClickedCardId) {
return undefined;
}
return 'Post_Page_Image' + prePageClickedCardId;
} | AST#method_declaration#Left public static getPostPageImageId AST#parameter_list#Left ( AST#parameter#Left prePageClickedCardId : 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_annotat... | public static getPostPageImageId(prePageClickedCardId: string | undefined): string | undefined {
if (!prePageClickedCardId) {
return undefined;
}
return 'Post_Page_Image' + prePageClickedCardId;
} | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/param/shared/utils/CardUtil.ets#L18-L23 | 9547ac805b298db7e0eabeb4c77ebd6f9656c35a | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/SHASync.ets | arkts | hmac | 消息认证码计算
@param str 计算字符串
@param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
@returns | static hmac(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return DynamicSyncUtil.hmac(str, 'SHA256', resultCoding);
} | AST#method_declaration#Left static hmac AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left... | static hmac(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return DynamicSyncUtil.hmac(str, 'SHA256', resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHASync.ets#L84-L86 | ab80a5f7667d4b84b5ac107f8c3eeaf6b28a9aed | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.atomicservice.AtomicServiceWeb.d.ets | arkts | Defines the Web's request/response header.
@typedef WebHeader
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 12 | export declare interface WebHeader {
/**
* Gets the key of the request/response header.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 12
*/
headerKey: string;
/**
* Gets the value of the request/response header.
*
* @type { string }
* ... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#interface_declaration#Left interface WebHeader AST#object_type#Left { /**
* Gets the key of the request/response header.
*
* @type { string }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 12
*/ AST... | export declare interface WebHeader {
headerKey: string;
headerValue: string;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.AtomicServiceWeb.d.ets#L481-L501 | d18d71b3d14d6f74ecc9c8359a074669b3f280ca | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/SettingsPage.ets | arkts | buildSettingsGroup | 构建设置分组 | @Builder
buildSettingsGroup(group: SettingsGroup) {
Column({ space: 1 }) {
// 分组标题
Text(group.title)
.fontSize(14)
.fontColor('#666666')
.alignSelf(ItemAlign.Start)
.margin({ left: 16, bottom: 8 })
// 设置项
Column() {
ForEach(group.items, (item:... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSettingsGroup AST#parameter_list#Left ( AST#parameter#Left group : AST#type_annotation#Left AST#primary_type#Left SettingsGroup AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_fu... | @Builder
buildSettingsGroup(group: SettingsGroup) {
Column({ space: 1 }) {
Text(group.title)
.fontSize(14)
.fontColor('#666666')
.alignSelf(ItemAlign.Start)
.margin({ left: 16, bottom: 8 })
Column() {
ForEach(group.items, (item: SettingsItem... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SettingsPage.ets#L461-L487 | c8eed3a2b54396dadfa518101a6773ee9aeb8aa1 | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componetsmodel/NoteVO.ets | arkts | 构造方法
@param noteContent
@param note
@param createTime | constructor(id: number, noteContent: string, createTime: string, note?: string) {
this.id = id;
this.noteContent = noteContent;
this.note = note;
this.createTime = createTime;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left noteContent : AST#type_annotation#Left AST#primary_type#Left string AST#primary_t... | constructor(id: number, noteContent: string, createTime: string, note?: string) {
this.id = id;
this.noteContent = noteContent;
this.note = note;
this.createTime = createTime;
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componetsmodel/NoteVO.ets#L23-L28 | 0b2e6568333f75c173ff143b713c6e0acd7a8eec | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Row.ets | arkts | RowEndTop | 横向末尾 + 垂直顶部 | @ComponentV2
export struct RowEndTop {
/**
* Row 构造参数
*/
@Param
options: RowOptions | RowOptionsV2 = {};
/**
* 宽度
*/
@Param
widthValue: Length | undefined = undefined;
/**
* 高度
*/
@Param
heightValue: Length | undefined = undefined;
/**
* 尺寸(对应官方 size 属性)
*/
@Param
sizeVal... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct RowEndTop AST#component_body#Left { /**
* Row 构造参数
*/ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right options : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left R... | @ComponentV2
export struct RowEndTop {
@Param
options: RowOptions | RowOptionsV2 = {};
@Param
widthValue: Length | undefined = undefined;
@Param
heightValue: Length | undefined = undefined;
@Param
sizeValue: SizeOptions | undefined = undefined;
@Param
paddingValue: Padding | Length | ... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L945-L1020 | b7d69cf84708946982867512b8dbd94cdab26ff9 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/DataType.ets | arkts | addData | 改变单个数据。
@param {number} index - 索引值。
@param {CustomDataType} data - 修改后的值。 | public addData(index: double, data: CustomDataType): void {
this.dataArray.splice(index, 0, data);
this.notifyDataAdd(index);
} | AST#method_declaration#Left public addData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left double AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left CustomDataType AST#primary... | public addData(index: double, data: CustomDataType): void {
this.dataArray.splice(index, 0, data);
this.notifyDataAdd(index);
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/DataType.ets#L177-L180 | 4406c0ceb6916b1f56b12868b3bd05a61d0a4a8f | gitee |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/services/NotificationService.ets | arkts | sendTaskReminder | 发送任务提醒通知
@param task - 要提醒的任务
@param type - 提醒类型 | async sendTaskReminder(task: Task, type: ReminderType = ReminderType.TASK_DUE): Promise<void> {
if (!this.isInitialized) {
if (this.context) {
await this.initialize(this.context);
} else {
console.error('[NotificationService] 无法发送提醒:服务未初始化且无Context');
return;
}
}
/... | AST#method_declaration#Left async sendTaskReminder AST#parameter_list#Left ( AST#parameter#Left task : AST#type_annotation#Left AST#primary_type#Left Task AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left ReminderType AST#prim... | async sendTaskReminder(task: Task, type: ReminderType = ReminderType.TASK_DUE): Promise<void> {
if (!this.isInitialized) {
if (this.context) {
await this.initialize(this.context);
} else {
console.error('[NotificationService] 无法发送提醒:服务未初始化且无Context');
return;
}
}
... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/services/NotificationService.ets#L123-L175 | 21f32dcc071bc76b795e7631addc4f9a6dd082f6 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/LineDataSet.ets | arkts | setDrawCircles | set this to true to enable the drawing of circle indicators for this
DataSet, default true
@param enabled | public setDrawCircles(enabled: boolean): void {
this.mDrawCircles = enabled;
} | AST#method_declaration#Left public setDrawCircles AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primar... | public setDrawCircles(enabled: boolean): void {
this.mDrawCircles = enabled;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineDataSet.ets#L235-L237 | 142dd04ce46cc1206296ca10277e55dd86133a45 | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | arkts/@arkts.collections.d.ets | arkts | has | Check if bit vector contains a particular bit element.
@param { number } element - Element to be contained (0 means 0, else means 1).
@param { number } fromIndex - The starting position of the index, containing the value at that index position.
@param { number } toIndex - The end of the index, containing the value at ... | has(element: number, fromIndex: number, toIndex: number): boolean; | AST#method_declaration#Left has AST#parameter_list#Left ( AST#parameter#Left element : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fromIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right ... | has(element: number, fromIndex: number, toIndex: number): boolean; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/arkts/@arkts.collections.d.ets#L12194-L12194 | ba2d57bfd02d638c707bd228d465bd7e5fa4ad24 | gitee |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/ArkTSLanguageBaseClassLibrary/LanguageBaseClassLibrary/common/src/main/ets/components/EmptyPage.ets | arkts | EmptyPage | Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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 l... | @Component
export struct EmptyPage {
private img: string | PixelMap | Resource = $r('app.media.bg_empty_page');
private message: ResourceStr = $r('app.string.tv_no_data');
build() {
Column() {
Image(this.img)
.width(120)
.aspectRatio(1)
Text(this.message)
.fontSize(14)
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct EmptyPage AST#component_body#Left { AST#property_declaration#Left private img : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left PixelMap AST#pri... | @Component
export struct EmptyPage {
private img: string | PixelMap | Resource = $r('app.media.bg_empty_page');
private message: ResourceStr = $r('app.string.tv_no_data');
build() {
Column() {
Image(this.img)
.width(120)
.aspectRatio(1)
Text(this.message)
.fontSize(14)
... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/ArkTSLanguageBaseClassLibrary/LanguageBaseClassLibrary/common/src/main/ets/components/EmptyPage.ets#L16-L37 | 555cc678831fb97634b0a6a9816743d08f792913 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/foldablescreencases/src/main/ets/pages/MusicPlayerPage.ets | arkts | MusicPlayerPage | 音乐播放器页面
实现步骤:
1.通过display的isFoldable接口区分折叠屏和非折叠屏
2.通过监听display的foldStatusChange,将折叠屏状态分发给各子组件
3.折叠屏设备使用FolderStack容器组件实现,指定子组件在折叠屏悬停态,移到上屏的能力 | @Component
export struct MusicPlayerPage {
// 窗口管理model
private windowModel: WindowModel = new WindowModel();
// 当前页面的vm实例
@Provide('musicPlayerViewModel') viewModel: MusicPlayerViewModel = new MusicPlayerViewModel();
// 当前折叠屏状态(若当前为折叠屏设备才有效)
@State curFoldStatus: display.FoldStatus = display.getFoldStatus(... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct MusicPlayerPage AST#component_body#Left { // 窗口管理model AST#property_declaration#Left private windowModel : AST#type_annotation#Left AST#primary_type#Left WindowModel AST#primary_type#Right AST#type_annotation#Right = ... | @Component
export struct MusicPlayerPage {
private windowModel: WindowModel = new WindowModel();
@Provide('musicPlayerViewModel') viewModel: MusicPlayerViewModel = new MusicPlayerViewModel();
@State curFoldStatus: display.FoldStatus = display.getFoldStatus();
@Styles
stackStyle() {
.height("1... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/foldablescreencases/src/main/ets/pages/MusicPlayerPage.ets#L36-L116 | ee4f9c11acd97e551cd78400d00d9885c4f1a37f | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/chatwithexpression/src/main/ets/view/ChatWithExpression.ets | arkts | ChatWithExpressionComponent | 延时时间 | @Component
export struct ChatWithExpressionComponent {
// 滚动条组件
private scroller: Scroller = new Scroller();
// 键盘安全高度
@StorageLink('keyboardHeight') keyboardHeight: number = 0;
// 发送的信息条数
@State msgNums: number = 0;
@State isFaceDlgOpen: boolean = false; // 表情对话框打开状态
private isFaceClick = false; // 表情按... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ChatWithExpressionComponent AST#component_body#Left { // 滚动条组件 AST#property_declaration#Left private scroller : AST#type_annotation#Left AST#primary_type#Left Scroller AST#primary_type#Right AST#type_annotation#Right ... | @Component
export struct ChatWithExpressionComponent {
private scroller: Scroller = new Scroller();
@StorageLink('keyboardHeight') keyboardHeight: number = 0;
@State msgNums: number = 0;
@State isFaceDlgOpen: boolean = false;
private isFaceClick = false;
controllerRich: RichEditorController = ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/chatwithexpression/src/main/ets/view/ChatWithExpression.ets#L61-L387 | 0c926f7046ff03ae7a5da10b3687ae341414f707 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ar/ARCardService.ets | arkts | AR渲染状态接口 | export interface ARRenderState {
isInitialized: boolean;
isSceneLoaded: boolean;
isTracking: boolean;
frameRate: number;
renderTime: number;
modelCount: number;
errors: string[];
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ARRenderState AST#object_type#Left { AST#type_member#Left isInitialized : 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 isSceneLoaded : AST#t... | export interface ARRenderState {
isInitialized: boolean;
isSceneLoaded: boolean;
isTracking: boolean;
frameRate: number;
renderTime: number;
modelCount: number;
errors: string[];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L280-L288 | 96cb532d6fe10c0335a1a746cf2959b4b47117d5 | github | |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/components/timer/TimerComponent.ets | arkts | subscribeStartTimer | 启动计时器 | subscribeStartTimer() {
EmitterUtil.unsubscribe(VHRoomEventType.TIMER_START);
EmitterUtil.subscribe(VHRoomEventType.TIMER_START, (msgData: EmitterMsgData) => {
console.log(`启动计时器,类型:${VHRoomEventType.TIMER_START}`);
let timerInfo: VHTimerMsg = msgData.data as VHTimerMsg;
this.initTimerMsg(time... | AST#method_declaration#Left subscribeStartTimer 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 EmitterUtil AST#expression#Right . unsubscri... | subscribeStartTimer() {
EmitterUtil.unsubscribe(VHRoomEventType.TIMER_START);
EmitterUtil.subscribe(VHRoomEventType.TIMER_START, (msgData: EmitterMsgData) => {
console.log(`启动计时器,类型:${VHRoomEventType.TIMER_START}`);
let timerInfo: VHTimerMsg = msgData.data as VHTimerMsg;
this.initTimerMsg(time... | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/timer/TimerComponent.ets#L258-L266 | 5936d384b7638806dd6cf34962762089130a88f8 | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | calculate | @Override | public calculate(dataMin: number, dataMax: number): void {
var min: number = dataMin;
var max: number = dataMax;
// Make sure max is greater than min
// Discussion: https://github.com/danielgindi/Charts/pull/3650#discussion_r221409991
if (min > max) {
if (this.mCusto... | AST#method_declaration#Left public calculate AST#parameter_list#Left ( AST#parameter#Left dataMin : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dataMax : AST#type_annotation#Left AST#primary_type#Left number AST#primary_... | public calculate(dataMin: number, dataMax: number): void {
var min: number = dataMin;
var max: number = dataMax;
if (min > max) {
if (this.mCustomAxisMax && this.mCustomAxisMin) {
var t: number = min;
min = max;
max =... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L431-L465 | 0530e68a28265173d886f1aea58cf279261708cc | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/constants/AppConstants.ets | arkts | 日志常量(兼容性) | export class LogConstants {
static readonly TAG_APP: string = 'BirthdayReminder';
static readonly TAG_SERVICE: string = 'Service';
static readonly TAG_DATABASE: string = 'Database';
static readonly TAG_LUNAR: string = 'Lunar';
static readonly TAG_AI: string = 'AI';
static readonly DOMAIN_APP: number = 0x000... | AST#export_declaration#Left export AST#class_declaration#Left class LogConstants AST#class_body#Left { AST#property_declaration#Left static readonly TAG_APP : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'BirthdayReminder' AST#expression#Ri... | export class LogConstants {
static readonly TAG_APP: string = 'BirthdayReminder';
static readonly TAG_SERVICE: string = 'Service';
static readonly TAG_DATABASE: string = 'Database';
static readonly TAG_LUNAR: string = 'Lunar';
static readonly TAG_AI: string = 'AI';
static readonly DOMAIN_APP: number = 0x000... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/constants/AppConstants.ets#L97-L108 | 7c5ee188cc968835d769022b4cb03cbe47aea45f | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/SettingsTypes.ets | arkts | 时间格式枚举 | export enum TimeFormat {
FORMAT_12H = '12h',
FORMAT_24H = '24h'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum TimeFormat AST#enum_body#Left { AST#enum_member#Left FORMAT_12H = AST#expression#Left '12h' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left FORMAT_24H = AST#expression#Left '24h' AST#expression#Right AST#enum_member#Right } AST#enum_bod... | export enum TimeFormat {
FORMAT_12H = '12h',
FORMAT_24H = '24h'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L392-L395 | cf3b8f3f1695e01f74ba42c3b16fcc7271db5698 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/share/SharePage.ets | arkts | buildCustomContentDialog | 构建自定义内容对话框 | @Builder
buildCustomContentDialog() {
Column({ space: UIConstants.LARGE_PADDING }) {
Text('编辑分享内容')
.fontSize(UIConstants.FONT_SIZE_HEADING)
.fontWeight(FontWeight.Medium)
.fontColor($r('app.color.text_primary'))
TextArea({ text: this.customContent, placeholder: '请输入分享内容...' }... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCustomContentDialog 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#comp... | @Builder
buildCustomContentDialog() {
Column({ space: UIConstants.LARGE_PADDING }) {
Text('编辑分享内容')
.fontSize(UIConstants.FONT_SIZE_HEADING)
.fontWeight(FontWeight.Medium)
.fontColor($r('app.color.text_primary'))
TextArea({ text: this.customContent, placeholder: '请输入分享内容...' }... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/share/SharePage.ets#L490-L528 | d597cf6e6fbd3cf47eed03ccb40de5eefdff95ae | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/ModelConfigService.ets | arkts | getModelsByProvider | 根据厂商获取模型列表 | public getModelsByProvider(provider: ModelProvider): ModelInfo[] {
return this.predefinedModels[provider] || [];
} | AST#method_declaration#Left public getModelsByProvider AST#parameter_list#Left ( AST#parameter#Left provider : AST#type_annotation#Left AST#primary_type#Left ModelProvider AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST... | public getModelsByProvider(provider: ModelProvider): ModelInfo[] {
return this.predefinedModels[provider] || [];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/ModelConfigService.ets#L311-L313 | ddad804598eaf125fae83a0d3437787ddf12ca0e | github |
xinkai-hu/MyDay.git | dcbc82036cf47b8561b0f2a7783ff0078a7fe61d | entry/src/main/ets/pages/SearchSchedule.ets | arkts | pageTransition | 页面跳转动画。 | public pageTransition(): void {
PageTransitionEnter({ type: RouteType.None, duration: 400 })
.slide(SlideEffect.Right);
PageTransitionExit({ type: RouteType.None, duration: 400 })
.slide(SlideEffect.Right);
} | AST#method_declaration#Left public pageTransition 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_component#Lef... | public pageTransition(): void {
PageTransitionEnter({ type: RouteType.None, duration: 400 })
.slide(SlideEffect.Right);
PageTransitionExit({ type: RouteType.None, duration: 400 })
.slide(SlideEffect.Right);
} | https://github.com/xinkai-hu/MyDay.git/blob/dcbc82036cf47b8561b0f2a7783ff0078a7fe61d/entry/src/main/ets/pages/SearchSchedule.ets#L54-L59 | 06f03e8eebdc92623875c065c9434574076b2c2f | github |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/entry/src/main/ets/pages/plan/plan.ets | arkts | demo | 时间和小点 | @Builder
demo(beginDay:number){
Column(){
Text("")
.backgroundColor(this.nowDataTime==beginDay?"#ffffff":"#6C55E4")
.width(10)
.height(10)
.borderRadius(5)
Text(beginDay+'')
.fontColor("#ffffff")
.fontSize(18)
.margin(10)
}
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right demo AST#parameter_list#Left ( AST#parameter#Left beginDay : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left {... | @Builder
demo(beginDay:number){
Column(){
Text("")
.backgroundColor(this.nowDataTime==beginDay?"#ffffff":"#6C55E4")
.width(10)
.height(10)
.borderRadius(5)
Text(beginDay+'')
.fontColor("#ffffff")
.fontSize(18)
.margin(10)
}
} | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/plan/plan.ets#L181-L194 | c93f7c4a8a4c6a64a031e2dcaa47990675e78ea2 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/variablewatch/src/main/ets/view/VariableWatchView.ets | arkts | 数据刷新标志 | build() {
Column({ space: OHOS_CARD_MARGIN }) {
Column({ space: OHOS_CARD_MARGIN }) {
Text($r('app.string.variablewatch_headline')).fontSize($r('app.string.variablewatch_text_size_headline'))
Text($r('app.string.variablewatch_function_introduction')).fontSize($r('app.string.variablewatch_text_... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left OHOS_CARD_MARGIN AST#expression#Right AST#component_parameter#Right } AST#component_p... | build() {
Column({ space: OHOS_CARD_MARGIN }) {
Column({ space: OHOS_CARD_MARGIN }) {
Text($r('app.string.variablewatch_headline')).fontSize($r('app.string.variablewatch_text_size_headline'))
Text($r('app.string.variablewatch_function_introduction')).fontSize($r('app.string.variablewatch_text_... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/variablewatch/src/main/ets/view/VariableWatchView.ets#L46-L98 | 586b7c128ec14c0186939c768a4dba2228b91e28 | gitee | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2.ets | arkts | verify | 验签
@param signStr 已签名的字符串
@param verifyStr 需要验签的字符串
@param pubKey SM2公钥
@returns 验签结果OutDTO对象,其中Msg为验签结果 | static async verify(signStr: string, verifyStr: string, pubKey: string): Promise<OutDTO<string>> {
return CryptoUtil.verify(signStr, verifyStr, pubKey, 'SM2_256', 'SM2_256|SM3', 256);
} | AST#method_declaration#Left static async verify AST#parameter_list#Left ( AST#parameter#Left signStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left verifyStr : AST#type_annotation#Left AST#primary_type#Left string AST#pri... | static async verify(signStr: string, verifyStr: string, pubKey: string): Promise<OutDTO<string>> {
return CryptoUtil.verify(signStr, verifyStr, pubKey, 'SM2_256', 'SM2_256|SM3', 256);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2.ets#L72-L74 | 9c549486c9dea624e54770e0b475d272129e391e | gitee |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/api/Router.ets | arkts | popNavWithResult | @deprecated
@see {ZRouter.getInstance().popNavWithResult}
@param name
@param result
@param animated | public static popNavWithResult<T>(name: string, result: T, animated: boolean = true) {
ZRouter.getRouterMgr().popNavWithResult<T>(name, result, animated)
} | AST#method_declaration#Left public static popNavWithResult AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right 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 ... | public static popNavWithResult<T>(name: string, result: T, animated: boolean = true) {
ZRouter.getRouterMgr().popNavWithResult<T>(name, result, animated)
} | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/api/Router.ets#L468-L470 | ae52fafceab834b72e326ca37f815403884494a7 | gitee |
batiluoxuanwan/MomentFlow.git | e57aa461223abca74f48893afc2ccf7c2d73e9b8 | frontend/entry/src/main/ets/api/DiaryApi.ets | arkts | detail | 获取详情 | static async detail(id: number): Promise<Diary | null> {
return request<Diary>(`${BASE_URL}/${id}`, {
method: http.RequestMethod.GET
})
} | AST#method_declaration#Left static async detail AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left P... | static async detail(id: number): Promise<Diary | null> {
return request<Diary>(`${BASE_URL}/${id}`, {
method: http.RequestMethod.GET
})
} | https://github.com/batiluoxuanwan/MomentFlow.git/blob/e57aa461223abca74f48893afc2ccf7c2d73e9b8/frontend/entry/src/main/ets/api/DiaryApi.ets#L61-L65 | 83a8fb8863554276b120fbcb685c18fb1b61a416 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/SimpleBirthdayApp.ets | arkts | buildQuickActions | 构建快捷操作 | @Builder
buildQuickActions() {
Column({ space: 16 }) {
Text('快捷操作')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.alignSelf(ItemAlign.Start)
// 操作按钮行
Row({ space: 12 }) {
Button('添加联系人')
.type(ButtonType.Capsule)
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildQuickActions AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_p... | @Builder
buildQuickActions() {
Column({ space: 16 }) {
Text('快捷操作')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.alignSelf(ItemAlign.Start)
Row({ space: 12 }) {
Button('添加联系人')
.type(ButtonType.Capsule)
.fontSiz... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SimpleBirthdayApp.ets#L680-L750 | e25f6de4f835200d77ba1e58f3dd0f9f375a46b2 | github |
JackJiang2011/harmonychat.git | bca3f3e1ce54d763720510f99acf595a49e37879 | entry/src/main/ets/IMClientManager.ets | arkts | getInstance | 获得本类的全局单例。
@returns IMClientManager单例 | static getInstance(): IMClientManager {
if (!IMClientManager.instance) {
IMClientManager.instance = new IMClientManager();
}
return IMClientManager.instance;
} | AST#method_declaration#Left static getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left IMClientManager AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Lef... | static getInstance(): IMClientManager {
if (!IMClientManager.instance) {
IMClientManager.instance = new IMClientManager();
}
return IMClientManager.instance;
} | https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/IMClientManager.ets#L48-L53 | e361dc26477d4fafcd43e05fac210248cfd11694 | github |
hqj201013136012/HarmonyMiliUiPro.git | 0625e681e07b771998a0ac4430824627d0eb60ed | entry/src/main/ets/viewmodel/InterComData.ets | arkts | 留影留言影音列表数据 | export const lylyAudioDataList: LylyAudioItemData[] = [
new LylyAudioItemData(LYLY_SNAP_VEDIO_TYPE, "区口机1", "01:00", "2023.06.01 14:00:17", false,
$r('app.media.icon_lyly_play')),
new LylyAudioItemData(LYLY_SNAP_AUDIO_TYPE, "区口机2", "01:00", "2023.06.01 14:00:17", false,
$r('app.media.icon_lyly_voice')),
n... | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left lylyAudioDataList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left LylyAudioItemData [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#L... | export const lylyAudioDataList: LylyAudioItemData[] = [
new LylyAudioItemData(LYLY_SNAP_VEDIO_TYPE, "区口机1", "01:00", "2023.06.01 14:00:17", false,
$r('app.media.icon_lyly_play')),
new LylyAudioItemData(LYLY_SNAP_AUDIO_TYPE, "区口机2", "01:00", "2023.06.01 14:00:17", false,
$r('app.media.icon_lyly_voice')),
n... | https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/viewmodel/InterComData.ets#L200-L215 | 9dfdefb282cf6b82664aa9eddb74a16b74aa5289 | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_json/src/main/ets/json/JSONUtil.ets | arkts | parse | 将传入的json字符串格式化为Object对象
@param jsonStr
@returns
@deprecated 使用JSONObject或者JSONArray/JSONArrayList 方法代替 | static parse(jsonStr: string): Object {
return JSON.parse(jsonStr);
} | AST#method_declaration#Left static parse AST#parameter_list#Left ( AST#parameter#Left jsonStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#R... | static parse(jsonStr: string): Object {
return JSON.parse(jsonStr);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_json/src/main/ets/json/JSONUtil.ets#L81-L83 | f4b5b674065df6b52bde454d88a05326a5d11151 | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/DataSet.ets | arkts | Creates a new DataSet object with the given values (entries) it represents. Also, a
label that describes the DataSet can be specified. The label can also be
used to retrieve the DataSet from a ChartData object.
@param entries
@param label | constructor(entries: JArrayList<T>, label: string) {
super(label);
this.mEntries = entries;
if (!this.mEntries || this.mEntries == null) {
this.mEntries = new JArrayList<T>();
}
this.calcMinMax();
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left entries : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left JArrayList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_argum... | constructor(entries: JArrayList<T>, label: string) {
super(label);
this.mEntries = entries;
if (!this.mEntries || this.mEntries == null) {
this.mEntries = new JArrayList<T>();
}
this.calcMinMax();
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/DataSet.ets#L61-L70 | 3de40465290b39d57ced33952d4d27f96617ff1f | gitee | |
851432669/Smart-Home-ArkTs-Hi3861.git | 0451f85f072ed3281cc23d9cdc2843d79f60f975 | entry/src/main/ets/common/utils/GlobalDataManager.ets | arkts | preloadWeatherData | 预加载天气数据 | async preloadWeatherData(): Promise<void> {
// 避免重复加载
if (this.isDataLoaded) {
console.info('天气数据已预加载,跳过');
return;
}
console.info('开始预加载天气数据...');
const LOCATION_ID = '101230201'; // 厦门
const viewModel = new EnvironmentViewModel();
// 添加重试机制
for (let attempts = 0; atte... | AST#method_declaration#Left async preloadWeatherData 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#ty... | async preloadWeatherData(): Promise<void> {
if (this.isDataLoaded) {
console.info('天气数据已预加载,跳过');
return;
}
console.info('开始预加载天气数据...');
const LOCATION_ID = '101230201';
const viewModel = new EnvironmentViewModel();
for (let attempts = 0; attempts < 3; attempts++) {... | https://github.com/851432669/Smart-Home-ArkTs-Hi3861.git/blob/0451f85f072ed3281cc23d9cdc2843d79f60f975/entry/src/main/ets/common/utils/GlobalDataManager.ets#L308-L417 | 18bfcbe4e5078df94f8a48d9ddf0805f1d651582 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ar/ARCardService.ets | arkts | 灯光配置接口 | export interface LightingConfig {
ambientIntensity: number;
directionalIntensity: number;
shadowEnabled: boolean;
colorTemperature: number;
spotlights: SpotLight[];
} | AST#export_declaration#Left export AST#interface_declaration#Left interface LightingConfig AST#object_type#Left { AST#type_member#Left ambientIntensity : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left directionalIntensi... | export interface LightingConfig {
ambientIntensity: number;
directionalIntensity: number;
shadowEnabled: boolean;
colorTemperature: number;
spotlights: SpotLight[];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L44-L50 | 70174b4f0936daa66699401bf11acee339e0d61e | github | |
SeaEpoch/SepWeather.git | e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c | entry/src/main/ets/common/database/Rdb.ets | arkts | updateData | 更新 | updateData(predicates: relationalStore.RdbPredicates, data: relationalStore.ValuesBucket, callback: Function = () => {
}) {
if (!callback || typeof callback === 'undefined' || callback === undefined) {
Logger.info(CommonConstants.RDB_TAG, 'updateDate() has no callback!');
return;
}
let resFlag... | AST#method_declaration#Left updateData AST#parameter_list#Left ( AST#parameter#Left predicates : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . RdbPredicates AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left data ... | updateData(predicates: relationalStore.RdbPredicates, data: relationalStore.ValuesBucket, callback: Function = () => {
}) {
if (!callback || typeof callback === 'undefined' || callback === undefined) {
Logger.info(CommonConstants.RDB_TAG, 'updateDate() has no callback!');
return;
}
let resFlag... | https://github.com/SeaEpoch/SepWeather.git/blob/e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c/entry/src/main/ets/common/database/Rdb.ets#L87-L106 | bafea0a92f3aaa180b2827229301c6df225c1a21 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/groupavatar/src/main/ets/view/components/NavigationBarContent.ets | arkts | menuComponent | 菜单组件 | @Builder
menuComponent() {
Menu() {
MenuItem({
startIcon: $r("app.media.group_avatar_message_filled"),
content: $r('app.string.group_avatar_menu_title_session')
})
.onClick(() => {
this.navPathStack.pushPath({ name: 'GroupAvatarAddPage' });
})
MenuItem({... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right menuComponent 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 Menu ( ) AST#container_content_body#Left { AST#arkts_ui_elem... | @Builder
menuComponent() {
Menu() {
MenuItem({
startIcon: $r("app.media.group_avatar_message_filled"),
content: $r('app.string.group_avatar_menu_title_session')
})
.onClick(() => {
this.navPathStack.pushPath({ name: 'GroupAvatarAddPage' });
})
MenuItem({... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/groupavatar/src/main/ets/view/components/NavigationBarContent.ets#L27-L55 | 38121f6728baa6f081283370238acfe7677e60d0 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/view/AddressBookList.ets | arkts | itemHead | 底部导航栏高度 | @Builder
itemHead(text: string) {
// 列表分组的头部组件,对应联系人分组A、B等位置的组件
Text(text)
.fontSize($r('app.integer.operate_rdb_in_taskpool_list_head_font_size'))
.fontWeight(FontWeight.Medium)
.width(CommonConstants.FULL_PERCENT)
.height($r('app.integer.operate_rdb_in_taskpool_list_head_height'))
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right itemHead AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left {... | @Builder
itemHead(text: string) {
Text(text)
.fontSize($r('app.integer.operate_rdb_in_taskpool_list_head_font_size'))
.fontWeight(FontWeight.Medium)
.width(CommonConstants.FULL_PERCENT)
.height($r('app.integer.operate_rdb_in_taskpool_list_head_height'))
.backgroundColor($r('app.... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/view/AddressBookList.ets#L53-L63 | e5a066c319ae177b4f9ea51fee8a27d33178c5eb | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/navigation/src/main/ets/order/OrderParam.ets | arkts | 订单支付参数 | export interface OrderPayParam extends OrderIdParam {
/**
* 支付价格
*/
price: number;
/**
* 来源(可选)
*/
from?: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface OrderPayParam AST#extends_clause#Left extends OrderIdParam AST#extends_clause#Right AST#object_type#Left { /**
* 支付价格
*/ AST#type_member#Left price : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_an... | export interface OrderPayParam extends OrderIdParam {
price: number;
from?: string;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/order/OrderParam.ets#L21-L30 | 723739b4fe633f511556808e8eb118c328268c52 | github | |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_api15/entry/src/main/ets/MainAbility/pages/data/BasicDataSource.ets | arkts | notifyDataAdd | 通知LazyForEach组件需要在index对应索引处添加子组件 | notifyDataAdd(index: number): void {
this.listeners.forEach(listener => {
listener.onDataAdd(index);
// 写法2:listener.onDatasetChange([{type: DataOperationType.ADD, index: index}]);
})
} | AST#method_declaration#Left notifyDataAdd AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Righ... | notifyDataAdd(index: number): void {
this.listeners.forEach(listener => {
listener.onDataAdd(index);
})
} | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_api15/entry/src/main/ets/MainAbility/pages/data/BasicDataSource.ets#L53-L58 | 08b4d492a1850d072b14e54e2473c1c5fdacf066 | gitee |
Million-mo/tree-sitter-arkts.git | 2fd0ad75e2d848709edcf4be038f27b178114ef6 | examples/event_handling.ets | arkts | handlePinchGesture | 手势事件处理 | private handlePinchGesture(event: GestureEvent) {
if (event.scale) {
this.scaleValue = event.scale
this.eventData.gestureInfo = `缩放倍数: ${this.scaleValue.toFixed(2)}`
}
} | AST#method_declaration#Left private handlePinchGesture AST#parameter_list#Left ( AST#parameter#Left event : AST#type_annotation#Left AST#primary_type#Left GestureEvent AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Lef... | private handlePinchGesture(event: GestureEvent) {
if (event.scale) {
this.scaleValue = event.scale
this.eventData.gestureInfo = `缩放倍数: ${this.scaleValue.toFixed(2)}`
}
} | https://github.com/Million-mo/tree-sitter-arkts.git/blob/2fd0ad75e2d848709edcf4be038f27b178114ef6/examples/event_handling.ets#L63-L68 | bd0b599afbcbec1450598639c7eb6b3dbea14ef7 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/component/DatePickerDialogView.ets | arkts | TextPickerStyle | TextPicker统一样式 | @Extend(TextPicker)
function TextPickerStyle(options: DateTimePickerOptions, contain: boolean, layoutWeight: number) {
.visibility(contain ? Visibility.Visible : Visibility.None)
.layoutWeight(layoutWeight)
.textStyle(options.textStyle)
.selectedTextStyle(options.selectedTextStyle)
.disappearTextStyle(options... | AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left TextPicker AST#expression#Right ) AST#decorator#Right function TextPickerStyle AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left DateTimePickerOptions AST#primary_type#Right AST#... | @Extend(TextPicker)
function TextPickerStyle(options: DateTimePickerOptions, contain: boolean, layoutWeight: number) {
.visibility(contain ? Visibility.Visible : Visibility.None)
.layoutWeight(layoutWeight)
.textStyle(options.textStyle)
.selectedTextStyle(options.selectedTextStyle)
.disappearTextStyle(options... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/component/DatePickerDialogView.ets#L276-L285 | 461ad8bcea8f1323c54826f35a20d536462073eb | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets | arkts | buildVersion | Build版本号,标识编译构建的版本号。 | static buildVersion(): string {
return deviceInfo.buildVersion + ''
} | AST#method_declaration#Left static buildVersion AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expr... | static buildVersion(): string {
return deviceInfo.buildVersion + ''
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets#L161-L163 | 0b5ca890cc2d1cca7b525ce174a2db3c4e23d30a | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/ContactsPage.ets | arkts | loadContacts | 加载联系人数据 | private async loadContacts(): Promise<void> {
try {
this.loading = true;
this.contacts = await this.contactService.searchContacts({
pageSize: 1000 // 加载所有联系人
});
this.applyFilters();
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to loa... | AST#method_declaration#Left private async loadContacts 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#... | private async loadContacts(): Promise<void> {
try {
this.loading = true;
this.contacts = await this.contactService.searchContacts({
pageSize: 1000
});
this.applyFilters();
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to load contacts... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/ContactsPage.ets#L43-L55 | 49657a0ffb79d7b80869cb946ef5c62ea0c85b35 | github |
queyun123/weatherApp-ArkTS.git | 6beee6640db32ae70c342866b24fc643a9c512bf | entry/src/main/ets/pages/Index.ets | arkts | onPageShow | 页面显示时加载数据 | async onPageShow() {
console.log('页面显示,加载天气数据');
// 1. 从本地存储加载上次选择的城市
await this.loadLastCity();
// 2. 加载天气数据
await this.loadWeatherData();
} | AST#method_declaration#Left async onPageShow 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 console AST#expression#Right . log AST#member_e... | async onPageShow() {
console.log('页面显示,加载天气数据');
await this.loadLastCity();
await this.loadWeatherData();
} | https://github.com/queyun123/weatherApp-ArkTS.git/blob/6beee6640db32ae70c342866b24fc643a9c512bf/entry/src/main/ets/pages/Index.ets#L21-L29 | b8faab99fe263ac2a4d7499059a72fb4afd727f2 | github |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/hashing/MD5.ets | arkts | toLittleEndian32 | 将数字转换为小端序 | private static toLittleEndian32(n: number): number {
return ((n << 24) & 0xFF000000) |
((n << 8) & 0x00FF0000) |
((n >>> 8) & 0x0000FF00) |
((n >>> 24) & 0x000000FF);
} | AST#method_declaration#Left private static toLittleEndian32 AST#parameter_list#Left ( AST#parameter#Left n : 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#p... | private static toLittleEndian32(n: number): number {
return ((n << 24) & 0xFF000000) |
((n << 8) & 0x00FF0000) |
((n >>> 8) & 0x0000FF00) |
((n >>> 24) & 0x000000FF);
} | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/hashing/MD5.ets#L38-L43 | 4b3864611b18ad3aa3c8c15fac6b7e6a6bd83c19 | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/control_flow/loop_stmt/for_update_002_F.ets | arkts | Introduction 循环结构-update语句 | export function for_update_002_F(taint_src : string) {
let clean = ""
let _t = taint_src;
let ini = 0
let j = "_"
for (; ini < 2; j = "_") {
clean = j
ini++
}
taint.Sink(clean);
} | AST#export_declaration#Left export AST#function_declaration#Left function for_update_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Le... | export function for_update_002_F(taint_src : string) {
let clean = ""
let _t = taint_src;
let ini = 0
let j = "_"
for (; ini < 2; j = "_") {
clean = j
ini++
}
taint.Sink(clean);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/control_flow/loop_stmt/for_update_002_F.ets#L6-L16 | d0d2aeed515033426e1258c081365b5b93ba38eb | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/SM4.ets | arkts | decryptGCMSegment | 解密(GCM模式)分段,异步
@param data 加密或者解密的数据。data不能为null。
@param symKey 指定加密或解密的密钥。
@param gcmParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。
@param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(SM4_128|GCM|PKCS7、SM4_128|GCM|PKCS5、等)
@param len 自定义的数据拆分长度。
@returns | static async decryptGCMSegment(dataBlob: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7',
len: number = 128): Promise<cryptoFramework.DataBlob> {
let decoder = cryptoFramework.createCipher(transformation);
a... | AST#method_declaration#Left static async decryptGCMSegment AST#parameter_list#Left ( AST#parameter#Left dataBlob : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#paramet... | static async decryptGCMSegment(dataBlob: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7',
len: number = 128): Promise<cryptoFramework.DataBlob> {
let decoder = cryptoFramework.createCipher(transformation);
a... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SM4.ets#L328-L347 | 42c18221dd8642307d3d8db2b3135530e2b8b967 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/utils/DateUtils.ets | arkts | getTomorrow | 获取明天日期
@returns 明天的日期对象 | static getTomorrow(): Date {
const today = DateUtils.getToday();
today.setDate(today.getDate() + 1);
return today;
} | AST#method_declaration#Left static getTomorrow AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left today ... | static getTomorrow(): Date {
const today = DateUtils.getToday();
today.setDate(today.getDate() + 1);
return today;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/utils/DateUtils.ets#L83-L87 | 2832e8c6539a42b327b5811a84587e5bc7754914 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Alarm/PermissionManager.ets | arkts | requestPermissionOnSetting | 跳转设置页进行二次授权(类似Android的shouldShowRequestPermissionRationale)
@param context UIAbility上下文
@param permissions 权限列表
@returns Promise对象,解析为是否全部授权 | static async requestPermissionOnSetting(
context: common.UIAbilityContext,
permissions: Permissions[]
): Promise<boolean> {
const atMgr = PermissionManager.getAtManager();
try {
// 跳转到应用设置页面
const results = await atMgr.requestPermissionOnSetting(context, permissions);
return results.... | AST#method_declaration#Left static async requestPermissionOnSetting AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#... | static async requestPermissionOnSetting(
context: common.UIAbilityContext,
permissions: Permissions[]
): Promise<boolean> {
const atMgr = PermissionManager.getAtManager();
try {
const results = await atMgr.requestPermissionOnSetting(context, permissions);
return results.every(status... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Alarm/PermissionManager.ets#L137-L160 | 9321e1e5fe7df3325a15e720310e2a172f17021c | github |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/components/chat/PrivateChatComponent.ets | arkts | updateIcons | 更新所有图标状态 | updateIcons() {
const currentTime = Date.now()
const newIcons: VHLikeIcon[] = []
for (let icon of this.likeIcons) {
// 计算图标已存在的时间
const existTime = currentTime - icon.createTime
if (existTime < icon.lifespan) {
// 计算存在时间比例
const progress = existTime / icon.lifespan
... | AST#method_declaration#Left updateIcons AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left currentTime = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expres... | updateIcons() {
const currentTime = Date.now()
const newIcons: VHLikeIcon[] = []
for (let icon of this.likeIcons) {
const existTime = currentTime - icon.createTime
if (existTime < icon.lifespan) {
const progress = existTime / icon.lifespan
const vertic... | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/chat/PrivateChatComponent.ets#L259-L323 | cbb0f34bbffa10284b02264185d433e435b593bf | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Sounds/Cloud/Manager/CSoundManager.ets | arkts | 主模型类 | export class CSoundManager {
// 单例实例
private static instance: CSoundManager | null = null;
// 下载器和生成器
private downloader: CosDownloader = CosDownloader.shared
// private generator: IDownloader = new AmazonDownloader();
///用于缓存已经查询过的且存在的声音
private existedSoundCacheSet: Set<string> = new Set<string>() // ... | AST#export_declaration#Left export AST#class_declaration#Left class CSoundManager AST#class_body#Left { // 单例实例 AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left CSoundManager AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Ri... | export class CSoundManager {
private static instance: CSoundManager | null = null;
private downloader: CosDownloader = CosDownloader.shared
private existedSoundCacheSet: Set<string> = new Set<string>()
private constructor() {}
static get shared(): CSoundManager {
if (!CSoundManager.... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Manager/CSoundManager.ets#L18-L128 | 1ff9dad438b431d34ca6493ee518bd7ae58fdba7 | github | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | ComponentReuse/positive/src/main/ets/model/ItemData.ets | arkts | ItemData | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Observed
export class ItemData {
id: string = '';
title: string | Resource = '';
content: string = '';
from: string | Resource = '';
tail: string | Resource = '';
type: number = 0;
pics: Resource[] = [];
preview: Resource | string = '';
duration: string = '';
constructor(id: string, type: number) ... | AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class ItemData AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AS... | @Observed
export class ItemData {
id: string = '';
title: string | Resource = '';
content: string = '';
from: string | Resource = '';
tail: string | Resource = '';
type: number = 0;
pics: Resource[] = [];
preview: Resource | string = '';
duration: string = '';
constructor(id: string, type: number) ... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ComponentReuse/positive/src/main/ets/model/ItemData.ets#L16-L32 | ad1442819291292296801e7b37b8811134d1601d | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Solutions/InputMethod/KikaInput/entry/src/main/ets/components/KeyItemNumber.ets | arkts | KeyItemNumber | 有大小写的按键组件 | @Component
export struct KeyItemNumber {
@StorageLink('inputStyle') inputStyle: KeyStyle = StyleConfiguration.getSavedInputStyle();
@Consume keyState: number;
private keyValue: keySourceListType | undefined = undefined;
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justify... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct KeyItemNumber AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'inputStyle' AST#expression#Right ) AST#decorator#Right inputStyle : AST#type_annotation#Lef... | @Component
export struct KeyItemNumber {
@StorageLink('inputStyle') inputStyle: KeyStyle = StyleConfiguration.getSavedInputStyle();
@Consume keyState: number;
private keyValue: keySourceListType | undefined = undefined;
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justify... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/InputMethod/KikaInput/entry/src/main/ets/components/KeyItemNumber.ets#L29-L88 | ac2b7e62e730e3d930e19ed2aaa5888430ffa1a6 | gitee |
xt1314520/IbestKnowTeach | 61f0a7a3d328ad5a52de8fd699b9e1e94de0203b | entry/src/main/ets/api/UserApi.type.ets | arkts | 修改用户昵称接口入参 | export interface UserNicknameUpdateParam {
/**
* 昵称
*/
nickname: string
} | AST#export_declaration#Left export AST#interface_declaration#Left interface UserNicknameUpdateParam AST#object_type#Left { /**
* 昵称
*/ AST#type_member#Left nickname : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right } AST#object_type#Righ... | export interface UserNicknameUpdateParam {
nickname: string
} | https://github.com/xt1314520/IbestKnowTeach/blob/61f0a7a3d328ad5a52de8fd699b9e1e94de0203b/entry/src/main/ets/api/UserApi.type.ets#L42-L47 | ee5f6ab04f101a7dce6bc4e386620b23d5a74c1a | gitee | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_ui/src/main/ets/ui/prompt/MessageUtil.ets | arkts | close | 关闭
@param componentContent
@param promptAction | close() {
// close(componentContent: ComponentContent<MessageCfg>, promptAction: PromptAction) {
// promptAction.closeCustomDialog(componentContent);
clearTimeout(this.timer);
this.promptAction?.closeCustomDialog(this.componentContent);
} | AST#method_declaration#Left close AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // close(componentContent: ComponentContent<MessageCfg>, promptAction: PromptAction) { // promptAction.closeCustomDialog(componentContent); AST#ui_custom_component_statement#Left clearTimeout ( AST#ex... | close() {
clearTimeout(this.timer);
this.promptAction?.closeCustomDialog(this.componentContent);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/MessageUtil.ets#L124-L129 | e4b29266aa85bf2b256437d28df36b2a6b0c35f8 | gitee |
xt1314520/IbestKnowTeach | 61f0a7a3d328ad5a52de8fd699b9e1e94de0203b | entry/src/main/ets/api/FeedbackInfoApi.type.ets | arkts | 添加反馈接口入参 | export interface FeedbackContentAddParam {
/**
* 反馈内容
*/
content: string
} | AST#export_declaration#Left export AST#interface_declaration#Left interface FeedbackContentAddParam AST#object_type#Left { /**
* 反馈内容
*/ AST#type_member#Left content : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right } AST#object_type#Rig... | export interface FeedbackContentAddParam {
content: string
} | https://github.com/xt1314520/IbestKnowTeach/blob/61f0a7a3d328ad5a52de8fd699b9e1e94de0203b/entry/src/main/ets/api/FeedbackInfoApi.type.ets#L4-L9 | 0238b24adb33533004f7dbf504acebb4ccabea4b | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets | arkts | onRegionFieldClick | 点击地区选择入口
@returns {void} 无返回值 | onRegionFieldClick(): void {
this.isRegionPickerVisible = true;
} | AST#method_declaration#Left onRegionFieldClick AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST... | onRegionFieldClick(): void {
this.isRegionPickerVisible = true;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets#L200-L202 | 720cb5e842f9f0ccd8395339ee865c558455a427 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.