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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Active-hue/ArkTS-Accounting.git | c432916d305b407557f08e35017c3fd70668e441 | entry/src/main/ets/pages/Main.ets | arkts | DatePickerDialog | 年月选择器弹窗 | @Builder
DatePickerDialog() {
Stack() {
// 半透明背景遮罩
Column()
.width('100%')
.height('100%')
.backgroundColor('rgba(0, 0, 0, 0.5)')
.onClick(() => {
this.showDatePicker = false; // 点击遮罩关闭
})
// 日期选择器内容
Column() {
// 年份和月份选择器
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right DatePickerDialog 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 Stack ( ) AST#container_content_body#Left { // 半透明背景遮罩 AS... | @Builder
DatePickerDialog() {
Stack() {
Column()
.width('100%')
.height('100%')
.backgroundColor('rgba(0, 0, 0, 0.5)')
.onClick(() => {
this.showDatePicker = false;
})
Column() {
Row() {
Colum... | https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/Main.ets#L1726-L1827 | f66e3e8cec2ab7e5a9c895940cf707e9c27345b1 | github |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/components/InfoItemView.ets | arkts | InfoItemView | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Component
export struct InfoItemView {
private name: string | Resource = '';
private value: string | Resource = '';
build() {
Row() {
Text(this.name)
.fontSize(16)
.lineHeight(22)
.fontWeight(FontWeight.Medium)
.fontFamily('HarmonyHeiTi')
.fontColor($r('sys.colo... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct InfoItemView AST#component_body#Left { AST#property_declaration#Left private name : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST... | @Component
export struct InfoItemView {
private name: string | Resource = '';
private value: string | Resource = '';
build() {
Row() {
Text(this.name)
.fontSize(16)
.lineHeight(22)
.fontWeight(FontWeight.Medium)
.fontFamily('HarmonyHeiTi')
.fontColor($r('sys.colo... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/components/InfoItemView.ets#L16-L47 | 0c6506b1ade049bb1e0e329198a783e6489631e4 | gitee |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | HCIA/demoCollect/startAbility/example/Wechat/entry/src/main/ets/pages/Index.ets | arkts | openLinkQQApplication | 拉起方应用使用 openLink 实现应用跳转 启动 QQApplication | openLinkQQApplication(){
let context:common.UIAbilityContext =this.getUIContext().getHostContext() as common.UIAbilityContext;
let link:string = "http://www.dxin.com/qq"
let openLinkOptions:OpenLinkOptions ={
appLinkingOnly:false
}
context.openLink(link,openLinkOptions)
.then(() => {
... | AST#method_declaration#Left openLinkQQApplication AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext A... | openLinkQQApplication(){
let context:common.UIAbilityContext =this.getUIContext().getHostContext() as common.UIAbilityContext;
let link:string = "http://www.dxin.com/qq"
let openLinkOptions:OpenLinkOptions ={
appLinkingOnly:false
}
context.openLink(link,openLinkOptions)
.then(() => {
... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/demoCollect/startAbility/example/Wechat/entry/src/main/ets/pages/Index.ets#L118-L131 | c50ff2c0551b1b2359ed4dcea420f61665cd6dbc | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.GridObjectSortComponent.d.ets | arkts | GridObjectSortComponent | Declare struct GridObjectSortComponent.
@struct { GridObjectSortComponent }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@since 11
Declare struct GridObjectSortComponent.
@struct { GridObjectSortComponent }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12
@noninterop | @Component
export declare struct GridObjectSortComponent {
/**
* Component types and parameters of the GridObjectSortComponent.
* @type { GridObjectSortComponentOptions }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Component types and parameters of the Gri... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct GridObjectSortComponent AST#component_body#Left { /**
* Component types and parameters of the GridObjectSortComponent.
* @type { GridObjectSortComponentOptions }
* @sysc... | @Component
export declare struct GridObjectSortComponent {
@Prop
options: GridObjectSortComponentOptions;
dataList: Array<GridObjectSortComponentItem>;
onSave: (select: Array<GridObjectSortComponentItem>, unselect: Array<GridObjectSortComponentItem>) => void;
onCancel: () => voi... | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.GridObjectSortComponent.d.ets#L319-L404 | 49c27de0639ce131848bea9e8edcfd34c6474f8e | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/structures/PermissionOverwrites.ets | arkts | delete | Delete this Permission Overwrite.
@param reason Reason for deleting this overwrite
约束45:需要显式标注返回类型 | delete(reason?: string): Promise<PermissionOverwrites> {
// 约束1:需替换any为具体类型
return this.channel.client.rest.methods.deletePermissionOverwrites(this, reason);
} | AST#method_declaration#Left delete AST#parameter_list#Left ( AST#parameter#Left reason ? : 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 Promise ... | delete(reason?: string): Promise<PermissionOverwrites> {
return this.channel.client.rest.methods.deletePermissionOverwrites(this, reason);
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/PermissionOverwrites.ets#L51-L54 | c4f714d1980b2e8d541fc259038b4e5f6d4b923d | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/function_call/library_function/map_lib_func_010_F.ets | arkts | Introduction 库函数-map_keys | export function map_lib_func_010_F(taint_src : string) {
let map = new Map<string,string>();
map.set("_","t");
map.set("tt","a");
taint.Sink(map.keys());
} | AST#export_declaration#Left export AST#function_declaration#Left function map_lib_func_010_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#... | export function map_lib_func_010_F(taint_src : string) {
let map = new Map<string,string>();
map.set("_","t");
map.set("tt","a");
taint.Sink(map.keys());
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/library_function/map_lib_func_010_F.ets#L7-L12 | 5bf87d6b12dfb3763833b990a0c2d0a136eb406a | github | |
iotjin/JhHarmonyDemo.git | 819e6c3b1db9984c042a181967784550e171b2e8 | JhCommon/src/main/ets/JhCommon/components/JhDialog.ets | arkts | showAllCustomDialog | 完全自定义弹框,默认底部弹出,高度260
@param builder
@param options 可不传
@returns | public static showAllCustomDialog(builder: WrappedBuilder<[JhCustomOptions]>, options?: JhCustomOptions): string {
let custom: JhCustomOptions = {
width: options?.width ?? '100%',
height: options?.height ?? 260,
alignment: options?.alignment ?? DialogAlignment.Bottom,
offset: options?.offset... | AST#method_declaration#Left public static showAllCustomDialog AST#parameter_list#Left ( AST#parameter#Left builder : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left WrappedBuilder AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#tuple_type#Left [ AST#type_annotation#Left... | public static showAllCustomDialog(builder: WrappedBuilder<[JhCustomOptions]>, options?: JhCustomOptions): string {
let custom: JhCustomOptions = {
width: options?.width ?? '100%',
height: options?.height ?? 260,
alignment: options?.alignment ?? DialogAlignment.Bottom,
offset: options?.offset... | https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhDialog.ets#L330-L341 | c37789605b11d92e175a0c5b1942d53457891d8b | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/constants/LayoutPercent.ets | arkts | 100% 百分比 | export const P100: string = "100%"; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left P100 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "100%" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Rig... | export const P100: string = "100%"; | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/constants/LayoutPercent.ets#L109-L109 | 8a802368019ca5c389571963563ace6a1d10ab4c | github | |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/expression/type_cast/type_cast_002_F.ets | arkts | Introduction 类型转换 | export function type_cast_002_F(taint_src : string) {
let _t = taint_src;
let clean = Number("_");
taint.Sink(clean);
} | AST#export_declaration#Left export AST#function_declaration#Left function type_cast_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#Lef... | export function type_cast_002_F(taint_src : string) {
let _t = taint_src;
let clean = Number("_");
taint.Sink(clean);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/expression/type_cast/type_cast_002_F.ets#L6-L10 | c0c28603edb16d394ee92085bb577ea794392c01 | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/view/MePage.ets | arkts | MePage | @file 我的页面视图
@author Joker.X | @ComponentV2
export struct MePage {
/**
* 我的页面 ViewModel
*/
@Local
private vm: MeViewModel = new MeViewModel();
/**
* 当前窗口安全区状态
*/
@Local
private windowSafeAreaState: WindowSafeAreaState = getWindowSafeAreaState();
/**
* 全局用户状态
*/
@Local
private userState: UserState = getUserState();... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct MePage AST#component_body#Left { /**
* 我的页面 ViewModel
*/ AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right private vm : AST#type_annotation#Left AST#primary_type#Left MeViewModel AST... | @ComponentV2
export struct MePage {
@Local
private vm: MeViewModel = new MeViewModel();
@Local
private windowSafeAreaState: WindowSafeAreaState = getWindowSafeAreaState();
@Local
private userState: UserState = getUserState();
@Param
currentPageIndex: number = 0
@Monitor('currentPageInd... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/view/MePage.ets#L34-L483 | de277e9508e6ee91c0b54fbefc40fb7e68f7d884 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/model/src/main/ets/request/CreateOrderRequest.ets | arkts | @param {CreateOrderRequestInit} init - 初始化数据 | constructor(init: CreateOrderRequestInit) {
this.data = new CreateOrder(init.data);
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left init : AST#type_annotation#Left AST#primary_type#Left CreateOrderRequestInit AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#express... | constructor(init: CreateOrderRequestInit) {
this.data = new CreateOrder(init.data);
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/request/CreateOrderRequest.ets#L53-L55 | 2190fd4fb42b36f836a3060f9a9c8034e483211b | github | |
huaweicloud/huaweicloud-iot-device-sdk-arkts.git | 72954bea19e7e7f93567487b036c0664457bdaf3 | huaweicloud_iot_device_library/src/main/ets/service/AbstractDevice.ets | arkts | onCommand | 命令回调函数,由SDK自动调用
@param requestId 请求id
@param command 命令 | public onCommand(requestId: string, command: Command): void {
const service = this.getService(command.service_id);
if (service !== null && service !== undefined) {
const rsp = service.onCommand(command);
this.client.respondCommand(requestId, rsp);
return;
}
this.client?.respondComman... | AST#method_declaration#Left public onCommand AST#parameter_list#Left ( AST#parameter#Left requestId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left command : AST#type_annotation#Left AST#primary_type#Left Command AST#prima... | public onCommand(requestId: string, command: Command): void {
const service = this.getService(command.service_id);
if (service !== null && service !== undefined) {
const rsp = service.onCommand(command);
this.client.respondCommand(requestId, rsp);
return;
}
this.client?.respondComman... | https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts.git/blob/72954bea19e7e7f93567487b036c0664457bdaf3/huaweicloud_iot_device_library/src/main/ets/service/AbstractDevice.ets#L116-L126 | 6f039379d832111c2d9b8277657922795485916e | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/utils/CheckEmptyUtils.ets | arkts | isEmptyArr | Check array is empty.
@param {Array} arr An array to check if is empty.
@return {boolean} true(empty) | isEmptyArr<T>(arr: T[]): boolean {
return arr == undefined || arr == null || arr.length == 0
} | AST#method_declaration#Left isEmptyArr AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left arr : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left T [ ] AST#array_type#Right AST#primary_type#Right AST#typ... | isEmptyArr<T>(arr: T[]): boolean {
return arr == undefined || arr == null || arr.length == 0
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/utils/CheckEmptyUtils.ets#L44-L46 | a8fbd9ce2595fa6dd69d58e7127e34ee49ade7c5 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/data/src/main/ets/repository/OrderRepository.ets | arkts | 构造函数
@param networkDataSource 可选的数据源实例,便于测试注入 | constructor(networkDataSource?: OrderNetworkDataSource) {
this.networkDataSource = networkDataSource ?? new OrderNetworkDataSourceImpl();
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left networkDataSource ? : AST#type_annotation#Left AST#primary_type#Left OrderNetworkDataSource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#L... | constructor(networkDataSource?: OrderNetworkDataSource) {
this.networkDataSource = networkDataSource ?? new OrderNetworkDataSourceImpl();
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/OrderRepository.ets#L29-L31 | 65f4a29cdc1a1f30e2846c5b6f07f3c6744b3bc2 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/imagecomment/src/main/ets/components/view/ImageListView.ets | arkts | ImageListView | 评论中显示图片的组件 | @Component
export struct ImageListView {
// 图片列表
@State selectedImages: ResourceStr[] = [];
// 是否可以删除列表中的图片
imageEnableDelete: boolean = false;
build() {
List({ space: 10 }) {
ForEach(this.selectedImages, (image: string, index: number) => {
ListItem() {
RelativeContainer() {
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ImageListView AST#component_body#Left { // 图片列表 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right selectedImages : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Resource... | @Component
export struct ImageListView {
@State selectedImages: ResourceStr[] = [];
imageEnableDelete: boolean = false;
build() {
List({ space: 10 }) {
ForEach(this.selectedImages, (image: string, index: number) => {
ListItem() {
RelativeContainer() {
Image(image)
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagecomment/src/main/ets/components/view/ImageListView.ets#L20-L72 | 274efb7836f9ad410e9fcd8df45afa9643334fe7 | gitee |
tomorrowKreswell/Ledger.git | 1f2783ae70b8540d677af8a27f29db1b4089ea69 | ledger/entry/src/main/ets/pages/MainPage.ets | arkts | filterAccounts | 过滤账单列表 | filterAccounts() {
let temp = this.accounts;
// 模糊查询
if (this.searchText && this.searchText != '') {
temp = temp.filter(account =>
account.desc.includes(this.searchText) ||
account.typeText.includes(this.searchText) ||
account.amount.toString() === this.searchText
);
}
... | AST#method_declaration#Left filterAccounts AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left temp = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . accounts AST#... | filterAccounts() {
let temp = this.accounts;
if (this.searchText && this.searchText != '') {
temp = temp.filter(account =>
account.desc.includes(this.searchText) ||
account.typeText.includes(this.searchText) ||
account.amount.toString() === this.searchText
);
}
... | https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/pages/MainPage.ets#L52-L71 | 0b54065e49279188b4c12d8355abb8161748ea3d | github |
openharmony/graphic_graphic_2d | 46a11e91c9709942196ad2a7afea2e0fcd1349f3 | interfaces/kits/ani/drawing/ets/@ohos.graphics.drawing.ets | arkts | Provides an interface to the drawing, and describe the arguments for a font.
@syscap SystemCapability.Graphics.Drawing
@crossplatform
@since 20 | export class TypefaceArguments {
static { loadLibraryWithPermissionCheck("drawing_ani_core", "@ohos.graphics.drawing"); } | AST#export_declaration#Left export AST#class_declaration#Left class TypefaceArguments AST#ERROR#Left { static AST#ERROR#Right AST#class_body#Left { AST#method_declaration#Left loadLibraryWithPermissionCheck AST#parameter_list#Left ( AST#ERROR#Left "drawing_ani_core" , "@ohos.graphics.drawing" AST#ERROR#Right ) AST#para... | export class TypefaceArguments {
static { loadLibraryWithPermissionCheck("drawing_ani_core", "@ohos.graphics.drawing"); } | https://github.com/openharmony/graphic_graphic_2d/blob/46a11e91c9709942196ad2a7afea2e0fcd1349f3/interfaces/kits/ani/drawing/ets/@ohos.graphics.drawing.ets#L1309-L1310 | fb5ad41f20c296db26f93ff1cc03b3dc83c3548c | gitee | |
Rayawa/dashboard.git | 9107efe7fb69a58d799a378b79ea8ffa4041cec8 | entry/src/main/ets/common/got.ets | arkts | 创建默认实例 | export const got = new Got(); | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left got = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Got AST#expression#Right AST#new_expression#Right AST#expression#Right AST#argument_list#Left ( ) AST... | export const got = new Got(); | https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/common/got.ets#L383-L383 | 5286aa3266d50542f33a467445d6095e877eb0cc | github | |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildChannelsPositionUpdate.ets | arkts | handle | 应用约束1: 为client添加明确类型声明(假设Client类型已定义) | handle(data: Data): { guild: Guild | undefined } {
const client = this.client;
// 应用约束1: 为guild添加类型声明
const guild: Guild | undefined = client.guilds.get(data.guild_id);
if (guild) {
// 应用约束1: 为partialChannel添加类型声明
for (const partialChannel of data.channels) {
... | AST#method_declaration#Left handle AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Data AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left : AST#ERROR#Right AST#block_statement#Left { AST#statement#Left AST#ex... | handle(data: Data): { guild: Guild | undefined } {
const client = this.client;
const guild: Guild | undefined = client.guilds.get(data.guild_id);
if (guild) {
for (const partialChannel of data.channels) {
const channel: Channel | undefined = gui... | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildChannelsPositionUpdate.ets#L25-L39 | 6a832ce6f4dc8f743597cc6537ab1a4a18042567 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/DESSync.ets | arkts | encodeECB | 加密-ECB模式
@param str 待加密的字符串
@param desKey 3DES密钥
@param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式
@param resultCoding 加密后数据的编码方式(hex/base64)-不传默认为base64
@returns | static encodeECB(str: string, desKey: string, keyCoding: buffer.BufferEncoding,
resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil.encodeECB(str, desKey, '3DES192', '3DES192|ECB|PKCS7', 192, keyCoding, resultCoding);
} | AST#method_declaration#Left static encodeECB 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 desKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#... | static encodeECB(str: string, desKey: string, keyCoding: buffer.BufferEncoding,
resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil.encodeECB(str, desKey, '3DES192', '3DES192|ECB|PKCS7', 192, keyCoding, resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/DESSync.ets#L46-L49 | 8ce27a321545be99e75f20ba6086bd20a09f9b06 | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.ArcButton.d.ets | arkts | Defines an arc button status.
@enum { number }
@syscap SystemCapability.ArkUI.ArkUI.Circle
@crossplatform
@atomicservice
@since 18 | export declare enum ArcButtonStatus {
/**
* Normal state.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
NORMAL = 0,
/**
* Pressed state.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ArcButtonStatus AST#enum_body#Left { /**
* Normal state.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/ AST#enum_member#Left NORMA... | export declare enum ArcButtonStatus {
NORMAL = 0,
PRESSED = 1,
DISABLED = 2
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ArcButton.d.ets#L120-L148 | 5a5b0f1fa628056cb138c50eec5b3962951611da | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/view/MePage.ets | arkts | buildUserPhoneLine | 构建用户手机号/登录提示
@returns {void} 无返回值 | @Builder
private buildUserPhoneLine(): void {
if (this.hasPhone()) {
RowStartCenter() {
Text($r("app.string.phone_number"))
.fontSize($r("app.float.body_medium"))
.fontColor($r("app.color.text_tertiary"));
Text(":")
.fontSize($r("app.float.body_medium"))
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private buildUserPhoneLine 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 AS... | @Builder
private buildUserPhoneLine(): void {
if (this.hasPhone()) {
RowStartCenter() {
Text($r("app.string.phone_number"))
.fontSize($r("app.float.body_medium"))
.fontColor($r("app.color.text_tertiary"));
Text(":")
.fontSize($r("app.float.body_medium"))
... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/view/MePage.ets#L177-L200 | e22d5d44902f76b6642ad657cafa330b52286d12 | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.ComposeListItem.d.ets | arkts | Declare type OperateCheck
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Declare type OperateCheck
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11
Declare type OperateCheck
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 20 | export declare class OperateCheck {
/**
* Whether is checked on default.
* @type { ?boolean }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Whether is checked on default.
* @type { ?boolean }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class OperateCheck AST#class_body#Left { /**
* Whether is checked on default.
* @type { ?boolean }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/ /**
* Whether is checked on default.
* ... | export declare class OperateCheck {
isCheck?: boolean;
onChange?: (value: boolean) => void;
accessibilityText?: ResourceStr;
accessibilityDescription?: ResourceStr;
accessibilityLevel?: string;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ComposeListItem.d.ets#L359-L464 | 05341aa4e9b682ad024f78f601e5827749544e35 | gitee | |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamPage.ets | arkts | navigateToEditDream | 点击梦想卡片,进入编辑页面 | navigateToEditDream(dreamId: number | undefined) {
if (dreamId === undefined) {
console.error('梦想ID为undefined,无法导航到编辑页面');
return;
}
router.pushUrl({
url: 'pages/dream/DreamEditPage',
params: {
dreamId: dreamId
}
});
} | AST#method_declaration#Left navigateToEditDream AST#parameter_list#Left ( AST#parameter#Left dreamId : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Ri... | navigateToEditDream(dreamId: number | undefined) {
if (dreamId === undefined) {
console.error('梦想ID为undefined,无法导航到编辑页面');
return;
}
router.pushUrl({
url: 'pages/dream/DreamEditPage',
params: {
dreamId: dreamId
}
});
} | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamPage.ets#L110-L122 | 5173c9c0d1bb10c986c16f2ee2ac8031377dbe7a | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/CommonTypes.ets | arkts | 回调函数类型 | export type Callback<T = void> = (result: T) => void; | AST#export_declaration#Left export AST#type_declaration#Left type Callback AST#type_parameters#Left < AST#type_parameter#Left T = AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right = AST#type_annotation#Left AST#funct... | export type Callback<T = void> = (result: T) => void; | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/CommonTypes.ets#L253-L253 | 793a23477b341dc17471d85e2d4c237393678438 | github | |
zeroone001/harmonyAPP.git | 49c8fa1b56de89cb7513b25f3b1b753ba857968a | features/quickstart/src/main/ets/model/BannerClass.ets | arkts | export class BannerClass { id: string = ''; imageSrc: ResourceStr = ''; url: string = ''; constructor(id: string, imageSrc: ResourceStr, url: string) { this.id = id; this.imageSrc = imageSrc; this.url = url; } } | export interface BannerClass {
id: string;
url: string;
imageSrc: string
} | AST#export_declaration#Left export AST#interface_declaration#Left interface BannerClass AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left url : AST#type_annotation#Left AST#... | export interface BannerClass {
id: string;
url: string;
imageSrc: string
} | https://github.com/zeroone001/harmonyAPP.git/blob/49c8fa1b56de89cb7513b25f3b1b753ba857968a/features/quickstart/src/main/ets/model/BannerClass.ets#L12-L16 | fa3413cd4965421782b3fab1f2bffb25ef51fde0 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/VirtualEconomyService.ets | arkts | 商店类别接口 | export interface ShopCategory {
id: string;
name: string;
description: string;
icon: string;
sortOrder: number;
items: VirtualItem[];
isActive: boolean;
specialOffer?: SpecialOffer;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ShopCategory AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#Left AS... | export interface ShopCategory {
id: string;
name: string;
description: string;
icon: string;
sortOrder: number;
items: VirtualItem[];
isActive: boolean;
specialOffer?: SpecialOffer;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/VirtualEconomyService.ets#L100-L109 | d1ec2dd7dcd5c42ce8eb7877a681918edcc7f758 | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.SubHeaderV2.d.ets | arkts | Control style of operation element
@enum { number }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 18 | export declare enum SubHeaderV2OperationType {
/**
* The TextArrow style.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 18
*/
TEXT_ARROW = 0,
/**
* The Button style.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum SubHeaderV2OperationType AST#enum_body#Left { /**
* The TextArrow style.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 18
*/ AST#enum_member#Left TEXT_ARROW... | export declare enum SubHeaderV2OperationType {
TEXT_ARROW = 0,
BUTTON = 1,
ICON_GROUP = 2,
LOADING = 3
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.SubHeaderV2.d.ets#L310-L343 | c02e6ff269ea0ae5498de157eac5b938c8254ef2 | gitee | |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_uicontext/ace_ets_module_uicontext_api13/entry/src/main/ets/MainAbility/common/Log.ets | arkts | Basic log class | export default class Log {
/**
* print info level log
*
* @param {string} tag - Page or class tag
* @param {string} log - Log needs to be printed
*/
static showInfo(tag: string, log: string){
console.info(`${TAG} tag: ${tag} --> ${log}`);
}
/**
* print debug level log
*
* @param {st... | AST#export_declaration#Left export default AST#class_declaration#Left class Log AST#class_body#Left { /**
* print info level log
*
* @param {string} tag - Page or class tag
* @param {string} log - Log needs to be printed
*/ AST#method_declaration#Left static showInfo AST#parameter_list#Left ( AST#paramet... | export default class Log {
static showInfo(tag: string, log: string){
console.info(`${TAG} tag: ${tag} --> ${log}`);
}
static showDebug(tag: string, log: string){
console.debug(`${TAG} tag: ${tag} --> ${log}`);
}
static showError(tag: string, log: string){
console.error(`${TAG} tag: ${t... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_uicontext/ace_ets_module_uicontext_api13/entry/src/main/ets/MainAbility/common/Log.ets#L21-L51 | a792002ffcb3c59d1c6ede6c3aa8b96301014b3a | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/SecondaryLinkExample.ets | arkts | SecondaryLinkExample | 每个TAG对应多少个元素
功能描述: 本示例主要介绍了List组件实现二级联动(Cascading List)的场景
推荐场景: 需要使用多级列表联合滚动的场景,如:外卖点单页面等
核心组件:
1. SecondaryLinkExample.tagListItemBuilder
实现步骤:
1. 一二级列表分别绑定不同的Scroller对象,一级列表(tagLists)绑定classifyScroller对象,二级列表绑定scroller对象
2. 点击一级列表后,通过一级列表的索引获取二级列表的索引,调用scrollToIndex方法将一二级列表滚动到指定索引值
3. 滑动二级列表触发组件滚动事件后,获取到列表可视区域第一... | @Component
export struct SecondaryLinkExample {
private tagIndexPosition: ListIndexPosition = { start: 0, end: 0 } as ListIndexPosition; // 一级列表可视区域的起始索引和终点索引 初始化失败
@State @Watch('onIndexChange') currentTagIndex: number = 0; // 一级列表焦点索引值
private tagLists: Array<string> = new Array<string>(); // 一级列表数据
@State c... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct SecondaryLinkExample AST#component_body#Left { AST#property_declaration#Left private tagIndexPosition : AST#type_annotation#Left AST#primary_type#Left ListIndexPosition AST#primary_type#Right AST#type_annotation#Right... | @Component
export struct SecondaryLinkExample {
private tagIndexPosition: ListIndexPosition = { start: 0, end: 0 } as ListIndexPosition;
@State @Watch('onIndexChange') currentTagIndex: number = 0;
private tagLists: Array<string> = new Array<string>();
@State contentData: MyDataSource = new MyDataSource();
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/SecondaryLinkExample.ets#L93-L307 | 89ba3f1bdc5beea9d65447b15043c41088b4c413 | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/RegexUtils.ets | arkts | isEmoji | 判断字符串是否包含表情(匹配单个emoji或多个组合emoji的正则表达式)
注意:这个正则表达式可能不是完美的,因为新的emoji不断被添加到Unicode标准中
@param content
@returns | static isEmoji(content: string): boolean {
return RegexUtils.isMatch(content, RegexUtils.REG_EMOJI);
} | AST#method_declaration#Left static isEmoji AST#parameter_list#Left ( AST#parameter#Left content : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_typ... | static isEmoji(content: string): boolean {
return RegexUtils.isMatch(content, RegexUtils.REG_EMOJI);
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/RegexUtils.ets#L232-L234 | 5019bd0e8de3664834a403d71cbd8a0f8f408762 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/pendingitems/src/main/ets/model/ToDo.ets | arkts | 创建一个新的待办事项实例。
@param {string} name - 待办事项名称 | constructor(name: string) {
this.name = name;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Le... | constructor(name: string) {
this.name = name;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pendingitems/src/main/ets/model/ToDo.ets#L32-L34 | f0ff175e15d2b3ecec483a2d67f620b82ae4fb3d | gitee | |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets | arkts | prop | Called when a property is set.
@since 10 | static prop<T>(propName: string): SubscribedAbstractProperty<T> | undefined {
return StorageMap.shared.prop<T>(propName)
} | AST#method_declaration#Left static prop AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#R... | static prop<T>(propName: string): SubscribedAbstractProperty<T> | undefined {
return StorageMap.shared.prop<T>(propName)
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L92-L94 | 7879a06fd8d364450c1950d047192ec2788154d8 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/effectkit/Index.ets | arkts | MainPageComponent | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export { MainPageComponent } from './src/main/ets/components/mainpage/MainPage'; | AST#export_declaration#Left export { MainPageComponent } from './src/main/ets/components/mainpage/MainPage' ; AST#export_declaration#Right | export { MainPageComponent } from './src/main/ets/components/mainpage/MainPage'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/effectkit/Index.ets#L15-L15 | 37f18b95b7d139c5de5944b38c59cfec709340a0 | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/utils/DateUtil.ets | arkts | isWeekend | 判断指定的日期在日历中是否为周末
@param date
@returns | static isWeekend(date?: number | string | Date) {
date = DateUtil.getFormatDate(date);
let calendar: i18n.Calendar = i18n.getCalendar("zh-Hans");
calendar.setTime(date);
return calendar.isWeekend(date);
} | AST#method_declaration#Left static isWeekend AST#parameter_list#Left ( AST#parameter#Left date ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Date AST#primary_type#Right AST#union_type#Rig... | static isWeekend(date?: number | string | Date) {
date = DateUtil.getFormatDate(date);
let calendar: i18n.Calendar = i18n.getCalendar("zh-Hans");
calendar.setTime(date);
return calendar.isWeekend(date);
} | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/utils/DateUtil.ets#L254-L259 | d6f9bf9abadbadaac88e6f4cb2393dfc7283b8e6 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/member/MemberManager.ets | arkts | get | ============================================================ MARK: - 是否可以下载离线数据 | get canDownloadOffLineData(): boolean {
return this.isActive
} | AST#method_declaration#Left get AST#ERROR#Left canDownloadOffLineData 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 ret... | get canDownloadOffLineData(): boolean {
return this.isActive
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/member/MemberManager.ets#L180-L182 | 88a00555dae70acd6722ec5f9c8b445aa465919f | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/voice/opus/OpusEngineList.ets | arkts | 应用约束61:使用ES模块导出 | export function add(encoder: new (options: Object) => Object): void {
list.push(encoder);
} | AST#export_declaration#Left export AST#function_declaration#Left function add AST#parameter_list#Left ( AST#parameter#Left encoder : AST#ERROR#Left new AST#ERROR#Right AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left Ob... | export function add(encoder: new (options: Object) => Object): void {
list.push(encoder);
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/voice/opus/OpusEngineList.ets#L26-L28 | 7a2689f2479214009c5b42d0d4b254f26eeaf067 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plancurve/Piece.ets | arkts | MARK: - Piece 类定义
片段 | export class Piece {
// MARK: - 私有属性
/**
* 第几个piece
*/
private _pieceNo: number;
/**
* 每个piece中的wordId
*/
private _wordIds: number[];
// MARK: - Getter 方法
/**
* 获取piece编号
*/
get pieceNo(): number {
return this._pieceNo;
}
/**
* 获取wordIds数组
*/
get wordIds(): number[... | AST#export_declaration#Left export AST#class_declaration#Left class Piece AST#class_body#Left { // MARK: - 私有属性 /**
* 第几个piece
*/ AST#property_declaration#Left private _pieceNo : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right... | export class Piece {
private _pieceNo: number;
private _wordIds: number[];
get pieceNo(): number {
return this._pieceNo;
}
get wordIds(): number[] {
return this._wordIds;
}
constructor(pieceNo: number, wordIds: number[]) {
this._pieceNo = pieceNo;
this._wordI... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Piece.ets#L7-L129 | 14e56c30739e8456ef83c7fa73f064dbf1e1c684 | github | |
dcm23333/FishManager.git | 952dde4475268ac16f3480f3d55f82033aa6b467 | FishManager/entry/src/main/ets/common/contants/commonContants.ets | arkts | ‘40%’ | export const THOUSANDTH_420: string = '42%'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left THOUSANDTH_420 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '42%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declar... | export const THOUSANDTH_420: string = '42%'; | https://github.com/dcm23333/FishManager.git/blob/952dde4475268ac16f3480f3d55f82033aa6b467/FishManager/entry/src/main/ets/common/contants/commonContants.ets#L55-L55 | bde0917a91a235929256f76e9e641fb8941a9669 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Sounds/Cloud/Download/CMetaInfo_CFile/CMetaInfoManager.ets | arkts | getUpdateDateFromSavedMeta | / 获取 Meta 信息中的更新时间 | public async getUpdateDateFromSavedMeta(info: CMetaInfo): Promise<string | null> {
if (!info.fileName) return null;
const context = getContext(this);
const prefs = await preferences.getPreferences(context, this.prefName);
const value = await prefs.get(info.fileName, null);
if (typeof value ===... | AST#method_declaration#Left public async getUpdateDateFromSavedMeta AST#parameter_list#Left ( AST#parameter#Left info : AST#type_annotation#Left AST#primary_type#Left CMetaInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Lef... | public async getUpdateDateFromSavedMeta(info: CMetaInfo): Promise<string | null> {
if (!info.fileName) return null;
const context = getContext(this);
const prefs = await preferences.getPreferences(context, this.prefName);
const value = await prefs.get(info.fileName, null);
if (typeof value ===... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Download/CMetaInfo_CFile/CMetaInfoManager.ets#L74-L86 | 303873d519f02eda3b4241699296c7ca5599ddfc | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/SHA1.ets | arkts | hash | bits per input character. 8 - ASCII; 16 - Unicode
散列哈希算法
@param value
@returns | static hash(value: string): string {
let hash = new SHA1();
return hash.hex_sha1(value);
} | AST#method_declaration#Left static hash 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#type_annotation#Left AST#primary_type#Left string AST#primary_type#Righ... | static hash(value: string): string {
let hash = new SHA1();
return hash.hex_sha1(value);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/SHA1.ets#L36-L39 | 835282be955a3e71495f98e2e30030fcf60674cc | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/voice/opus/BaseOpusEngine.ets | arkts | 使用ES模块导出(约束60) | export default BaseOpus; | AST#export_declaration#Left export default AST#expression#Left BaseOpus AST#expression#Right ; AST#export_declaration#Right | export default BaseOpus; | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/voice/opus/BaseOpusEngine.ets#L80-L80 | 5b046f9b4c8f29b1ef14137f951903abda2f1a3d | github | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Legend.ets | arkts | getMaximumEntryHeight | returns the maximum height in pixels across all legend labels
@param p the paint object used for rendering the text
@return | public getMaximumEntryHeight(p: Paint): number {
var max: number = 0;
for (let entry of this.mEntries) {
var label: string = entry.label;
if (label == null) {
continue;
}
var length: number = Utils.calcTextHeight(p, label);
if (length > max) {
max = length;
... | AST#method_declaration#Left public getMaximumEntryHeight AST#parameter_list#Left ( AST#parameter#Left p : AST#type_annotation#Left AST#primary_type#Left Paint 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#prima... | public getMaximumEntryHeight(p: Paint): number {
var max: number = 0;
for (let entry of this.mEntries) {
var label: string = entry.label;
if (label == null) {
continue;
}
var length: number = Utils.calcTextHeight(p, label);
if (length > max) {
max = length;
... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Legend.ets#L194-L211 | 2285e88fc7d0f0783de9aa4647bc105b8e44d936 | gitee |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/pages/auth/LoginPage.ets | arkts | navigateToRegister | 跳转到注册页面 | navigateToRegister() {
router.pushUrl({
url: 'pages/auth/RegisterPage'
});
} | AST#method_declaration#Left navigateToRegister 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 router AST#expression#Right . pushUrl AST#mem... | navigateToRegister() {
router.pushUrl({
url: 'pages/auth/RegisterPage'
});
} | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/auth/LoginPage.ets#L168-L172 | b6ace59373c16396efbe2cb282ca4cbbc35c9701 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/expandtitle/src/main/ets/utils/TitleExpansion.ets | arkts | getTitleTranslateOptions | 获取标题展开时,继续下拉的标题栏Translate参数
@returns {TranslateOptions} 标题展开后继续下拉的标题栏Translate参数 | getTitleTranslateOptions(): TranslateOptions {
return {y: Math.max(-this.curOffset, 0)};
} | AST#method_declaration#Left getTitleTranslateOptions AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left TranslateOptions AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left ... | getTitleTranslateOptions(): TranslateOptions {
return {y: Math.max(-this.curOffset, 0)};
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/expandtitle/src/main/ets/utils/TitleExpansion.ets#L194-L196 | 9e5c552ceed814606c8d1f73774d589d20e6fb2c | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/MouseManagerUtil.ets | arkts | 设置鼠标指针样式
@param style 样式 | export function setPointerStyle(style: pointer.PointerStyle): void {
let context = getContext() as common.UIAbilityContext;
window.getLastWindow(context, (error, win) => {
if (error.code) {
logger.error(`${TAG} Failed to obtain the top window. Cause: ${JSON.stringify(error)}`)
return
}
let w... | AST#export_declaration#Left export AST#function_declaration#Left function setPointerStyle AST#parameter_list#Left ( AST#parameter#Left style : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left pointer . PointerStyle AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#param... | export function setPointerStyle(style: pointer.PointerStyle): void {
let context = getContext() as common.UIAbilityContext;
window.getLastWindow(context, (error, win) => {
if (error.code) {
logger.error(`${TAG} Failed to obtain the top window. Cause: ${JSON.stringify(error)}`)
return
}
let w... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/MouseManagerUtil.ets#L79-L99 | fe549e0a5ab346055449c16b0fdfef24ae9b3796 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/AIAssistantService.ets | arkts | loadAIConfig | 加载AI配置 | private async loadAIConfig(): Promise<void> {
try {
if (!this.preferences) return;
const savedConfig = await this.preferences.get('ai_config', JSON.stringify(this.aiConfig)) as string;
this.aiConfig = JSON.parse(savedConfig);
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogCon... | AST#method_declaration#Left private async loadAIConfig 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 loadAIConfig(): Promise<void> {
try {
if (!this.preferences) return;
const savedConfig = await this.preferences.get('ai_config', JSON.stringify(this.aiConfig)) as string;
this.aiConfig = JSON.parse(savedConfig);
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogCon... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/AIAssistantService.ets#L542-L551 | 0b04cadff3dad0c1f62516aff91f214aca47c124 | github |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/AppUtils.ets | arkts | getInstallTime | 获取应用包安装时间。
@returns | static getInstallTime(): number {
return AppUtils.getBundleInfoSync().installTime
} | AST#method_declaration#Left static getInstallTime 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_ex... | static getInstallTime(): number {
return AppUtils.getBundleInfoSync().installTime
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/AppUtils.ets#L150-L152 | d71136cec74bc7ca9bb01f11e4315f90d284bfdb | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.util.d.ets | arkts | isMapIterator | Check whether the entered value is the iterator type of map.
@param { Object } value - A Map iterator value
@returns { boolean } Returns true if the value is an iterator returned for a built-in Map instance.
@syscap SystemCapability.Utils.Lang
@crossplatform
@atomicservice
@since 20 | isMapIterator(value: Object): boolean; | AST#method_declaration#Left isMapIterator AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#R... | isMapIterator(value: Object): boolean; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1279-L1279 | a2ee10c9f2c9a0dab56b89a6ba94fb37eeb0475f | gitee |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/PowerManagerUtil.ets | arkts | getPowerModeName | MODE_NORMAL 600 表示标准模式,默认值。
MODE_POWER_SAVE 601 表示省电模式。
MODE_PERFORMANCE 602 表示性能模式。
MODE_EXTREME_POWER_SAVE 603 表示超级省电模式。 | static async getPowerModeName(): Promise<string> {
let powerModeNames = await getStringArray($r('app.strarray.power_mode'))
switch (power.getPowerMode()) {
case powerModes[0]:
return powerModeNames[0];
case powerModes[1]:
return powerModeNames[1];
case powerModes[2]:
re... | AST#method_declaration#Left static async getPowerModeName 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 string AST#primary_type#Right AST#type_annotation#Right >... | static async getPowerModeName(): Promise<string> {
let powerModeNames = await getStringArray($r('app.strarray.power_mode'))
switch (power.getPowerMode()) {
case powerModes[0]:
return powerModeNames[0];
case powerModes[1]:
return powerModeNames[1];
case powerModes[2]:
re... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/PowerManagerUtil.ets#L38-L51 | 3b55e424f9d2647036aa53aed5144d4985ab3ad2 | gitee |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/entry/src/main/ets/pages/home/aerobic.ets | arkts | Top | ********************************顶部*************************************************// | @Builder
Top(){
Row() {
Image("/image/home/return.png").width(40).height(40).onClick(()=>{
router.back()
})
Text('有氧').fontSize(20).fontWeight(900)
Text().width(40)
}.width('100%').justifyContent(FlexAlign.SpaceBetween).borderWidth({
bottom: 1
})
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right Top AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AS... | @Builder
Top(){
Row() {
Image("/image/home/return.png").width(40).height(40).onClick(()=>{
router.back()
})
Text('有氧').fontSize(20).fontWeight(900)
Text().width(40)
}.width('100%').justifyContent(FlexAlign.SpaceBetween).borderWidth({
bottom: 1
})
} | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/home/aerobic.ets#L66-L77 | 47340134c6b6bab59e1f7bcbd2100ccf9cf7f80e | github |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/DialogBuilder.ets | arkts | TextPickerDialogBuilder | TextPicker文本选择器弹窗view
@param options | @Builder
export function TextPickerDialogBuilder(options: ITextPickerOptions) {
TextPickerDialogView({ options: options })
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function TextPickerDialogBuilder AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ITextPickerOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) A... | @Builder
export function TextPickerDialogBuilder(options: ITextPickerOptions) {
TextPickerDialogView({ options: options })
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogBuilder.ets#L260-L263 | e323cf34869fe43a38bd4f7eb0cde447464422d9 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/NumberUtil.ets | arkts | toInt | 将字符串转换为整数。
@param value 要转换的字符串
@param defaultValue 异常时给默认值
@returns | static toInt(value: string, defaultValue: number = Number.NaN): number {
const parseValue = parseInt(value);
if (isNaN(parseValue)) {
return defaultValue;
}
return parseValue;
} | AST#method_declaration#Left static toInt 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#Left defaultValue : AST#type_annotation#Left AST#primary_type#Left number AST#primary_t... | static toInt(value: string, defaultValue: number = Number.NaN): number {
const parseValue = parseInt(value);
if (isNaN(parseValue)) {
return defaultValue;
}
return parseValue;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/NumberUtil.ets#L116-L122 | 1219107dab9b5c3f0f3fa7dbe23c7e229dde1e75 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets | arkts | @file 数据库示例页 ViewModel
@author Joker.X | @ObservedV2
export default class DatabaseViewModel extends BaseViewModel {
/**
* Demo 仓库
*/
private demoRepository: DemoRepository = new DemoRepository();
/**
* 标题输入
*/
@Trace
titleInput: string = "";
/**
* 描述输入
*/
@Trace
descInput: string = "";
/**
* 当前编辑的记录 ID(0 表示新增)
*/
@T... | AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export default AST#class_declaration#Left class DatabaseViewModel extends AST#type_annotation#Left AST#primary_type#Left BaseViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { /**
* Demo 仓库
*/ A... | @ObservedV2
export default class DatabaseViewModel extends BaseViewModel {
private demoRepository: DemoRepository = new DemoRepository();
@Trace
titleInput: string = "";
@Trace
descInput: string = "";
@Trace
editingId: number = 0;
@Trace
items: DemoEntity[] = [];
@Trace
loading: ... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets#L8-L180 | fd47c1de91143fe2a8581d2ab3df71dbeb49e73a | github | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/HomePage.ets | arkts | AllGoodsSection | 全部商品 | @Builder
AllGoodsSection() {
Column({ space: AppDimensions.spaceMedium }) {
this.SectionTitle('全部商品')
// 使用WaterFlow瀑布流布局
WaterFlow() {
ForEach(this.goods, (goods: Goods) => {
FlowItem() {
this.GoodsGridItem(goods)
}
})
}
.columnsTempl... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right AllGoodsSection 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_par... | @Builder
AllGoodsSection() {
Column({ space: AppDimensions.spaceMedium }) {
this.SectionTitle('全部商品')
WaterFlow() {
ForEach(this.goods, (goods: Goods) => {
FlowItem() {
this.GoodsGridItem(goods)
}
})
}
.columnsTemplate('1fr 1fr')
... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/HomePage.ets#L274-L292 | 2aac08c310ccaa43d351185df589cf12dc59352c | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/ToolsUtils.ets | arkts | stringArrays | 字符串转换数组 | stringArrays(ids:string|string[]){
let Ids:string[] = []
if (typeof ids === 'string'){
Ids.push(ids)
} else {
Ids = ids
}
return Ids
} | AST#method_declaration#Left stringArrays AST#parameter_list#Left ( AST#parameter#Left ids : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#union_type#Right AST#type_an... | stringArrays(ids:string|string[]){
let Ids:string[] = []
if (typeof ids === 'string'){
Ids.push(ids)
} else {
Ids = ids
}
return Ids
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/ToolsUtils.ets#L19-L27 | a9360a51b3eedc2e480b5eec57dde4bcd9db2fc4 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/toolbox/src/main/ets/pages/ImgParams.ets | arkts | 自定义静态参数集 | export class ImgParams extends CustomParams {
// 图片资源
private imgRes_: PixelMap | ResourceStr | DrawableDescriptor;
constructor(imgRes: PixelMap | ResourceStr | DrawableDescriptor) {
super();
this.imgRes_ = imgRes;
}
get imgRes(): PixelMap | ResourceStr | DrawableDescriptor {
return this.imgRes_... | AST#export_declaration#Left export AST#class_declaration#Left class ImgParams extends AST#type_annotation#Left AST#primary_type#Left CustomParams AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { // 图片资源 AST#property_declaration#Left private imgRes_ : AST#type_annotation#Left AST#union_type#Left AS... | export class ImgParams extends CustomParams {
private imgRes_: PixelMap | ResourceStr | DrawableDescriptor;
constructor(imgRes: PixelMap | ResourceStr | DrawableDescriptor) {
super();
this.imgRes_ = imgRes;
}
get imgRes(): PixelMap | ResourceStr | DrawableDescriptor {
return this.imgRes_;
}
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/toolbox/src/main/ets/pages/ImgParams.ets#L21-L33 | 79982414a97a08f10319f309d020945367312ce1 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/DateUtil.ets | arkts | isToday | 判断日期是否是今天 | static isToday(date: number | string | Date) {
let today = DateUtil.getTodayStr(DATE_FORMAT4);
let day = DateUtil.getFormatDateStr(date, DATE_FORMAT4)
return today === day;
} | AST#method_declaration#Left static isToday AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Date AST#primary_type#Right AST#union_type#Right A... | static isToday(date: number | string | Date) {
let today = DateUtil.getTodayStr(DATE_FORMAT4);
let day = DateUtil.getFormatDateStr(date, DATE_FORMAT4)
return today === day;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DateUtil.ets#L107-L111 | a07d422ed1a7ed6ba6c30b2cfd70b80de3a65404 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/NetworkUtil.ets | arkts | hasNetBearType | 是否存在指定的网络
@param netType 网络类型。
@returns | static hasNetBearType(netType: connection.NetBearType): boolean {
const netBearTypes = NetworkUtil.getNetBearTypes()
for (let item of netBearTypes.values()) {
if (item === netType) {
return true;
}
}
return false;
} | AST#method_declaration#Left static hasNetBearType AST#parameter_list#Left ( AST#parameter#Left netType : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left connection . NetBearType AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Righ... | static hasNetBearType(netType: connection.NetBearType): boolean {
const netBearTypes = NetworkUtil.getNetBearTypes()
for (let item of netBearTypes.values()) {
if (item === netType) {
return true;
}
}
return false;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/NetworkUtil.ets#L162-L170 | f760bf2dd9f7f923dd572d596ae39a3c3289562d | gitee |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/generated/index.ets | arkts | WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! | export * from "./../component/actionSheet" | AST#export_declaration#Left export * from "./../component/actionSheet" AST#export_declaration#Right | export * from "./../component/actionSheet" | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/generated/index.ets#L19-L19 | a513b5407b1e2a9981caba49c2a889710a873294 | gitee | |
yanweiguo198-commits/Harmony-Calendar-App.git | 9ebdfbe588dfc230231af619a6eeb89b3c7fc39f | entry/src/main/ets/model/CalendarUtil.ets | arkts | getFirstWeekDay | 获取某年某月1号是星期几 (0-6, 0代表周日) | static getFirstWeekDay(year: number, month: number): number {
return new Date(year, month - 1, 1).getDay();
} | AST#method_declaration#Left static getFirstWeekDay AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary... | static getFirstWeekDay(year: number, month: number): number {
return new Date(year, month - 1, 1).getDay();
} | https://github.com/yanweiguo198-commits/Harmony-Calendar-App.git/blob/9ebdfbe588dfc230231af619a6eeb89b3c7fc39f/entry/src/main/ets/model/CalendarUtil.ets#L8-L10 | bfba2bc3407f1816129f0a0a038517ab6142b160 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | picker_utils/BuildProfile.ets | arkts | Use these variables when you tailor your ArkTS code. They must be of the const type. | export const HAR_VERSION = '1.0.2'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HAR_VERSION = AST#expression#Left '1.0.2' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const HAR_VERSION = '1.0.2'; | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/picker_utils/BuildProfile.ets#L4-L4 | 82b98bc85a5aae11c70fbf6660227acac98922a7 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/goods/src/main/ets/view/GoodsDetailPage.ets | arkts | GoodsDetailContent | 商品详情页面内容视图
@returns {void} 无返回值 | @Builder
private GoodsDetailContent() {
Stack({ alignContent: Alignment.TopStart }) {
if (this.breakpointState.isLG()) {
this.GoodsDetailLargeLayout();
} else {
this.GoodsDetailSmallLayout();
}
GoodsDetailTopBar({
topBarAlpha: this.breakpointState.isLG() ? 0 : this... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private GoodsDetailContent 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 Stack ( AST#component_parameters#Left { AST#com... | @Builder
private GoodsDetailContent() {
Stack({ alignContent: Alignment.TopStart }) {
if (this.breakpointState.isLG()) {
this.GoodsDetailLargeLayout();
} else {
this.GoodsDetailSmallLayout();
}
GoodsDetailTopBar({
topBarAlpha: this.breakpointState.isLG() ? 0 : this... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/goods/src/main/ets/view/GoodsDetailPage.ets#L68-L99 | 7f6a4dbc9e10ac6a30fe5093a61f4f7d8e309e0e | github |
Neptune-EX/OS_System_Design.git | c728a82d48079ae0c52d50c4a2e2586b69f4ce55 | entry/src/main/ets/view/PublicFilesTab.ets | arkts | closeRenameDialog | 关闭重命名对话框 | private closeRenameDialog() {
this.showRenameDialog = false;
this.renamingFile = '';
this.newFilename = '';
} | AST#method_declaration#Left private closeRenameDialog 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 . showRenameDialog AST#mem... | private closeRenameDialog() {
this.showRenameDialog = false;
this.renamingFile = '';
this.newFilename = '';
} | https://github.com/Neptune-EX/OS_System_Design.git/blob/c728a82d48079ae0c52d50c4a2e2586b69f4ce55/entry/src/main/ets/view/PublicFilesTab.ets#L417-L421 | e723654c5b425c54ec7a3a149ba87f781156718c | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets | arkts | buildThemePreview | 构建主题预览 | @Builder
buildThemePreview() {
Card() {
Column({ space: UIConstants.DEFAULT_PADDING }) {
Row() {
Text('主题预览')
.fontSize(UIConstants.FONT_SIZE_HEADING)
.fontWeight(FontWeight.Medium)
.fontColor($r('app.color.text_primary'))
.layoutWeight(1)
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildThemePreview 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 Card ( ) AST#container_content_body#Left { AST#arkts_ui_... | @Builder
buildThemePreview() {
Card() {
Column({ space: UIConstants.DEFAULT_PADDING }) {
Row() {
Text('主题预览')
.fontSize(UIConstants.FONT_SIZE_HEADING)
.fontWeight(FontWeight.Medium)
.fontColor($r('app.color.text_primary'))
.layoutWeight(1)
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets#L252-L314 | 0b005be655d9de92044e689843485181ab7a9eee | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/GameificationService.ets | arkts | recordAction | 记录用户行为并奖励积分 | async recordAction(
action: GameAction,
metadata: Record<string, any> = {},
userId: string = 'default'
): Promise<PointsRecord> {
try {
const basePoints = this.pointsConfig.get(action) || 1;
const multiplier = this.calculateMultiplier(action, metadata);
const finalPoints = Math.roun... | AST#method_declaration#Left async recordAction AST#parameter_list#Left ( AST#parameter#Left action : AST#type_annotation#Left AST#primary_type#Left GameAction AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left metadata : AST#type_annotation#Left AST#primary_type#Left AST#generic_t... | async recordAction(
action: GameAction,
metadata: Record<string, any> = {},
userId: string = 'default'
): Promise<PointsRecord> {
try {
const basePoints = this.pointsConfig.get(action) || 1;
const multiplier = this.calculateMultiplier(action, metadata);
const finalPoints = Math.roun... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L317-L365 | 9ab7923714ae2651ef792c83fa2806384b2f03c2 | github |
openharmony/multimedia_camera_framework | 9873dd191f59efda885bc06897acf9b0660de8f2 | frameworks/js/camera_napi/demo/entry/src/main/ets/views/SlidePage.ets | arkts | SlidePage | 变焦组件 | @Component
export struct SlidePage {
@StorageLink('zoomRatioMin') zoomMin: number = 1;
@StorageLink('zoomRatioMax') zoomMax: number = 6;
@StorageLink('equivalentFocalLength') equivalentFocalLength: number = 0;
// slide滑块
@State outSetValueOne: number = 1;
// slide滑块移动值
@State sliderTextPos: string = '-10'... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct SlidePage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'zoomRatioMin' AST#expression#Right ) AST#decorator#Right zoomMin : AST#type_annotation#Left AST... | @Component
export struct SlidePage {
@StorageLink('zoomRatioMin') zoomMin: number = 1;
@StorageLink('zoomRatioMax') zoomMax: number = 6;
@StorageLink('equivalentFocalLength') equivalentFocalLength: number = 0;
@State outSetValueOne: number = 1;
移动值
@State sliderTextPos: string = '-10';
slideChange(val... | https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/demo/entry/src/main/ets/views/SlidePage.ets#L22-L85 | 6371233dcaab128aacfd8cda596524ac5e4cb9d7 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/SimpleVideo/entry/src/main/ets/view/VideoPlayer.ets | arkts | finish | video component finish callback | finish() {
this.isPlay = false;
this.isOpacity = false;
} | AST#method_declaration#Left finish 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 . isPlay AST#member_expression#Right = AST#ex... | finish() {
this.isPlay = false;
this.isOpacity = false;
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/SimpleVideo/entry/src/main/ets/view/VideoPlayer.ets#L100-L103 | f9a2573054b1c483d793dadd8d33e85cbdf58ee1 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/CoreFile/FileSample/entry/src/main/ets/fileFs/FileFs.ets | arkts | [End hash_File_Stream] 根据文件名读取文件内容 | export function readFile(fileName: string): string {
let file = fs.openSync(filesDir + '/' + fileName + '.txt', fs.OpenMode.READ_ONLY);
let arrayBuffer = new ArrayBuffer(BUFFER);
let readOptions: ReadOptions = {
offset: 0, // 从文件的开头开始读取
length: arrayBuffer.byteLength
};
let readLen = fs.readSync(file.... | AST#export_declaration#Left export AST#function_declaration#Left function readFile AST#parameter_list#Left ( AST#parameter#Left fileName : 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#... | export function readFile(fileName: string): string {
let file = fs.openSync(filesDir + '/' + fileName + '.txt', fs.OpenMode.READ_ONLY);
let arrayBuffer = new ArrayBuffer(BUFFER);
let readOptions: ReadOptions = {
offset: 0,
length: arrayBuffer.byteLength
};
let readLen = fs.readSync(file.fd, arrayBuff... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/CoreFile/FileSample/entry/src/main/ets/fileFs/FileFs.ets#L199-L212 | ba34651ac4ee7f2c35c872a1756d3beb3e94c03b | gitee | |
zhongte/TaoYao | 80850f3800dd6037216d3f7c58a2bf34a881c93f | taoyao/src/main/ets/shijing/taoyao/picker/camera/CameraBuilder.ets | arkts | setSaveUri | 文件保存路径
@param saveUri
@returns | public setSaveUri(saveUri: string): CameraBuilder {
this._saveUri = saveUri
return this
} | AST#method_declaration#Left public setSaveUri AST#parameter_list#Left ( AST#parameter#Left saveUri : 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 CameraBuilder AST#pr... | public setSaveUri(saveUri: string): CameraBuilder {
this._saveUri = saveUri
return this
} | https://github.com/zhongte/TaoYao/blob/80850f3800dd6037216d3f7c58a2bf34a881c93f/taoyao/src/main/ets/shijing/taoyao/picker/camera/CameraBuilder.ets#L47-L50 | 9293cf8c53a26b8cbfba9aabe4ad65f2e59c23e4 | gitee |
L1rics06/arkTS-.git | 991fd131bfdb11e2933152133c97453d86092ac0 | entry/src/main/ets/pages/AppState.ets | arkts | get | 检查是否登录 | public get isLoggedIn(): boolean {
return this._isLoggedIn;
} | AST#method_declaration#Left public get AST#ERROR#Left isLoggedIn 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 A... | public get isLoggedIn(): boolean {
return this._isLoggedIn;
} | https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/AppState.ets#L173-L175 | 5e5aeee90a0ceb89d17e69eaef40de9c315415db | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/decodeheifimage/src/main/ets/model/Taskpool.ets | arkts | 执行taskpool异步任务列表中的每一个任务
@param urls 图片资源链接数组
@param dataSource 瀑布流数据操作实例 | export function executeTasks(urls: string[], dataSource: WaterFlowDataSource) {
const tasks = getTasks(urls);
for (let i = 0; i < tasks.length; i++) {
taskpool.execute(tasks[i], taskpool.Priority.HIGH)
.then(result => {
const imageInfo = result as ImageInfo;
if (result !== null) {
... | AST#export_declaration#Left export AST#function_declaration#Left function executeTasks AST#parameter_list#Left ( AST#parameter#Left urls : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#paramet... | export function executeTasks(urls: string[], dataSource: WaterFlowDataSource) {
const tasks = getTasks(urls);
for (let i = 0; i < tasks.length; i++) {
taskpool.execute(tasks[i], taskpool.Priority.HIGH)
.then(result => {
const imageInfo = result as ImageInfo;
if (result !== null) {
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/decodeheifimage/src/main/ets/model/Taskpool.ets#L44-L58 | a3db42f92bf43ff927fb1db82ab59c69decdef6d | gitee | |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/pages/SearchPage.ets | arkts | subscribePodcast | 订阅播客 | async subscribePodcast(podcast: Podcast) {
if (this.isSubscribing) {
return;
}
// 检查是否已订阅
if (this.subscribedPodcastIds.has(podcast.id)) {
UIUtils.showToast(new ToastOptions('该播客已订阅', 2000));
return;
}
if (!podcast.feedUrl) {
UIUtils.showToast(new ToastOptions('该播客没有有效的... | AST#method_declaration#Left async subscribePodcast AST#parameter_list#Left ( AST#parameter#Left podcast : AST#type_annotation#Left AST#primary_type#Left Podcast 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#... | async subscribePodcast(podcast: Podcast) {
if (this.isSubscribing) {
return;
}
if (this.subscribedPodcastIds.has(podcast.id)) {
UIUtils.showToast(new ToastOptions('该播客已订阅', 2000));
return;
}
if (!podcast.feedUrl) {
UIUtils.showToast(new ToastOptions('该播客没有有效的 RSS 地址', ... | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/SearchPage.ets#L399-L441 | 8a5e5411ecfed3e30db8357241437dce972a99b4 | github |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.GridObjectSortComponent.d.ets | arkts | @file
@kit ArkUI
Controls the style types of GridObjectSortComponent.
@enum { string }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@since 11
Controls the style types of GridObjectSortComponent.
@enum { string }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export declare enum GridObjectSortComponentType {
/**
* The GridObjectSortComponent image text type.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* The GridObjectSortComponent image text type.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum GridObjectSortComponentType AST#enum_body#Left { /**
* The GridObjectSortComponent image text type.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/ /**
* The ... | export declare enum GridObjectSortComponentType {
IMAGE_TEXT = "image_text",
TEXT = "text"
} | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.GridObjectSortComponent.d.ets#L34-L63 | 4723347a964421040ff1b952147ef552fd4b984f | github | |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | NEXT/LightRed/entry/src/main/ets/viewModel/MyUtils.ets | arkts | 发送http请求,获取诗词 | export async function getPoemDate(): Promise<PoemFromApi> {
let tempObj: PoemFromApi = new PoemFromApi('temp','temp','temp','temp-temp')
//发送网络请求,获取真实的数据覆盖原来
await http.createHttp().request(Constants.poemApi)
.then((data: http.HttpResponse) => {
let content: string = JSON.parse(`${data.result}`).content... | AST#export_declaration#Left export AST#function_declaration#Left async function getPoemDate 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 PoemFromApi AST#primary... | export async function getPoemDate(): Promise<PoemFromApi> {
let tempObj: PoemFromApi = new PoemFromApi('temp','temp','temp','temp-temp')
await http.createHttp().request(Constants.poemApi)
.then((data: http.HttpResponse) => {
let content: string = JSON.parse(`${data.result}`).content
let origin: s... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/LightRed/entry/src/main/ets/viewModel/MyUtils.ets#L7-L20 | f0062466d87f977aacd345915502ef821c1e81cd | gitee | |
iotjin/JhHarmonyDemo.git | 819e6c3b1db9984c042a181967784550e171b2e8 | JhCommon/Index.ets | arkts | BaseNavigation | / components | export { BaseNavigation } from '../JhCommon/src/main/ets/JhCommon/components/BaseNavigation' | AST#export_declaration#Left export { BaseNavigation } from '../JhCommon/src/main/ets/JhCommon/components/BaseNavigation' AST#export_declaration#Right | export { BaseNavigation } from '../JhCommon/src/main/ets/JhCommon/components/BaseNavigation' | https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/Index.ets#L27-L27 | 9294468a577008a7d173e1700b2c38967b7d99f2 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/FavoritesService.ets | arkts | saveGiftRecommendation | 保存礼物推荐 | async saveGiftRecommendation(gift: GiftRecommendation): Promise<void> {
this.savedGifts.push(gift);
await this.saveData();
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Saved gift recommendation: ${gift.id}`);
} | AST#method_declaration#Left async saveGiftRecommendation AST#parameter_list#Left ( AST#parameter#Left gift : AST#type_annotation#Left AST#primary_type#Left GiftRecommendation AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ... | async saveGiftRecommendation(gift: GiftRecommendation): Promise<void> {
this.savedGifts.push(gift);
await this.saveData();
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Saved gift recommendation: ${gift.id}`);
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/FavoritesService.ets#L189-L194 | 48f33634600377cb00411bbaa5bb475154afd7b3 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/NumberUtil.ets | arkts | sum | 求和
@param x
@param y
@returns | static sum(...n: number[]): number {
return NumberUtil.sumDecimal(...n).toNumber();
} | AST#method_declaration#Left static sum AST#parameter_list#Left ( AST#parameter#Left ... n : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#pr... | static sum(...n: number[]): number {
return NumberUtil.sumDecimal(...n).toNumber();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/NumberUtil.ets#L198-L200 | 22dfd8ebb574d175b95b5f20bd5feab11f565624 | gitee |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/viewmodels/ReviewViewModel.ets | arkts | getMaxHours | 获取时间分布的最大值(用于图表缩放) | static getMaxHours(distribution: TimeDistributionItem[]): number {
return Math.max(...distribution.map(d => d.hours), 1);
} | AST#method_declaration#Left static getMaxHours AST#parameter_list#Left ( AST#parameter#Left distribution : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TimeDistributionItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AS... | static getMaxHours(distribution: TimeDistributionItem[]): number {
return Math.max(...distribution.map(d => d.hours), 1);
} | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/viewmodels/ReviewViewModel.ets#L104-L106 | 9da8686b0cce17d0b95ba2f2cfa376ca5a0945ce | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/promise_callback/promise_callback_002_F.ets | arkts | Introduction 异步-Promise-then | export function promise_callback_001_T(taint_src : string) {
let _t = taint_src;
let clean = "clean";
let p = f(clean);
p.then((result) => {
taint.Sink(result);
})
} | AST#export_declaration#Left export AST#function_declaration#Left function promise_callback_001_T 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_statem... | export function promise_callback_001_T(taint_src : string) {
let _t = taint_src;
let clean = "clean";
let p = f(clean);
p.then((result) => {
taint.Sink(result);
})
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/promise_callback/promise_callback_002_F.ets#L6-L13 | f41a7a7e4cc27d4d77eb3260af52fc0413f31376 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/DbFileUtility.ets | arkts | createFolderIfNeeds | 创建目录(如果不存在)
@param path 文件或目录路径 | private static createFolderIfNeeds(path: string): void {
try {
// 如果是文件路径,则获取其父目录
const dirPath = DbFileUtility.getFolderPath(path)//path.endsWith('/') ? path : path.substring(0, path.lastIndexOf('/') + 1);
// 递归创建目录
fs.mkdirSync(dirPath, true);
} catch (err) {
if (err.code !== 13... | AST#method_declaration#Left private static createFolderIfNeeds AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void A... | private static createFolderIfNeeds(path: string): void {
try {
const dirPath = DbFileUtility.getFolderPath(path)
fs.mkdirSync(dirPath, true);
} catch (err) {
if (err.code !== 13900015) {
console.error(`目录创建失败: ${err.message}`);
}
}
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/DbFileUtility.ets#L167-L179 | 391a39a306cdfb989bba95fb7e31b22aaa19cb00 | github |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/proxy/ToastIconBuilderProxy.ets | arkts | orientation | 吐司图标与文本排列方向
@param orientation
@returns | orientation(orientation: Orientation) {
this.builderOptions.orientation = orientation
return this
} | AST#method_declaration#Left orientation AST#parameter_list#Left ( AST#parameter#Left orientation : AST#type_annotation#Left AST#primary_type#Left Orientation AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_state... | orientation(orientation: Orientation) {
this.builderOptions.orientation = orientation
return this
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/ToastIconBuilderProxy.ets#L39-L42 | f1d46d62f0cdcdd4e021f69bd702b34173f21ee5 | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/MoneyTrack-master/products/entry/src/main/ets/common/WidgetUtil.ets | arkts | subscribeFormId | 订阅获取卡片id | public static async subscribeFormId(ctx: Context) {
let subscriber: commonEventManager.CommonEventSubscriber | undefined =
undefined;
let subscribeInfo: commonEventManager.CommonEventSubscribeInfo = {
events: [WidgetUtil._formIdEventName],
publisherPermission: '',
};
commonEventManager... | AST#method_declaration#Left public static async subscribeFormId AST#parameter_list#Left ( AST#parameter#Left ctx : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#vari... | public static async subscribeFormId(ctx: Context) {
let subscriber: commonEventManager.CommonEventSubscriber | undefined =
undefined;
let subscribeInfo: commonEventManager.CommonEventSubscribeInfo = {
events: [WidgetUtil._formIdEventName],
publisherPermission: '',
};
commonEventManager... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MoneyTrack-master/products/entry/src/main/ets/common/WidgetUtil.ets#L61-L96 | dc17abab8662e8603c7ea29b5a825964b6678f85 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Connectivity/NetworkObserver/entry/src/main/ets/utils/NetUtils.ets | arkts | stopAllNetObserve | 停止所有网络监听 | public stopAllNetObserve() {
emitter.off(this.getEmitterEvent().eventId);
this.connectionMap.forEach((netConnection: connection.NetConnection, netType: connection.NetBearType) => {
netConnection.unregister(() => {
logger.info('Success unregister:' + netType.toString());
});
})
} | AST#method_declaration#Left public stopAllNetObserve 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 emitter AST#expression#Right . off AST#... | public stopAllNetObserve() {
emitter.off(this.getEmitterEvent().eventId);
this.connectionMap.forEach((netConnection: connection.NetConnection, netType: connection.NetBearType) => {
netConnection.unregister(() => {
logger.info('Success unregister:' + netType.toString());
});
})
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/NetworkObserver/entry/src/main/ets/utils/NetUtils.ets#L118-L125 | 3dfb9ebd6b1a2b87213fb613b1193c66b658bf70 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/expandtitle/src/main/ets/page/DataSource.ets | arkts | getData | 获取指定数据项 | public getData(index: number): MemoInfo {
return this.originDataArray[index];
} | AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left MemoInfo AST#primary_type... | public getData(index: number): MemoInfo {
return this.originDataArray[index];
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/expandtitle/src/main/ets/page/DataSource.ets#L34-L36 | aaa4484d1a326a54f20f7b942b74e9e25bf97de3 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/router/AppRouter.ets | arkts | back | 页面回退
@param options 回退选项 | async back(options?: router.RouterOptions): Promise<void> {
try {
await router.back(options);
// 更新导航栈
if (this.navigationStack.length > 0) {
const removedPath = this.navigationStack.pop();
hilog.info(0x0001, 'BirthdayReminder',
`Navigated back from: ${removedPath}... | AST#method_declaration#Left async back AST#parameter_list#Left ( AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left router . RouterOptions AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#typ... | async back(options?: router.RouterOptions): Promise<void> {
try {
await router.back(options);
if (this.navigationStack.length > 0) {
const removedPath = this.navigationStack.pop();
hilog.info(0x0001, 'BirthdayReminder',
`Navigated back from: ${removedPath}, stack ... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/router/AppRouter.ets#L142-L158 | 895ef22cdbcc9904c28c09ca537f78c3cf8c40a7 | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/network/src/main/ets/NetworkClient.ets | arkts | get | 静态访问属性,方便直接通过 NetworkClient.http 调用 | public static get http(): AxiosInstance {
return NetworkClient.getInstance().getAxios();
} | AST#method_declaration#Left public static get AST#ERROR#Left http AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AxiosInstance AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left r... | public static get http(): AxiosInstance {
return NetworkClient.getInstance().getAxios();
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/network/src/main/ets/NetworkClient.ets#L50-L52 | c061ed3474452b819ae0ce0dfb9ec5b87c56d099 | github |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/viewmodel/WeatherManager.ets | arkts | getWeatherData | 获取天气数据(带缓存) | async getWeatherData(city: string = '北京'): Promise<WeatherData> {
const now = Date.now();
const cacheDuration = this.TEST_MODE ? 10 * 1000 : this.CACHE_DURATION; // 测试模式:10秒缓存
// 检查缓存是否有效
if (this.cachedWeatherData && (now - this.lastUpdateTime) < cacheDuration) {
console.log('[WeatherManager] 使用... | AST#method_declaration#Left async getWeatherData AST#parameter_list#Left ( AST#parameter#Left city : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '北京' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation... | async getWeatherData(city: string = '北京'): Promise<WeatherData> {
const now = Date.now();
const cacheDuration = this.TEST_MODE ? 10 * 1000 : this.CACHE_DURATION;
if (this.cachedWeatherData && (now - this.lastUpdateTime) < cacheDuration) {
console.log('[WeatherManager] 使用缓存数据');
return thi... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/WeatherManager.ets#L59-L90 | 83c3e0ed38af7d4f25fbfd96841f042bcd759ef9 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Solutions/IM/Chat/products/phone/entry/src/main/ets/pages/SettingPage.ets | arkts | 其他功能分组 | build() {
Column() {
Row() {
Text($r('app.string.my'))
.fontSize($r('app.integer.setting_title_font_size'))
.fontWeight(FontWeight.Bold)
.lineHeight($r('app.integer.setting_title_height'))
.fontColor($r('app.color.title_font_color'))
.fontFamily($r('ap... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_... | build() {
Column() {
Row() {
Text($r('app.string.my'))
.fontSize($r('app.integer.setting_title_font_size'))
.fontWeight(FontWeight.Bold)
.lineHeight($r('app.integer.setting_title_height'))
.fontColor($r('app.color.title_font_color'))
.fontFamily($r('ap... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/IM/Chat/products/phone/entry/src/main/ets/pages/SettingPage.ets#L47-L162 | ade705a867a5d320801c821028946e8653014199 | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/transitionanimation/src/main/ets/components/pages/TransitionAnimationPage.ets | arkts | TransitionAnimationPage | 场景描述: 本方案做的是页面点击卡片跳转到详情预览的转场动画效果
推荐场景: 点击卡片使用动效跳转详情页的场景,如:点击图文卡片进入详情页等
核心组件:
1. CardPage
实现步骤:
1. 点击卡片后,记录当前被点击卡片在数组中的索引,DetailPage渲染被点击卡片组件,使用onAreaChange存储每个Card被点击时的位置、
宽高信息,用于设置返回动画卡片组件的结束状态位置尺寸信息
2. onCardReadyExpand回调在DetailPage内部Image渲染结束时触发,使用Stack布局,动态设置DetailPage zIndex值大于CardList,
使DetailPage覆盖到CardList上;... | @Component
export struct TransitionAnimationPage {
@Provide pageInfos: NavPathStack = new NavPathStack();
// 存储当前设备高度,用于计算详情页展开后高度
@State currentDisplayWidth: Length = 0;
@State currentDisplayHeight: Length = 0;
// 详情页是否显示标识
@State isCardListPageShow: boolean = true;
@State shouldDetailPageShow: boolean =... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TransitionAnimationPage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Provide AST#decorator#Right pageInfos : AST#type_annotation#Left AST#primary_type#Left NavPathStack AST#primary_type... | @Component
export struct TransitionAnimationPage {
@Provide pageInfos: NavPathStack = new NavPathStack();
@State currentDisplayWidth: Length = 0;
@State currentDisplayHeight: Length = 0;
@State isCardListPageShow: boolean = true;
@State shouldDetailPageShow: boolean = false;
@State myOpacity: number =... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/transitionanimation/src/main/ets/components/pages/TransitionAnimationPage.ets#L37-L209 | 66437d1dab43f52f75977213c5f6358309fa562a | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/analytics/AdvancedAnalyticsService.ets | arkts | 用户画像接口 | export interface UserSegment {
id: string;
name: string;
description: string;
criteria: SegmentCriteria[];
userCount: number;
characteristics: UserCharacteristics;
behaviors: BehaviorPattern[];
value: SegmentValue;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface UserSegment AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#Left AST... | export interface UserSegment {
id: string;
name: string;
description: string;
criteria: SegmentCriteria[];
userCount: number;
characteristics: UserCharacteristics;
behaviors: BehaviorPattern[];
value: SegmentValue;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/analytics/AdvancedAnalyticsService.ets#L182-L191 | 0d1f809a4cb0d9139114cfc8d0a6f39fdaf838e0 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/AIService.ets | arkts | getModelConfigs | 获取所有模型配置 | getModelConfigs(): AIModelConfig[] {
return [...this.modelConfigs];
} | AST#method_declaration#Left getModelConfigs AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left AIModelConfig [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement... | getModelConfigs(): AIModelConfig[] {
return [...this.modelConfigs];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/AIService.ets#L134-L136 | ad5543cd19afc324b04f31280fb9d600f73136d8 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_core/src/main/ets/core/util/PhoneUtil.ets | arkts | isMobileHk | 验证是否为手机号码(香港)
@param content 香港手机号码 | static isMobileHk(content: string): OutDTO<string> {
if (content == null || content == '') {
// 提供null的字符串为不匹配
return OutDTO.Error("验证手机号不能为空");
}
if (new RegExp(Const.MOBILE_HK).test(content)) {
return OutDTO.OK("手机号为中国香港号码")
} else {
return OutDTO.Error("手机号非中国香港号码,请检查")
}
... | AST#method_declaration#Left static isMobileHk AST#parameter_list#Left ( AST#parameter#Left content : 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#Lef... | static isMobileHk(content: string): OutDTO<string> {
if (content == null || content == '') {
return OutDTO.Error("验证手机号不能为空");
}
if (new RegExp(Const.MOBILE_HK).test(content)) {
return OutDTO.OK("手机号为中国香港号码")
} else {
return OutDTO.Error("手机号非中国香港号码,请检查")
}
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/PhoneUtil.ets#L49-L59 | c568c904e2727fa949d5ceac794b17220567a8f6 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_ecb_encryption_decryption/aes_ecb_encryption_decryption_asynchronous.ets | arkts | decryptMessagePromise | 解密消息 | async function decryptMessagePromise(symKey: cryptoFramework.SymKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('AES128|ECB|PKCS7');
await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, null);
let decryptData = await decoder.doFinal(cipherText);
return decr... | AST#function_declaration#Left async function decryptMessagePromise 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#par... | async function decryptMessagePromise(symKey: cryptoFramework.SymKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('AES128|ECB|PKCS7');
await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, null);
let decryptData = await decoder.doFinal(cipherText);
return decr... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_ecb_encryption_decryption/aes_ecb_encryption_decryption_asynchronous.ets#L29-L34 | ef169dde0c082af3bba97baf201d65065a4abf0c | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.ChipGroup.d.ets | arkts | Defines icon options.
@interface IconOptions
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export interface IconOptions {
/**
* Image resource.
*
* @type { ResourceStr }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
src: ResourceStr;
/**
* Image size option.
*
* @type { ?SizeOptions }
* @s... | AST#export_declaration#Left export AST#interface_declaration#Left interface IconOptions AST#object_type#Left { /**
* Image resource.
*
* @type { ResourceStr }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/ AST#type_member#Left src : A... | export interface IconOptions {
src: ResourceStr;
size?: SizeOptions;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ChipGroup.d.ets#L34-L57 | 45e4d8ad5c7126401a00f1fce79d56bb99cc30e8 | gitee | |
MissTeven/ArkTS-demo.git | fd9f7695fa29889ad4a9ecf3330fda9991aca24c | entry/src/main/ets/model/MediaQueryModel.ets | arkts | onPortrait | Method for media query to trigger execution.
@param mediaQueryResult Media query result. | private onPortrait(mediaQueryResult: mediaQuery.MediaQueryResult): void {
AppStorage.Set<boolean>('isMinHeight', mediaQueryResult.matches);
} | AST#method_declaration#Left private onPortrait AST#parameter_list#Left ( AST#parameter#Left mediaQueryResult : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left mediaQuery . MediaQueryResult AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#paramete... | private onPortrait(mediaQueryResult: mediaQuery.MediaQueryResult): void {
AppStorage.Set<boolean>('isMinHeight', mediaQueryResult.matches);
} | https://github.com/MissTeven/ArkTS-demo.git/blob/fd9f7695fa29889ad4a9ecf3330fda9991aca24c/entry/src/main/ets/model/MediaQueryModel.ets#L14-L16 | c23c44dea374b14ca97c0a8ee3432d6a0f491095 | github |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/International/International/entry/src/main/ets/component/OperationView.ets | arkts | OperationView | 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 default struct OperationView {
private operationKey: string | Resource = '';
private showArrow: boolean = true;
private handleClick: () => void = (): void => {};
build() {
Row() {
Text(this.operationKey)
.fontSize(16)
.fontColor(Color.Black)
.height('100%')
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct OperationView AST#component_body#Left { AST#property_declaration#Left private operationKey : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#... | @Component
export default struct OperationView {
private operationKey: string | Resource = '';
private showArrow: boolean = true;
private handleClick: () => void = (): void => {};
build() {
Row() {
Text(this.operationKey)
.fontSize(16)
.fontColor(Color.Black)
.height('100%')
... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/International/International/entry/src/main/ets/component/OperationView.ets#L16-L43 | 0f61430597ed80e08e190bca19a0815436be0a0a | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/ApplicationModels/Launcher/desktop/src/main/ets/default/model/DesktopLayoutModel.ets | arkts | buildMenuInfoList | buildMenuInfoList
@param appInfo: GridLayoutItemInfo | buildMenuInfoList(appInfo: GridLayoutItemInfo, dialog: CustomDialogController) {
if (CheckEmptyUtils.isEmpty(appInfo)) {
return undefined;
}
let menuInfoList = new Array<MenuInfo>();
let open = new MenuInfo();
open.menuImgSrc = $r('app.media.ic_public_add_norm');
open.menuText = $r('app.st... | AST#method_declaration#Left buildMenuInfoList AST#parameter_list#Left ( AST#parameter#Left appInfo : AST#type_annotation#Left AST#primary_type#Left GridLayoutItemInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dialog : AST#type_annotation#Left AST#primary_type#Left CustomD... | buildMenuInfoList(appInfo: GridLayoutItemInfo, dialog: CustomDialogController) {
if (CheckEmptyUtils.isEmpty(appInfo)) {
return undefined;
}
let menuInfoList = new Array<MenuInfo>();
let open = new MenuInfo();
open.menuImgSrc = $r('app.media.ic_public_add_norm');
open.menuText = $r('app.st... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/ApplicationModels/Launcher/desktop/src/main/ets/default/model/DesktopLayoutModel.ets#L107-L149 | 34ce46fe2d6f0949801730a1751b65cd5f8da3ed | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/ImageEdit/entry/src/main/ets/viewModel/PixelMapWrapper.ets | arkts | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License,Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | export class PixelMapWrapper {
pixelMap?: PixelMap;
width: number = 0;
height: number = 0;
constructor(pixelMap: PixelMap, width: number, height: number) {
this.pixelMap = pixelMap;
this.width = width;
this.height = height;
}
release() {
if (this.pixelMap != undefined) {
this.pixelMa... | AST#export_declaration#Left export AST#class_declaration#Left class PixelMapWrapper AST#class_body#Left { AST#property_declaration#Left pixelMap ? : AST#type_annotation#Left AST#primary_type#Left PixelMap AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left wid... | export class PixelMapWrapper {
pixelMap?: PixelMap;
width: number = 0;
height: number = 0;
constructor(pixelMap: PixelMap, width: number, height: number) {
this.pixelMap = pixelMap;
this.width = width;
this.height = height;
}
release() {
if (this.pixelMap != undefined) {
this.pixelMa... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/PixelMapWrapper.ets#L17-L35 | e6c4bd7c9c0700f39b38d90cd969edc968b27f4c | gitee | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | ImageEditTaskPool/entry/src/main/ets/view/AdjustContentView.ets | arkts | sliderChange | [Start handleImage] ImageEditTaskPool/entry/src/main/ets/view/AdjustContentView.ets | async sliderChange(value: number, mode: SliderChangeMode) {
// [StartExclude handleImage]
if ((mode === SliderChangeMode.End) && (value !== this.currentAdjustData[this.currentIndex])) {
if (this.postState) {
this.deviceListDialogController.open();
}
this.postState = false;
this.... | AST#method_declaration#Left async sliderChange AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left mode : AST#type_annotation#Left AST#primary_type#Left SliderChangeMode AST#p... | async sliderChange(value: number, mode: SliderChangeMode) {
if ((mode === SliderChangeMode.End) && (value !== this.currentAdjustData[this.currentIndex])) {
if (this.postState) {
this.deviceListDialogController.open();
}
this.postState = false;
this.currentAdjustData[this.curren... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ImageEditTaskPool/entry/src/main/ets/view/AdjustContentView.ets#L176-L215 | 7f4bc42ae8bb1487999b62cec81d83ad88d68678 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.