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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/GameificationService.ets | arkts | 排行榜条目接口 | export interface LeaderboardEntry {
userId: string;
username: string;
avatar?: string;
level: number;
points: number;
rank: number;
change: number;
achievements: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface LeaderboardEntry AST#object_type#Left { AST#type_member#Left userId : 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 username : AST#type_annota... | export interface LeaderboardEntry {
userId: string;
username: string;
avatar?: string;
level: number;
points: number;
rank: number;
change: number;
achievements: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L237-L246 | 0cb8bf0d678ac06aa9e445a5169774a748653193 | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceSM4ArkTs/entry/src/main/ets/pages/sm4_ecb_encryption_decryption/sm4_ecb_encryption_decryption_asynchronous.ets | arkts | decryptMessagePromise | 解密消息 | async function decryptMessagePromise(symKey: cryptoFramework.SymKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('SM4_128|ECB|PKCS7');
await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, null);
let decryptData = await decoder.doFinal(cipherText);
return dec... | 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('SM4_128|ECB|PKCS7');
await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, null);
let decryptData = await decoder.doFinal(cipherText);
return dec... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceSM4ArkTs/entry/src/main/ets/pages/sm4_ecb_encryption_decryption/sm4_ecb_encryption_decryption_asynchronous.ets#L29-L34 | c54e09e86dbda6168e5ffa67f30c67f8e2f50735 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/KvUtil.ets | arkts | get | 获取指定键的值。
@param key 要查询数据的Key
@param callback | static async get(key: string, defValue?: string | number | boolean | Uint8Array): Promise<string | number | boolean | Uint8Array | undefined> {
let kvStore = await KvUtil.getKvStore();
return kvStore.get(key).catch((e: BusinessError) => {
return defValue;
});
} | AST#method_declaration#Left static async get AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left defValue ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ... | static async get(key: string, defValue?: string | number | boolean | Uint8Array): Promise<string | number | boolean | Uint8Array | undefined> {
let kvStore = await KvUtil.getKvStore();
return kvStore.get(key).catch((e: BusinessError) => {
return defValue;
});
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/KvUtil.ets#L72-L77 | f8a962626d62f7e1d0cc4ddda2b88f1a8d9aba70 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/addressrecognize/src/main/ets/common/CommonConstants.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class CommonConstants {
//toast停留时间
static readonly TOAST_DURATION: number = 2000;
static readonly FONT_WEIGHT: number = 500;
//分割线高度
static readonly DIVIDER_HEIGHT: number = 2;
static readonly MIN_BORDER_WIDTH: number = 1;
//输入地址最大字数
static readonly ADDRESS_MAX_LENGTH: number = 200;
static rea... | AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { //toast停留时间 AST#property_declaration#Left static readonly TOAST_DURATION : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 2000 AST#expre... | export class CommonConstants {
static readonly TOAST_DURATION: number = 2000;
static readonly FONT_WEIGHT: number = 500;
static readonly DIVIDER_HEIGHT: number = 2;
static readonly MIN_BORDER_WIDTH: number = 1;
static readonly ADDRESS_MAX_LENGTH: number = 200;
static readonly BOTTOM_MARGIN: number ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/addressrecognize/src/main/ets/common/CommonConstants.ets#L16-L41 | 542d95e31e3d5991cb2a935960e7df92d5ad4c02 | gitee | |
openharmony/xts_tools | 784a2e99d894e6bc2aba8c38f6bb68032442b1c8 | sample/AppSampleE/entry/src/main/ets/pages/takeaway/Commodity.ets | arkts | rowStyleShop | 重置 | @Extend(Row) function rowStyleShop() {
.width('95%')
.height(170)
.borderRadius(8)
.margin({ top: 12 })
.padding(12)
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left Row AST#expression#Right ) AST#decorator#Right function rowStyleShop AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left '95%' AST#e... | @Extend(Row) function rowStyleShop() {
.width('95%')
.height(170)
.borderRadius(8)
.margin({ top: 12 })
.padding(12)
} | https://github.com/openharmony/xts_tools/blob/784a2e99d894e6bc2aba8c38f6bb68032442b1c8/sample/AppSampleE/entry/src/main/ets/pages/takeaway/Commodity.ets#L29-L35 | 2240860605b3daf5e793e5563264a7c5df9434a3 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets | arkts | onBLEDeviceFind | 订阅查找蓝牙设备 | private onBLEDeviceFind() {
try {
ble.on('BLEDeviceFind', (arr: Array<ble.ScanResult>) => {
Log.showInfo(TAG, `onBLEDeviceFind: BLEDeviceFind arr.length = ${arr.length}, arr = ${JSON.stringify(arr)}`);
let deviceId: string = arr[0].deviceId;
let device = this.mAvailableDevices.find(av... | AST#method_declaration#Left private onBLEDeviceFind AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left A... | private onBLEDeviceFind() {
try {
ble.on('BLEDeviceFind', (arr: Array<ble.ScanResult>) => {
Log.showInfo(TAG, `onBLEDeviceFind: BLEDeviceFind arr.length = ${arr.length}, arr = ${JSON.stringify(arr)}`);
let deviceId: string = arr[0].deviceId;
let device = this.mAvailableDevices.find(av... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets#L198-L223 | aac6b5d0e200d7f242ac29b72a1cd9025952afff | gitee |
FantasyWind/fwrouter | eea785a7bf728862de1f88de487ef3857dee3364 | router/BuildProfile.ets | arkts | Use these variables when you tailor your ArkTS code. They must be of the const type. | export const HAR_VERSION = '0.2.1'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HAR_VERSION = AST#expression#Left '0.2.1' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const HAR_VERSION = '0.2.1'; | https://github.com/FantasyWind/fwrouter/blob/eea785a7bf728862de1f88de487ef3857dee3364/router/BuildProfile.ets#L4-L4 | 98c7f776dbd34ffa84b98fa6a5c60afc42461af2 | gitee | |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.ChipGroup.d.ets | arkts | Defines chip group space.
@interface ChipGroupSpaceOptions
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export interface ChipGroupSpaceOptions {
/**
* Space between items.
*
* @type { ?(string | number) }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
itemSpace?: string | number;
/**
* Start space.
*
* @type {... | AST#export_declaration#Left export AST#interface_declaration#Left interface ChipGroupSpaceOptions AST#object_type#Left { /**
* Space between items.
*
* @type { ?(string | number) }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/ AST#ty... | export interface ChipGroupSpaceOptions {
itemSpace?: string | number;
startSpace?: Length;
endSpace?: Length;
} | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.ChipGroup.d.ets#L214-L245 | 0b22e5a527cd46f0770b52a06147a282dc7961a3 | github | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/MultipleDialog/entry/src/main/ets/common/utils/CommonUtils.ets | arkts | datePickerDialog | Date dialog dialog | datePickerDialog(dateCallback: (birthValue: string) => void) {
DatePickerDialog.show({
start: new Date(CommonConstants.START_TIME),
end: new Date(),
selected: new Date(CommonConstants.SELECT_TIME),
lunar: false,
onAccept: (value: DatePickerResult) => {
let year = value.year as ... | AST#method_declaration#Left datePickerDialog AST#parameter_list#Left ( AST#parameter#Left dateCallback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left birthValue : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#pa... | datePickerDialog(dateCallback: (birthValue: string) => void) {
DatePickerDialog.show({
start: new Date(CommonConstants.START_TIME),
end: new Date(),
selected: new Date(CommonConstants.SELECT_TIME),
lunar: false,
onAccept: (value: DatePickerResult) => {
let year = value.year as ... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/MultipleDialog/entry/src/main/ets/common/utils/CommonUtils.ets#L57-L71 | 4e7d5d44d63bae7dd81d37a8f59f91ad2d2c0464 | gitee |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/pages/DetailPage.ets | arkts | pageTransition | 定义页面进入和退出的过渡效果 | pageTransition() {
// 页面进入效果
PageTransitionEnter({ type: RouteType.None, duration: CommonConstants.ANIMATION_SHORT_DURATION })
.slide(SlideEffect.Bottom);
// 页面退出效果
PageTransitionExit({ type: RouteType.None, duration: CommonConstants.ANIMATION_SHORT_DURATION })
.slide(SlideEffect.Bottom);
... | AST#method_declaration#Left pageTransition 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 PageTransitionEnter ( AST#component_parameters#Left { AST#component_parameter#Left type : AST#expr... | pageTransition() {
PageTransitionEnter({ type: RouteType.None, duration: CommonConstants.ANIMATION_SHORT_DURATION })
.slide(SlideEffect.Bottom);
PageTransitionExit({ type: RouteType.None, duration: CommonConstants.ANIMATION_SHORT_DURATION })
.slide(SlideEffect.Bottom);
} | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/pages/DetailPage.ets#L77-L84 | 810ca792783d49e31f2e390924359cc25f7624e0 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/IPC/ObjectTransfer/IPC_Client/entry/src/main/ets/client/cnn/IPC_Client.ets | arkts | connectIpc | 连接服务端 | function connectIpc(context: common.UIAbilityContext, callback: () => void) {
let connect: common.ConnectOptions = {
onConnect: (elementName, remoteProxy) => {
hilog.info(DOMAIN, TAG, 'IpcClient:onConnect.callend(server),elementName:' +
JSON.stringify(elementName));
proxy = remoteProxy;
ob... | AST#function_declaration#Left function connectIpc AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left cal... | function connectIpc(context: common.UIAbilityContext, callback: () => void) {
let connect: common.ConnectOptions = {
onConnect: (elementName, remoteProxy) => {
hilog.info(DOMAIN, TAG, 'IpcClient:onConnect.callend(server),elementName:' +
JSON.stringify(elementName));
proxy = remoteProxy;
ob... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/IPC/ObjectTransfer/IPC_Client/entry/src/main/ets/client/cnn/IPC_Client.ets#L126-L147 | 8d08cdf2f0b370e99c11a3a633e16b14cf5ddd3d | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customscan/src/main/ets/model/ScanSize.ets | arkts | updateXComponentSize | 更新XComponent
@param width
@param height
@param offsetX
@param offsetY | public updateXComponentSize(width: number, height: number, offsetX: number, offsetY: number): void {
logger.info('Start to update XComponent size.');
this.xComponentSize.width = width;
this.xComponentSize.height = height;
this.xComponentSize.offsetX = offsetX;
this.xComponentSize.offsetY = offsetY;
... | AST#method_declaration#Left public updateXComponentSize AST#parameter_list#Left ( AST#parameter#Left width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left height : AST#type_annotation#Left AST#primary_type#Left number AST#... | public updateXComponentSize(width: number, height: number, offsetX: number, offsetY: number): void {
logger.info('Start to update XComponent size.');
this.xComponentSize.width = width;
this.xComponentSize.height = height;
this.xComponentSize.offsetX = offsetX;
this.xComponentSize.offsetY = offsetY;
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customscan/src/main/ets/model/ScanSize.ets#L187-L193 | ab6591deab056cf8d1f14931ef5b4f3d30ca21f3 | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/component/partView/TextPickerComponent.ets | arkts | TextPickerComponent | picker选择器组件 | @ComponentV2
export struct TextPickerComponent {
// 文本数据
@Require @Param options: ITextPickerOptions;
@Require @Param onChange?: (value: string | string[], index: number | number[]) => void;
@Local value: string | string[] = '';
private longestLeftWidthVp: number = 0
private longestRightWidthVp?: number
... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct TextPickerComponent AST#component_body#Left { // 文本数据 AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right AST#decorator#Left @ Param AST#decorator#Right options : AST#type_annotation#Left ... | @ComponentV2
export struct TextPickerComponent {
@Require @Param options: ITextPickerOptions;
@Require @Param onChange?: (value: string | string[], index: number | number[]) => void;
@Local value: string | string[] = '';
private longestLeftWidthVp: number = 0
private longestRightWidthVp?: number
calcula... | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/component/partView/TextPickerComponent.ets#L8-L24 | c1151cd93a9df423360a3c3454a790432bc557c6 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | entry/src/main/ets/pages/crypto/SM2Page.ets | arkts | mock | 非对称密钥 | @MockSetup
mock() {
this.describe = new DescribeBean("SM2", "SM2加解密");
} | AST#method_declaration#Left AST#decorator#Left @ MockSetup AST#decorator#Right mock 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#Ri... | @MockSetup
mock() {
this.describe = new DescribeBean("SM2", "SM2加解密");
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/entry/src/main/ets/pages/crypto/SM2Page.ets#L23-L26 | 852efd1b90cf9d6b6413f3d6b51b996d67e7a7de | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/votingcomponent/src/main/ets/view/VotingComponent.ets | arkts | VotingViewComponent | 功能描述: 本示例介绍使用绘制组件中的Polygon组件配合使用显式动画以及borderRadius实现投票pk组件。
推荐场景: 需要投票pk的场景
核心组件:
1. VotingView: 投票组件
实现步骤:
1. 初始化投票资源属性内容。
@example
@State votingSource: VotingType = new VotingType();
2. 构建投票视图组件。
@example
VotingView({
votingSource: this.votingSource,
votingHandle: (isClick: boolean, notice: string) => {
this.is... | @Component
export struct VotingViewComponent {
// 是否已投票
@State isClick: boolean = false;
// 投票组件下方提示的内容
@State notice: string = '点击上方按钮,选择你的观点';
// 投票资源属性
@State votingSource: VotingType = new VotingType(4, 13);
build() {
Column() {
// 投票主题
Flex({
direction: FlexDirection.Row,
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct VotingViewComponent AST#component_body#Left { // 是否已投票 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right isClick : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Rig... | @Component
export struct VotingViewComponent {
@State isClick: boolean = false;
@State notice: string = '点击上方按钮,选择你的观点';
@State votingSource: VotingType = new VotingType(4, 13);
build() {
Column() {
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.Start
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/votingcomponent/src/main/ets/view/VotingComponent.ets#L47-L109 | 37f2978bfdad58548baff5d41d32e0292579865b | gitee |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/pages/SettingsPage.ets | arkts | confirmEnableNewEpisodeNotification | 确认启用新单集通知 | confirmEnableNewEpisodeNotification(): void {
const buttons: ButtonOptions[] = [
new ButtonOptions('取消', '#999999'),
new ButtonOptions('允许', '#007AFF')
];
UIUtils.showDialog(new DialogOptions(
'新单集通知',
'开启后,当订阅的播客发布新单集时,将会收到通知提醒。\n\n是否允许新单集通知?',
buttons
)).then((index: numb... | AST#method_declaration#Left confirmEnableNewEpisodeNotification AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_decla... | confirmEnableNewEpisodeNotification(): void {
const buttons: ButtonOptions[] = [
new ButtonOptions('取消', '#999999'),
new ButtonOptions('允许', '#007AFF')
];
UIUtils.showDialog(new DialogOptions(
'新单集通知',
'开启后,当订阅的播客发布新单集时,将会收到通知提醒。\n\n是否允许新单集通知?',
buttons
)).then((index: numb... | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/SettingsPage.ets#L277-L297 | 5b05467c67b72861e754ad8b8c330ace76db5358 | github |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/utils/SysUtil.ets | arkts | getStatusBarHeight | 获取状态栏的高度,单位为px。
TODO 改造,此方法放入DialogHub? 或换个方式获取getUIAbilityContext
@returns | static getStatusBarHeight(uiContext?: common.UIAbilityContext): number {
try {
if (!uiContext) {
uiContext = DialogHub.getUIAbilityContext();
}
let height = uiContext.windowStage.getMainWindowSync()
.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM)
.topRect.height;
... | AST#method_declaration#Left static getStatusBarHeight AST#parameter_list#Left ( AST#parameter#Left uiContext ? : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_... | static getStatusBarHeight(uiContext?: common.UIAbilityContext): number {
try {
if (!uiContext) {
uiContext = DialogHub.getUIAbilityContext();
}
let height = uiContext.windowStage.getMainWindowSync()
.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM)
.topRect.height;
... | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/utils/SysUtil.ets#L64-L79 | 6883f4dd77b78a3adac0cdfe7286a7f57f1b08fb | github |
Classaspen/ArkTS_PasswordManagement.git | 66aea6e4f8ee3a78e5029c63186dba70707ca2d9 | entry/src/main/ets/components/database/Database.ets | arkts | checkTableSchema | 单独的校验方法 | private async checkTableSchema(tableName: string): Promise<void> {
if(this.store) {
try {
const actualColumns = await this.getTableColumns(this.store, tableName);
const expectedColumns = ['id', 'name', 'content', 'timestamp'];
// 简化的校验逻辑
if (actualColumns.length !== expectedCo... | AST#method_declaration#Left private async checkTableSchema AST#parameter_list#Left ( AST#parameter#Left tableName : 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#g... | private async checkTableSchema(tableName: string): Promise<void> {
if(this.store) {
try {
const actualColumns = await this.getTableColumns(this.store, tableName);
const expectedColumns = ['id', 'name', 'content', 'timestamp'];
if (actualColumns.length !== expectedColumns.leng... | https://github.com/Classaspen/ArkTS_PasswordManagement.git/blob/66aea6e4f8ee3a78e5029c63186dba70707ca2d9/entry/src/main/ets/components/database/Database.ets#L74-L99 | ff07961aa3e1f963424236e1f3224afe335ff9cf | github |
zhongte/TaoYao | 80850f3800dd6037216d3f7c58a2bf34a881c93f | entry/src/main/ets/pages/Index.ets | arkts | contactPicker | 联系人选择器,通过联系人选择器获取联系人,不需要申请通讯录权限。
如果申请通讯录权限,应用就能获取到所有的联系人,联系人选择器只允许应用获取到用户选择的联系人 | contactPicker() {
TaoYao.with(this.context)
.contact()
.onSuccess((data) => {
// 联系人列表
if (data.length > 0) {
// 联系人名称
console.log("yunfei", data[0].name?.fullName)
// 联系人号码
console.log("yunfei", data[0]?.phoneNumbers?.[0]?.phoneNumber)
}
... | AST#method_declaration#Left contactPicker AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#m... | contactPicker() {
TaoYao.with(this.context)
.contact()
.onSuccess((data) => {
if (data.length > 0) {
console.log("yunfei", data[0].name?.fullName)
console.log("yunfei", data[0]?.phoneNumbers?.[0]?.phoneNumber)
}
})
.onError((... | https://github.com/zhongte/TaoYao/blob/80850f3800dd6037216d3f7c58a2bf34a881c93f/entry/src/main/ets/pages/Index.ets#L141-L159 | 03818486520474aa7b325565c259881a5e188bef | gitee |
iotjin/JhHarmonyDemo.git | 819e6c3b1db9984c042a181967784550e171b2e8 | JhCommon/src/main/ets/JhCommon/utils/JhColorUtils.ets | arkts | randomColor | / 取随机颜色 | public static randomColor() {
return RandomUtil.getRandomColor()
} | AST#method_declaration#Left public static randomColor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left RandomUtil AST#express... | public static randomColor() {
return RandomUtil.getRandomColor()
} | https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/utils/JhColorUtils.ets#L10-L12 | c1328320af4ad67546b42156875141c2ab3aca02 | github |
longchenxu123/HongmengDemoPandaCommunity.git | 331aee32e89ac94764e63aa6d0c8c458201b7df8 | entry/src/main/ets/pages/views/orderView.ets | arkts | TextItem | 自定义构建函数 可以定义全局 也可以定义 局部 | @Builder TextItem(item:string, index: number) {
Row() {
if (this.tabsIndex === index) {
Text(item + '').fontColor($r('app.color.start_window_backgroundMain')).border({
width: { bottom: 4 },
color: { bottom: $r('app.color.start_window_backgroundMain') }
}).padding({bottom: 3... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right TextItem AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left index : AST#type_annotation#Left AST#p... | @Builder TextItem(item:string, index: number) {
Row() {
if (this.tabsIndex === index) {
Text(item + '').fontColor($r('app.color.start_window_backgroundMain')).border({
width: { bottom: 4 },
color: { bottom: $r('app.color.start_window_backgroundMain') }
}).padding({bottom: 3... | https://github.com/longchenxu123/HongmengDemoPandaCommunity.git/blob/331aee32e89ac94764e63aa6d0c8c458201b7df8/entry/src/main/ets/pages/views/orderView.ets#L44-L58 | 8964ce25daced45a0688a92f0180e1ff670d1123 | github |
openharmony/applications_settings | aac607310ec30e30d1d54db2e04d055655f72730 | product/phone/src/main/ets/model/accessibilityImpl/ExtensionServiceManagementModel.ets | arkts | app management service class | export class ExtensionServiceManagementModel extends BaseModel {
private serviceInfoList: serviceItem[] = [];
constructor() {
super();
try {
let context = GlobalContext.getContext().getObject(GlobalContext.globalKeySettingsAbilityContext) as Context;
context.resourceManager.getMediaBase64ByName... | AST#export_declaration#Left export AST#class_declaration#Left class ExtensionServiceManagementModel extends AST#type_annotation#Left AST#primary_type#Left BaseModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#property_declaration#Left private serviceInfoList : AST#type_annotation#Left AST... | export class ExtensionServiceManagementModel extends BaseModel {
private serviceInfoList: serviceItem[] = [];
constructor() {
super();
try {
let context = GlobalContext.getContext().getObject(GlobalContext.globalKeySettingsAbilityContext) as Context;
context.resourceManager.getMediaBase64ByName... | https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/product/phone/src/main/ets/model/accessibilityImpl/ExtensionServiceManagementModel.ets#L55-L258 | 41ffb8a006dc7fd9873d22ee151306e52baf5457 | gitee | |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/DES.ets | arkts | encryptECBSync | 加密(ECB模式),异步
@param data 加密或者解密的数据。data不能为null。
@param symKey 指定加密或解密的密钥。
@returns | static encryptECBSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey): cryptoFramework.DataBlob {
return DES.encryptSync(data, symKey, null, '3DES192|ECB|PKCS7');
} | AST#method_declaration#Left static encryptECBSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKe... | static encryptECBSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey): cryptoFramework.DataBlob {
return DES.encryptSync(data, symKey, null, '3DES192|ECB|PKCS7');
} | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/DES.ets#L42-L44 | a6704d00efffba5cdc4e9caa0fee2a9f1b84ba52 | github |
dcm23333/FishManager.git | 952dde4475268ac16f3480f3d55f82033aa6b467 | FishManager/entry/src/main/ets/common/contants/commonContants.ets | arkts | ‘12%’ | export const THOUSANDTH_160: string = '16%'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left THOUSANDTH_160 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '16%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declar... | export const THOUSANDTH_160: string = '16%'; | https://github.com/dcm23333/FishManager.git/blob/952dde4475268ac16f3480f3d55f82033aa6b467/FishManager/entry/src/main/ets/common/contants/commonContants.ets#L53-L53 | 3c5b22920030245865d0f8b70e9295eff002fe2c | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/widgets/pages/WidgetCard2x4.ets | arkts | buildHeader | 构建头部 | @Builder
buildHeader() {
Row() {
Image($r('app.media.ic_birthday_cake'))
.width(20)
.height(20)
.fillColor($r('app.color.primary'))
Text('生日提醒')
.fontSize(16)
.fontColor($r('app.color.text_primary'))
.fontWeight(FontWeight.Medium)
.layoutWeight(... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildHeader 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... | @Builder
buildHeader() {
Row() {
Image($r('app.media.ic_birthday_cake'))
.width(20)
.height(20)
.fillColor($r('app.color.primary'))
Text('生日提醒')
.fontSize(16)
.fontColor($r('app.color.text_primary'))
.fontWeight(FontWeight.Medium)
.layoutWeight(... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/widgets/pages/WidgetCard2x4.ets#L39-L67 | 2c774470a82c5ee003bcccb5dda84bf2a1aead22 | github |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/Base64Utils.ets | arkts | decode | 解码,通过输入参数解码后输出对应Uint8Array对象。
@param array
@returns | static decode(array: Uint8Array | string, options?: util.Type): Promise<Uint8Array> {
let base64 = new util.Base64Helper();
return base64.decode(array, options);
} | AST#method_declaration#Left static decode AST#parameter_list#Left ( AST#parameter#Left array : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Uint8Array AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , A... | static decode(array: Uint8Array | string, options?: util.Type): Promise<Uint8Array> {
let base64 = new util.Base64Helper();
return base64.decode(array, options);
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/Base64Utils.ets#L72-L75 | 6cdab92a421ef36574e38c073fa777d09bbabe74 | gitee |
htliang128/arkts_oss.git | 9da4a87c36272873c649f556854bd793ac337a18 | htliang_oss/src/main/ets/common/comm/CustomHttpRequestOptions.ets | arkts | getMultiFormDataList | Getter and setter for multiFormDataList | getMultiFormDataList(): Array<http.MultiFormData> | undefined {
return this.multiFormDataList;
} | AST#method_declaration#Left getMultiFormDataList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left http . MultiFormData AST... | getMultiFormDataList(): Array<http.MultiFormData> | undefined {
return this.multiFormDataList;
} | https://github.com/htliang128/arkts_oss.git/blob/9da4a87c36272873c649f556854bd793ac337a18/htliang_oss/src/main/ets/common/comm/CustomHttpRequestOptions.ets#L182-L184 | 4199b29c3e4946f2fa6eb32b96a1ef4dd9ab6722 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/clickanimation/src/main/ets/model/ClickIconDataModel.ets | arkts | ClickIconDataSource 类继承自 BasicDataSource<ClickIconItem>,处理图标集合数据源操作
@extends {BasicDataSource<ClickIconItem>} | export class ClickIconDataSource extends BasicDataSource<ClickIconItem> {} | AST#export_declaration#Left export AST#class_declaration#Left class ClickIconDataSource extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left BasicDataSource AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ClickIconItem AST#primary_type#Right AST#type_annotation#Right > A... | export class ClickIconDataSource extends BasicDataSource<ClickIconItem> {} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/clickanimation/src/main/ets/model/ClickIconDataModel.ets#L65-L65 | 2232041021462df5f51e70769a15ecf090ba57bd | gitee | |
IceYuanyyy/OxHornCampus.git | bb5686f77fa36db89687502e35898cda218d601f | entry/src/main/ets/pages/LoginPage.ets | arkts | canSubmit | 检查是否可以提交 | canSubmit(): boolean {
if (this.isResetMode) {
return this.account !== '' && this.newPassword !== '';
} else {
return this.account !== '' && this.password !== '';
}
} | AST#method_declaration#Left canSubmit 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#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST... | canSubmit(): boolean {
if (this.isResetMode) {
return this.account !== '' && this.newPassword !== '';
} else {
return this.account !== '' && this.password !== '';
}
} | https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/pages/LoginPage.ets#L456-L462 | 6c239aaa21da2b0e9668b9bdb85a171cd85fc407 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/advertisingpage/src/main/ets/components/AdvertisingPage.ets | arkts | changeFullScreen | 页面显示打开沉浸式,页面销毁关闭
@param isFull是否需要打开沉浸式 | changeFullScreen(isFull: boolean) {
let context = getContext();
window.getLastWindow(context, (err, window) => {
window.setWindowLayoutFullScreen(isFull);
})
} | AST#method_declaration#Left changeFullScreen AST#parameter_list#Left ( AST#parameter#Left isFull : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration... | changeFullScreen(isFull: boolean) {
let context = getContext();
window.getLastWindow(context, (err, window) => {
window.setWindowLayoutFullScreen(isFull);
})
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/advertisingpage/src/main/ets/components/AdvertisingPage.ets#L49-L54 | 14c50d9a08dd3346b0255dc11738c778bd73d470 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/constants/AppConstants.ets | arkts | 路由常量 | export class RouteConstants {
static readonly INDEX: string = 'pages/Index';
static readonly CONTACT_DETAIL: string = 'pages/ContactDetailPage';
static readonly CONTACT_EDIT: string = 'pages/ContactEditPage';
static readonly CONTACT_IMPORT: string = 'pages/ContactImportPage';
static readonly GREETING_SEND: st... | AST#export_declaration#Left export AST#class_declaration#Left class RouteConstants AST#class_body#Left { AST#property_declaration#Left static readonly INDEX : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'pages/Index' AST#expression#Right ;... | export class RouteConstants {
static readonly INDEX: string = 'pages/Index';
static readonly CONTACT_DETAIL: string = 'pages/ContactDetailPage';
static readonly CONTACT_EDIT: string = 'pages/ContactEditPage';
static readonly CONTACT_IMPORT: string = 'pages/ContactImportPage';
static readonly GREETING_SEND: st... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/constants/AppConstants.ets#L60-L69 | a2342465f0cf4c70a56564ac2de48e5aa90cee00 | github | |
openharmony/update_update_app | 0157b7917e2f48e914b5585991e8b2f4bc25108a | feature/ota/src/main/ets/manager/OtaUpdateManager.ets | arkts | notifyUpdateStatusRemote | 状态刷新
@param otaStatus 状态 | private async notifyUpdateStatusRemote(eventInfo: update.EventInfo): Promise<void> {
this.log(`notifyUpdateStatusRemote ${JSON.stringify(eventInfo)}`);
let message: Message = {
context: globalThis.extensionContext || globalThis.abilityContext,
eventInfo: eventInfo,
};
this.messageQueue.exec... | AST#method_declaration#Left private async notifyUpdateStatusRemote AST#parameter_list#Left ( AST#parameter#Left eventInfo : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left update . EventInfo AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parame... | private async notifyUpdateStatusRemote(eventInfo: update.EventInfo): Promise<void> {
this.log(`notifyUpdateStatusRemote ${JSON.stringify(eventInfo)}`);
let message: Message = {
context: globalThis.extensionContext || globalThis.abilityContext,
eventInfo: eventInfo,
};
this.messageQueue.exec... | https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/manager/OtaUpdateManager.ets#L294-L302 | ad55ae826be4e755344dc0c0dd96d8be3a3c532c | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/h5cache/src/main/ets/diskLruCache/DiskCacheEntry.ets | arkts | setSize | 设置缓存文件大小
@param size 文件大小 | setSize(size: number) {
this.size = size;
} | AST#method_declaration#Left setSize AST#parameter_list#Left ( AST#parameter#Left size : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left... | setSize(size: number) {
this.size = size;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/h5cache/src/main/ets/diskLruCache/DiskCacheEntry.ets#L49-L51 | 284b7c0492dce8bae1f789d73fbb72c3835f56bf | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/ResUtil.ets | arkts | getDeviceCapabilitySync | 获取设备的DeviceCapability
@returns | static getDeviceCapabilitySync(): resourceManager.DeviceCapability {
return ResUtil.getResourceManager().getDeviceCapabilitySync();
} | AST#method_declaration#Left static getDeviceCapabilitySync AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left resourceManager . DeviceCapability AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left {... | static getDeviceCapabilitySync(): resourceManager.DeviceCapability {
return ResUtil.getResourceManager().getDeviceCapabilitySync();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L530-L532 | 9fc92274baa4b9799bfd771d4b8529b5602d27f8 | gitee |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/model/OptionTypes.ets | arkts | 字符串选项接口定义
用于字符串值的下拉选择框等组件的数据结构 | export interface StringOption {
value: string;
label: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface StringOption AST#object_type#Left { AST#type_member#Left value : 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 label : AST#type_annotation#Lef... | export interface StringOption {
value: string;
label: string;
} | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/model/OptionTypes.ets#L14-L17 | e3fdcba1cd5c5d3d4949b19eba4a2e3d63773c21 | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_core/src/main/ets/core/util/StrUtil.ets | arkts | isBlank | 判断字符串是否为空白符(空白符包括空格、制表符、全角空格和不间断空格)true为空,否则false
@param str
@returns | static isBlank(str: string): boolean {
let length: number;
if ((str == null) || ((length = str.length) == 0)) {
return true;
}
for (let i = 0; i < length; i++) {
// 只要有一个非空字符即为非空字符串
if (false == CharUtil.isBlankChar(str.charCodeAt(i))) {
return false;
}
}
return ... | AST#method_declaration#Left static isBlank AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Ri... | static isBlank(str: string): boolean {
let length: number;
if ((str == null) || ((length = str.length) == 0)) {
return true;
}
for (let i = 0; i < length; i++) {
if (false == CharUtil.isBlankChar(str.charCodeAt(i))) {
return false;
}
}
return true;
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/StrUtil.ets#L35-L48 | b8ff9bfdb321808bfe53a6c299acd8db4417aea7 | gitee |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets | arkts | 评论模型 | export interface Comment {
id: number;
postId: number;
userId: number;
content: string;
parentId?: number;
status?: number;
createdAt: string;
updatedAt?: string;
username?: string;
userAvatar?: string;
likeCount?: number;
isLiked?: boolean;
replies?: Comment[];
author?: User;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Comment AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left postId : AST#type_annotation#Left AST#p... | export interface Comment {
id: number;
postId: number;
userId: number;
content: string;
parentId?: number;
status?: number;
createdAt: string;
updatedAt?: string;
username?: string;
userAvatar?: string;
likeCount?: number;
isLiked?: boolean;
replies?: Comment[];
author?: User;
} | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets#L165-L180 | dac18f25bd99481ecb811d847c53dff877ff051a | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/main/src/main/ets/view/NavigationPage.ets | arkts | ResultSection | 结果回传展示区
@returns {void} 无返回值 | @Builder
private ResultSection(): void {
if (this.vm.shouldShowResult()) {
IBestCellGroup({ inset: true, outerMargin: 0 }) {
if (this.vm.hasResultTitle()) {
IBestCell({
title: $r("app.string.main_navigation_result_title_label"),
label: this.vm.resultTitle,
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private ResultSection AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_... | @Builder
private ResultSection(): void {
if (this.vm.shouldShowResult()) {
IBestCellGroup({ inset: true, outerMargin: 0 }) {
if (this.vm.hasResultTitle()) {
IBestCell({
title: $r("app.string.main_navigation_result_title_label"),
label: this.vm.resultTitle,
... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/main/src/main/ets/view/NavigationPage.ets#L76-L98 | cc742a0ddfb4d203ec4f893becd6e6f7400cda82 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Performance/PerformanceLibrary/feature/backgroundTask/src/main/ets/view/TransientTaskView.ets | arkts | requestSuspendDelay | 申请短时任务 | requestSuspendDelay() {
try {
let delayInfo = backgroundTaskManager.requestSuspendDelay('compute', () => {
console.info('Request suspension delay will time out.');
// 任务即将超时,取消短时任务
this.cancelSuspendDelay();
})
this.requestId = delayInfo.requestId;
} catch (error) {
... | AST#method_declaration#Left requestSuspendDelay AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left delayInfo = AST#expression#Left AST#a... | requestSuspendDelay() {
try {
let delayInfo = backgroundTaskManager.requestSuspendDelay('compute', () => {
console.info('Request suspension delay will time out.');
this.cancelSuspendDelay();
})
this.requestId = delayInfo.requestId;
} catch (error) {
console.error... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Performance/PerformanceLibrary/feature/backgroundTask/src/main/ets/view/TransientTaskView.ets#L31-L42 | 1175ffd3102a191fcaaf4682477f801208634b8b | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/myData/WordUserDbAccess.ets | arkts | createDbIfNeeds | ====== 创建表 ====== MARK: - 创建表(完全等价 Java createLearnDbIfNeeded) | createDbIfNeeds(): void {
if (!this.db) return
const sqlLearn = `
CREATE TABLE IF NOT EXISTS ${Tables.Learn.NAME} (
${Tables.Learn.Col.TITLE_EN} TEXT PRIMARY KEY NOT NULL,
${Tables.Learn.Col.LEARN_TIMES} INTEGER NOT NULL,
${Tables.Learn.Col.CORRECTED_TIMES} INTEGER NOT ... | AST#method_declaration#Left createDbIfNeeds AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left ... | createDbIfNeeds(): void {
if (!this.db) return
const sqlLearn = `
CREATE TABLE IF NOT EXISTS ${Tables.Learn.NAME} (
${Tables.Learn.Col.TITLE_EN} TEXT PRIMARY KEY NOT NULL,
${Tables.Learn.Col.LEARN_TIMES} INTEGER NOT NULL,
${Tables.Learn.Col.CORRECTED_TIMES} INTEGER NOT ... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/myData/WordUserDbAccess.ets#L93-L156 | 871be3d66da4b995113de2ca8336fa472aa2893e | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/greetings/GreetingSendPage.ets | arkts | buildSendButton | 构建发送按钮 | @Builder
buildSendButton() {
LoadingButton({
text: '发送祝福',
loadingText: '发送中...',
loading: this.sending,
disabled: !this.customContent.trim(),
backgroundColor: '#ff6b6b',
height: 48,
onButtonClick: () => {
this.sendGreeting();
}
})
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSendButton 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 LoadingButton ( AST#component_parameters#Left { AST#compon... | @Builder
buildSendButton() {
LoadingButton({
text: '发送祝福',
loadingText: '发送中...',
loading: this.sending,
disabled: !this.customContent.trim(),
backgroundColor: '#ff6b6b',
height: 48,
onButtonClick: () => {
this.sendGreeting();
}
})
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/greetings/GreetingSendPage.ets#L574-L587 | c954bb43ca0e2c8c6d448638603a7e5234114688 | github |
JHB11Hinson/mineMointorAPP.git | b6b853cf534021ac39e66c9b3a35113896a272b2 | entry/src/main/ets/common/utils/UserAuthUtil.ets | arkts | startAuth | 发起用户身份认证 | static async startAuth(title: string = '请验证身份以继续'): Promise<boolean> {
const challenge = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
const authType: userAuth.UserAuthType[] = [
userAuth.UserAuthType.PIN,
userAuth.UserAuthType.FACE,
userAuth.UserAuthType.FINGERPRINT
];
// 准备信任等级
con... | AST#method_declaration#Left static async startAuth AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '请验证身份以继续' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_a... | static async startAuth(title: string = '请验证身份以继续'): Promise<boolean> {
const challenge = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
const authType: userAuth.UserAuthType[] = [
userAuth.UserAuthType.PIN,
userAuth.UserAuthType.FACE,
userAuth.UserAuthType.FINGERPRINT
];
const authTr... | https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/common/utils/UserAuthUtil.ets#L8-L73 | a663ebf137afd30975f03cee29bcc6fbed5a8ce1 | github |
openharmony-tpc-incubate/photo-deal-demo | 01382ce30b1785f8fc8bc14f6b94f0a670a5b50b | library/src/main/ets/util/MosaicPixelMapHelper.ets | arkts | process | 根据压缩后的像素图生成马赛克像素图
@param pixelMap 压缩后的像素图
@param oriSize 原图尺寸
@returns Promise<PixelMap | undefined> | static async process(pixelMap: PixelMap, oriSize: image.Size): Promise<PixelMap | undefined> {
let start = Date.now()
try {
let imgInfo = pixelMap.getImageInfoSync()
LoggerWrapper.i(MODULE, TAG, 'process ' + JSON.stringify(imgInfo) + ',oriSize=' + JSON.stringify(oriSize));
let mosaicSize: imag... | AST#method_declaration#Left static async process AST#parameter_list#Left ( AST#parameter#Left pixelMap : AST#type_annotation#Left AST#primary_type#Left PixelMap AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left oriSize : AST#type_annotation#Left AST#primary_type#Left AST#qualifie... | static async process(pixelMap: PixelMap, oriSize: image.Size): Promise<PixelMap | undefined> {
let start = Date.now()
try {
let imgInfo = pixelMap.getImageInfoSync()
LoggerWrapper.i(MODULE, TAG, 'process ' + JSON.stringify(imgInfo) + ',oriSize=' + JSON.stringify(oriSize));
let mosaicSize: imag... | https://github.com/openharmony-tpc-incubate/photo-deal-demo/blob/01382ce30b1785f8fc8bc14f6b94f0a670a5b50b/library/src/main/ets/util/MosaicPixelMapHelper.ets#L59-L85 | b3e6ad1d81846ec12c344969e99ffb444b32569c | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | AppAspectProgrammingDesign/entry/src/main/ets/components/somePackage.ets | arkts | [Start person] somePackage.ets | export class Person {
name: string;
age: number;
constructor(n: string, a: number) {
this.name = n;
this.age = a;
}
getInfo(): string {
return 'name: ' + this.name + ', ' + 'age: ' + this.age.toString();
}
} | AST#export_declaration#Left export AST#class_declaration#Left class Person AST#class_body#Left { AST#property_declaration#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left age : AST#type_annot... | export class Person {
name: string;
age: number;
constructor(n: string, a: number) {
this.name = n;
this.age = a;
}
getInfo(): string {
return 'name: ' + this.name + ', ' + 'age: ' + this.age.toString();
}
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/AppAspectProgrammingDesign/entry/src/main/ets/components/somePackage.ets#L29-L39 | 458dd2292ad997eba2bcf76dc8f3068b9e60865b | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/components/listAndGrid/waterFlowSample/WaterFlowDataSource.ets | arkts | 实现IDataSource接口的对象,用于瀑布流组件加载数据 | export class WaterFlowDataSource implements IDataSource {
private dataArray: number[] = []
private listeners: DataChangeListener[] = []
constructor | AST#export_declaration#Left export AST#ERROR#Left class WaterFlowDataSource AST#implements_clause#Left implements IDataSource AST#implements_clause#Right { AST#property_declaration#Left private dataArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_typ... | export class WaterFlowDataSource implements IDataSource {
private dataArray: number[] = []
private listeners: DataChangeListener[] = []
constructor | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/components/listAndGrid/waterFlowSample/WaterFlowDataSource.ets#L225-L229 | 5f9688b74f3555eb092f0821b40a21af569ee7e7 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/PasteboardUtil.ets | arkts | clearData | 清空系统剪贴板内容,使用Promise异步回调。
@returns | static async clearData(): Promise<void> {
PasteboardUtil.getSystemPasteboard().clearData();
} | AST#method_declaration#Left static async clearData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type... | static async clearData(): Promise<void> {
PasteboardUtil.getSystemPasteboard().clearData();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L357-L359 | 7f39e74e89d197d0391b25f5b0420eff6eda4763 | gitee |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | ETSUI/BusinessSample/entry/src/main/ets/viewmodel/BusinessViewModel.ets | arkts | getListItems | Get list items.
@return {Array<ListItemData>} listItems. | getListItems(): Array<ListItemData> {
let widgets: Array<WidgetType> = [WidgetType.TOGGLE, WidgetType.INFO, WidgetType.TEXT, WidgetType.default];
let listItems: Array<ListItemData> = [];
for (let i = 0; i < widgets.length; i++) {
for (let j = 0; j < CommonConstants.REPEAT_TIMES; j++) {
let car... | AST#method_declaration#Left getListItems AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ListItemData AST#primary_type#Right AST#type_annotation#Right > AST#type_arg... | getListItems(): Array<ListItemData> {
let widgets: Array<WidgetType> = [WidgetType.TOGGLE, WidgetType.INFO, WidgetType.TEXT, WidgetType.default];
let listItems: Array<ListItemData> = [];
for (let i = 0; i < widgets.length; i++) {
for (let j = 0; j < CommonConstants.REPEAT_TIMES; j++) {
let car... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/BusinessSample/entry/src/main/ets/viewmodel/BusinessViewModel.ets#L15-L28 | ea2b62e21dc8632612423a66564e0d11542997ab | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/utils/EncryptUtils.ets | arkts | sha256 | SHA256 哈希 | static async sha256(text: string): Promise<string> {
try {
// 实际实现需要使用 cryptoFramework
return `sha256_${text}`;
} catch (error) {
return '';
}
} | AST#method_declaration#Left static async sha256 AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left... | static async sha256(text: string): Promise<string> {
try {
return `sha256_${text}`;
} catch (error) {
return '';
}
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/EncryptUtils.ets#L25-L32 | 1917a59a5cc298491f8782e5f1a34ad34afac3fa | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/navigation/src/main/ets/order/OrderParam.ets | arkts | 订单评价参数 | export interface OrderCommentParam extends OrderIdParam, GoodsIdParam {} | AST#export_declaration#Left export AST#interface_declaration#Left interface OrderCommentParam AST#extends_clause#Left extends OrderIdParam , GoodsIdParam AST#extends_clause#Right AST#object_type#Left { } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right | export interface OrderCommentParam extends OrderIdParam, GoodsIdParam {} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/order/OrderParam.ets#L35-L35 | 33bfe4ac8d031c9b9ad9c432fca5d4af66bb7dda | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/GreetingTypes.ets | arkts | 祝福语状态枚举 | export enum GreetingStatus {
DRAFT = 'draft', // 草稿
ACTIVE = 'active', // 活跃
SENT = 'sent', // 已发送
DELIVERED = 'delivered', // 已送达
READ = 'read', // 已读
FAILED = 'failed', // 发送失败
ARCHIVED = 'archived' // 已归档
} | AST#export_declaration#Left export AST#enum_declaration#Left enum GreetingStatus AST#enum_body#Left { AST#enum_member#Left DRAFT = AST#expression#Left 'draft' AST#expression#Right AST#enum_member#Right , // 草稿 AST#enum_member#Left ACTIVE = AST#expression#Left 'active' AST#expression#Right AST#enum_member#Right , // 活跃 ... | export enum GreetingStatus {
DRAFT = 'draft',
ACTIVE = 'active',
SENT = 'sent',
DELIVERED = 'delivered',
READ = 'read',
FAILED = 'failed',
ARCHIVED = 'archived'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GreetingTypes.ets#L114-L122 | f8da8d58176bf32824021fb0a56a86c97f703703 | github | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/listener/OnChartValueSelectedListener.ets | arkts | Listener for callbacks when selecting values inside the chart by
touch-gesture.
@author Philipp Jahoda | export default interface | AST#export_declaration#Left export default AST#expression#Left interface AST#expression#Right AST#export_declaration#Right | export default interface | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/listener/OnChartValueSelectedListener.ets#L24-L24 | 76329594c43af6cfaeebe86d4268e794176372ca | gitee | |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/control_flow/loop_stmt/for_init_002_F.ets | arkts | Introduction 循环结构-init语句 | export function for_init_002_F(taint_src : string) {
let clean = ""
let _t = taint_src;
let ini = "";
let j = 0;
for (ini = "_"; j < 2; j++) {
clean = clean + ini;
}
taint.Sink(clean);
} | AST#export_declaration#Left export AST#function_declaration#Left function for_init_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#Left... | export function for_init_002_F(taint_src : string) {
let clean = ""
let _t = taint_src;
let ini = "";
let j = 0;
for (ini = "_"; j < 2; j++) {
clean = clean + ini;
}
taint.Sink(clean);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/control_flow/loop_stmt/for_init_002_F.ets#L6-L15 | c977d3bbabb58af6ea6703f3b745aefce6e50ecd | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/miniplayeranimation/Index.ets | arkts | MiniPlayerAnimation | 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 { MiniPlayerAnimation } from './src/main/ets/view/MiniPlayerAnimation'; | AST#export_declaration#Left export { MiniPlayerAnimation } from './src/main/ets/view/MiniPlayerAnimation' ; AST#export_declaration#Right | export { MiniPlayerAnimation } from './src/main/ets/view/MiniPlayerAnimation'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/miniplayeranimation/Index.ets#L16-L16 | 2099ed49c944a40a816166c155b1ff6631968671 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/PasteboardUtil.ets | arkts | clearDataSync | 清空系统剪贴板内容。
@returns | static clearDataSync() {
PasteboardUtil.getSystemPasteboard().clearDataSync();
} | AST#method_declaration#Left static clearDataSync AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Lef... | static clearDataSync() {
PasteboardUtil.getSystemPasteboard().clearDataSync();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L365-L367 | 94c1138ef3f7f7e38db9ec953790017d80fc0707 | gitee |
yangsongming/ArkTs-HuXiHelper.git | ed148299fc6dcf351bcc0f2863a5aee4885fbaf5 | ets/viewmodel/CollegesItem.ets | arkts | Item info of the zones. | export default class ZonesItem {
id: number = 0;
title: ResourceStr = $r('app.string.area_name_a');
subTitle: ResourceStr = $r('app.string.area_sub_name_a');
createTime: ResourceStr = $r('app.string.create_year_2015');
content: ResourceStr[] = [];
thumbnail: ResourceStr = $r('app.media.ic_thumbnail_a');
s... | AST#export_declaration#Left export default AST#class_declaration#Left class ZonesItem AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Ri... | export default class ZonesItem {
id: number = 0;
title: ResourceStr = $r('app.string.area_name_a');
subTitle: ResourceStr = $r('app.string.area_sub_name_a');
createTime: ResourceStr = $r('app.string.create_year_2015');
content: ResourceStr[] = [];
thumbnail: ResourceStr = $r('app.media.ic_thumbnail_a');
s... | https://github.com/yangsongming/ArkTs-HuXiHelper.git/blob/ed148299fc6dcf351bcc0f2863a5aee4885fbaf5/ets/viewmodel/CollegesItem.ets#L5-L23 | 387456dbd70460a418da53e7c7435e875b5eba37 | github | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/blocks/modules/meowBookmarks.ets | arkts | move_folder | Operations | move_folder() {
this.moving_type = "folder";
this.woofBookmarksPathSelector_control.open();
} | AST#method_declaration#Left move_folder 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 . moving_type AST#member_expression#Righ... | move_folder() {
this.moving_type = "folder";
this.woofBookmarksPathSelector_control.open();
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/blocks/modules/meowBookmarks.ets#L869-L872 | c6de6ea0f6ce6f5fa6b2c88625f3c7b4f572b26e | gitee |
Duke_Bit/logan | 37ce340f90e508cbf3914162df2254aca76a525a | core/src/main/ets/Logan.ets | arkts | @param url 接受日志的服务器完整url.
@param date 日志日期 格式:时间戳.
@param appId 当前应用的唯一标识,在多App时区分日志来源App.
@param unionId 当前用户的唯一标识,用来区分日志来源用户.
@param deviceId 设备id.
@param buildVersion 上报源App的build号.
@param appVersion 上报源的App版本.
@param sendLogCallback 上报结果回调(子线程调用). | export function sendFromDefault(url: string, date:string,appId:string,unionId:string,deviceId:string,buildVersion:string,appVersion:string,sendLogCallback: (statusCode: number) => void){
let header:Map<string,string> = new Map<string,string>()
header.set("fileDate", date);
header.set("appId",appId)
head... | AST#export_declaration#Left export AST#function_declaration#Left function sendFromDefault AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left date : AST#type_annotation#Left AST... | export function sendFromDefault(url: string, date:string,appId:string,unionId:string,deviceId:string,buildVersion:string,appVersion:string,sendLogCallback: (statusCode: number) => void){
let header:Map<string,string> = new Map<string,string>()
header.set("fileDate", date);
header.set("appId",appId)
head... | https://github.com/Duke_Bit/logan/blob/37ce340f90e508cbf3914162df2254aca76a525a/core/src/main/ets/Logan.ets#L67-L82 | ee504ef116127c38f634bc278db2852c8fd94c5f | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/common/types/SettingsTypes.ets | arkts | 安全设置接口 | export interface SecuritySettings {
level: SecurityLevel;
biometricAuth: boolean;
appLock: boolean;
dataEncryption: boolean;
sessionTimeout: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface SecuritySettings AST#object_type#Left { AST#type_member#Left level : AST#type_annotation#Left AST#primary_type#Left SecurityLevel AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left biometricAuth : AST#... | export interface SecuritySettings {
level: SecurityLevel;
biometricAuth: boolean;
appLock: boolean;
dataEncryption: boolean;
sessionTimeout: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/SettingsTypes.ets#L584-L590 | 359899462978e61a7978548cbe34a9752143422c | github | |
buqiuz/Account.git | b843a38c24a833a9a4386f63cffec5fa5dadc674 | oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/charts/RadarChartModel.ets | arkts | getFactor | Returns the factor that is needed to transform values into pixels.
@return | public getFactor(): number {
let content: MyRect = this.mViewPortHandler.getContentRect();
return Math.min(content.width() / 2, content.height() / 2) / this.mYAxis.mAxisRange * 0.7;
} | AST#method_declaration#Left public getFactor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left content ... | public getFactor(): number {
let content: MyRect = this.mViewPortHandler.getContentRect();
return Math.min(content.width() / 2, content.height() / 2) / this.mYAxis.mAxisRange * 0.7;
} | https://github.com/buqiuz/Account.git/blob/b843a38c24a833a9a4386f63cffec5fa5dadc674/oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/charts/RadarChartModel.ets#L181-L184 | 1a262ec981f5f89b2ee04ffd140bb1fd204cb38a | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/ChannelDelete.ets | arkts | 应用约束18: 构造函数参数需在类字段中声明 | constructor(client: any) {
super(client);
this.client = client;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left client : AST#type_annotation#Left AST#primary_type#Left any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Lef... | constructor(client: any) {
super(client);
this.client = client;
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/ChannelDelete.ets#L10-L13 | efbc58a8f542242b72a3161bb065102b8ba01306 | github | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_history_index_lite.ets | arkts | clear | Clears index by setting it a new empty Map. | static clear() {
bunch_of_history_index_lite.index_map = new collections.Map<string, collections.Array<number>>();
} | AST#method_declaration#Left static clear 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 bunch_of_history_index_lite AST#expression#Right . index_map AST#... | static clear() {
bunch_of_history_index_lite.index_map = new collections.Map<string, collections.Array<number>>();
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history_index_lite.ets#L20-L22 | cdea5a12ef52c38d1ced946e3a65ffa231cb37d5 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | NavigationRouter/RouterModule/src/main/ets/utils/RouterModule.ets | arkts | registerBuilder | [StartExclude class_routerModule] [Start static_registerBuilder] 通过名称注册路由栈 | public static registerBuilder(builderName: string, builder: WrappedBuilder<[object]>): void {
RouterModule.builderMap.set(builderName, builder);
} | AST#method_declaration#Left public static registerBuilder AST#parameter_list#Left ( AST#parameter#Left builderName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left builder : AST#type_annotation#Left AST#primary_type#Left AS... | public static registerBuilder(builderName: string, builder: WrappedBuilder<[object]>): void {
RouterModule.builderMap.set(builderName, builder);
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NavigationRouter/RouterModule/src/main/ets/utils/RouterModule.ets#L28-L30 | 1a77a66d7a44548920de817b7cec8e85deda6334 | gitee |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets | arkts | 认证响应 | export interface AuthResponse {
user: UserInfo;
token: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface AuthResponse AST#object_type#Left { AST#type_member#Left user : AST#type_annotation#Left AST#primary_type#Left UserInfo AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left token : AST#type_annotation#Le... | export interface AuthResponse {
user: UserInfo;
token: string;
} | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets#L288-L291 | 261e4fae438e22a567d846705af865d6cf6282e7 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/utils/LunarCalendar.ets | arkts | getSolarFestival | 获取公历节日
@param month 公历月
@param day 公历日
@returns 节日名称,无节日返回空字符串 | static getSolarFestival(month: number, day: number): string {
const festivals: Record<string, string> = {
'1-1': '元旦',
'2-14': '情人节',
'3-8': '妇女节',
'3-12': '植树节',
'4-1': '愚人节',
'4-4': '清明节',
'4-5': '清明节',
'4-22': '世界地球日',
'5-1': '劳动节',
'5-4': '青年节',
... | AST#method_declaration#Left static getSolarFestival AST#parameter_list#Left ( AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left day : AST#type_annotation#Left AST#primary_type#Left number AST#primary... | static getSolarFestival(month: number, day: number): string {
const festivals: Record<string, string> = {
'1-1': '元旦',
'2-14': '情人节',
'3-8': '妇女节',
'3-12': '植树节',
'4-1': '愚人节',
'4-4': '清明节',
'4-5': '清明节',
'4-22': '世界地球日',
'5-1': '劳动节',
'5-4': '青年节',
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/utils/LunarCalendar.ets#L451-L477 | 6fc91912ff25aff342232db705354bc9e821fe42 | github |
linwu-hi/open_neteasy_cloud.git | b562a70ffdbee5e192a1c3fb7fc8a4fb27119af4 | entry/src/main/ets/view/CategoryComponent.ets | arkts | CategoryComponent | This is the list of category item. | @Component
export struct CategoryComponent {
private listData: Array<ListItemData>;
build() {
Column() {
List() {
ForEach(this.listData, (listItemData: ListItemData) => {
ListItem() {
Row() {
Text(listItemData.title)
.fontSize($r('app.float.sub_... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CategoryComponent AST#component_body#Left { AST#property_declaration#Left private listData : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Lef... | @Component
export struct CategoryComponent {
private listData: Array<ListItemData>;
build() {
Column() {
List() {
ForEach(this.listData, (listItemData: ListItemData) => {
ListItem() {
Row() {
Text(listItemData.title)
.fontSize($r('app.float.sub_... | https://github.com/linwu-hi/open_neteasy_cloud.git/blob/b562a70ffdbee5e192a1c3fb7fc8a4fb27119af4/entry/src/main/ets/view/CategoryComponent.ets#L8-L60 | 336950fae541314119c617bf73490f1af9e5be84 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/DetailMenuPanel.ets | arkts | DetailMenuPanel | Large picture button for dynamic refresh | @Component
export struct DetailMenuPanel {
@Link actionBarProp: ActionBarProp;
onMenuClicked: Function | null = null;
build() {
Row() {
ForEach(this.actionBarProp.getMenuList(), (menu: Action): void => {
ActionBarButton({
res: menu.iconRes,
action: menu,
onMenuClic... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct DetailMenuPanel AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right actionBarProp : AST#type_annotation#Left AST#primary_type#Left ActionBarProp AST#primary_type#Right... | @Component
export struct DetailMenuPanel {
@Link actionBarProp: ActionBarProp;
onMenuClicked: Function | null = null;
build() {
Row() {
ForEach(this.actionBarProp.getMenuList(), (menu: Action): void => {
ActionBarButton({
res: menu.iconRes,
action: menu,
onMenuClic... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/DetailMenuPanel.ets#L21-L39 | de648fa13dd115675a180412ee9970048077672d | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/interfaces/LineConfig/CustomGridLineConfig.ets | arkts | Copyright (C) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export interface DashPathEffectConfig {
lineLength: number;
spaceLength: number;
phase: number
} | AST#export_declaration#Left export AST#interface_declaration#Left interface DashPathEffectConfig AST#object_type#Left { AST#type_member#Left lineLength : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left spaceLength : AST#... | export interface DashPathEffectConfig {
lineLength: number;
spaceLength: number;
phase: number
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/interfaces/LineConfig/CustomGridLineConfig.ets#L16-L20 | a5659b0fc20d8fbdd06f9b1724bc016341687de4 | gitee | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@system.router.d.ets | arkts | getParams | Obtains information about the current page params.
@returns { ParamsInterface } Page params.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 7
@deprecated since 8 | static getParams(): ParamsInterface; | AST#method_declaration#Left static getParams AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ParamsInterface AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right | static getParams(): ParamsInterface; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@system.router.d.ets#L282-L282 | f831c755b5a88d60641520ebc924e48881940ad7 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/constant/CommonConstant.ets | arkts | The request content type enum. | export const enum ContentType {
JSON = 'application/json'
} | AST#export_declaration#Left export AST#enum_declaration#Left const enum ContentType AST#enum_body#Left { AST#enum_member#Left JSON = AST#expression#Left 'application/json' AST#expression#Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right | export const enum ContentType {
JSON = 'application/json'
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/constant/CommonConstant.ets#L227-L229 | 93af37f6b0e3568b702625217a39305cdbc8de15 | gitee | |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_alignRules02/entry/src/main/ets/MainAbility/view/position/FlowItemView.ets | arkts | FlowItemView | 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 FlowItemView {
@Link _position: Position;
private componentKey: string;
private parentWidth: number;
private parentHeight: number;
private parentComponentKey: string;
private referenceComponentKey: string;
build() {
Column({ space: 2 }) {
WaterFlow() {
FlowItem(... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FlowItemView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right _position : AST#type_annotation#Left AST#primary_type#Left Position AST#primary_type#Right AST#type_an... | @Component
export struct FlowItemView {
@Link _position: Position;
private componentKey: string;
private parentWidth: number;
private parentHeight: number;
private parentComponentKey: string;
private referenceComponentKey: string;
build() {
Column({ space: 2 }) {
WaterFlow() {
FlowItem(... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_alignRules02/entry/src/main/ets/MainAbility/view/position/FlowItemView.ets#L16-L57 | 860ded378138b9ad51abb80a39ce2d46fe175f1f | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_ui/src/main/ets/ui/base/WindowUtil.ets | arkts | @Author csx
@DateTime 2024/4/3 09:11:04
@TODO WindowUtil 提供对窗口的工具类
@Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_ui | export class WindowUtil {
/**
* 缓存窗体,关闭时需要
*/
private static cacheWindow: window.Window;
/**
* 根据参数创建窗口
* @param options
* @returns
*/
static async createWindow(options: WinOptions): Promise<void> {
if (!options) {
options = new WinOptions();
}
if (!options.name) {
opt... | AST#export_declaration#Left export AST#class_declaration#Left class WindowUtil AST#class_body#Left { /**
* 缓存窗体,关闭时需要
*/ AST#property_declaration#Left private static cacheWindow : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right... | export class WindowUtil {
private static cacheWindow: window.Window;
static async createWindow(options: WinOptions): Promise<void> {
if (!options) {
options = new WinOptions();
}
if (!options.name) {
options.name = 'eftool';
}
if (options.windowType == undefined) {
optio... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/base/WindowUtil.ets#L28-L84 | 0ff5c37712aa2e4e162c6254e60e7ce591f62beb | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/auth/src/main/ets/viewmodel/ResetPasswordViewModel.ets | arkts | updateNewPassword | 更新新密码
@param {string} value - 新密码
@returns {void} 无返回值 | updateNewPassword(value: string): void {
} | AST#method_declaration#Left updateNewPassword 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 void AST#primary_type#... | updateNewPassword(value: string): void {
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/auth/src/main/ets/viewmodel/ResetPasswordViewModel.ets#L30-L31 | a5183eacf10dc74eabc7dde8b3510b0c41bc0ab2 | github |
dcm23333/FishManager.git | 952dde4475268ac16f3480f3d55f82033aa6b467 | FishManager/entry/src/main/ets/common/contants/commonContants.ets | arkts | ‘42%’ | export const THOUSANDTH_500: string = '50%'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left THOUSANDTH_500 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '50%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declar... | export const THOUSANDTH_500: string = '50%'; | https://github.com/dcm23333/FishManager.git/blob/952dde4475268ac16f3480f3d55f82033aa6b467/FishManager/entry/src/main/ets/common/contants/commonContants.ets#L56-L56 | 3ffef6d3c1bd85ca947a4f76e26dd5daca85a2f4 | github | |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/viewmodel/WorldClockViewModel.ets | arkts | addCity | 添加城市到城市列表中。
@param city 要添加的城市 | public addCity(city: CityItem) {
this.cities.push(city)
this.setCitiesToDatabase()
} | AST#method_declaration#Left public addCity AST#parameter_list#Left ( AST#parameter#Left city : AST#type_annotation#Left AST#primary_type#Left CityItem AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expres... | public addCity(city: CityItem) {
this.cities.push(city)
this.setCitiesToDatabase()
} | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/viewmodel/WorldClockViewModel.ets#L127-L130 | 016faa20a7cb17b9f4207b487e2177cd65800e97 | github |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_commonAttrsVisual/ace_ets_module_commonAttrsVisual_api11/entry/src/main/ets/MainAbility/pages/imageEffects/common.ets | arkts | popupBuilder | popup构造器定义弹框内容 | @Builder
popupBuilder() {
Row({ space: 2 }) {
Text('Custom Popup')
.fontSize(10)
}
.width(100)
.height(50)
.padding(5)
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right popupBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( AST#component_parameters#Left { AST#component_parameter... | @Builder
popupBuilder() {
Row({ space: 2 }) {
Text('Custom Popup')
.fontSize(10)
}
.width(100)
.height(50)
.padding(5)
} | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_commonAttrsVisual/ace_ets_module_commonAttrsVisual_api11/entry/src/main/ets/MainAbility/pages/imageEffects/common.ets#L25-L34 | c1564f5aeb5809bdeaa9f6981aaf807b1d3e161a | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/ResUtil.ets | arkts | addResource | 应用运行时,加载指定的资源路径,实现资源覆盖。
@param path 资源路径。
@returns | static addResource(path: string) {
ResUtil.getResourceManager().addResource(path);
} | AST#method_declaration#Left static addResource 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#builder_function_body#Left { AST#expression_statement#Left AST#expr... | static addResource(path: string) {
ResUtil.getResourceManager().addResource(path);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L548-L550 | 6217af0536d25856b4ca0919114ad8fd6847a956 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Security/PaySecurely/cloud/Index.ets | arkts | MerchantServer | 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... | export { MerchantServer } from './src/main/ets/MerchantServer' | AST#export_declaration#Left export { MerchantServer } from './src/main/ets/MerchantServer' AST#export_declaration#Right | export { MerchantServer } from './src/main/ets/MerchantServer' | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Security/PaySecurely/cloud/Index.ets#L16-L16 | 7763879302570de5454bb11c7c055f93be23c6fc | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/blocks/modules/meowAppSettings.ets | arkts | version_clicked | Called when clicking the version code in Settings - About.
Activates the Devs Ops. | version_clicked() {
this.version_clicked_times += 1;
if (this.version_clicked_times == 7) {
// Enter Dev mode
bunch_of_settings.set('DEV_MODE', true);
}
} | AST#method_declaration#Left version_clicked 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 . version_clicked_times AST#member_e... | version_clicked() {
this.version_clicked_times += 1;
if (this.version_clicked_times == 7) {
bunch_of_settings.set('DEV_MODE', true);
}
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/blocks/modules/meowAppSettings.ets#L1735-L1741 | be6d28726f9fe0d01ad009e8a0b387534359e7c5 | gitee |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/common/util/GlobalContext.ets | arkts | getObject | 获取指定键对应的对象。
@param key 对象的键
@return 对应的对象,如果不存在则返回 undefined | getObject(key: string): Object | undefined {
return this._objects.get(key);
} | AST#method_declaration#Left getObject AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Object AST#p... | getObject(key: string): Object | undefined {
return this._objects.get(key);
} | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/common/util/GlobalContext.ets#L29-L31 | 42863941767d78998c8d510a98adbd9dce4ceef4 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/chat/AIAssistantPage.ets | arkts | buildAssistantMessage | 构建助手消息 | @Builder
buildAssistantMessage(message: ChatMessage) {
Row({ space: 12 }) {
// 助手头像
Circle({ width: 32, height: 32 })
.fill($r('app.color.primary'))
.overlay(
Image($r('app.media.ic_robot'))
.width('20vp')
.height('20vp')
.fillColor(Color.W... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildAssistantMessage AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left ChatMessage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder... | @Builder
buildAssistantMessage(message: ChatMessage) {
Row({ space: 12 }) {
Circle({ width: 32, height: 32 })
.fill($r('app.color.primary'))
.overlay(
Image($r('app.media.ic_robot'))
.width('20vp')
.height('20vp')
.fillColor(Color.White)
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/chat/AIAssistantPage.ets#L219-L266 | 9bac9a677f4699b23dfc85a17f15f694bdc34539 | github |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/entryability/EntryAbility.ets | arkts | onWindowStageCreate | 窗口阶段创建时调用。
@param windowStage 创建的窗口阶段 | async onWindowStageCreate(windowStage: window.WindowStage) {
// AlarmClock 窗口已创建,为该能力设置主页面
let globalDisplay: display.Display = display.getDefaultDisplaySync();
// 在全局上下文中设置全局对象实例
GlobalContext.getContext().setObject('globalDisplay', globalDisplay);
let preference = GlobalContext.getContext().getObj... | AST#method_declaration#Left async onWindowStageCreate AST#parameter_list#Left ( AST#parameter#Left windowStage : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . WindowStage AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#... | async onWindowStageCreate(windowStage: window.WindowStage) {
let globalDisplay: display.Display = display.getDefaultDisplaySync();
GlobalContext.getContext().setObject('globalDisplay', globalDisplay);
let preference = GlobalContext.getContext().getObject('preference') as PreferencesHandler;
... | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/entryability/EntryAbility.ets#L22-L41 | b6a71c83b9d0b98a3bd301d51b7e188d20008533 | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@system.router.d.ets | arkts | Defines the state of router.
@interface RouterState
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 3
@deprecated since 8
@useinstead ohos.router#RouterState | export interface RouterState {
/**
* Index of the current page in the stack.
* NOTE: The index starts from 1 from the bottom to the top of the stack.
*
* @type { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 3
* @deprecated since 8
*/
index: number;
/**
* Name of the cu... | AST#export_declaration#Left export AST#interface_declaration#Left interface RouterState AST#object_type#Left { /**
* Index of the current page in the stack.
* NOTE: The index starts from 1 from the bottom to the top of the stack.
*
* @type { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @sinc... | export interface RouterState {
index: number;
name: string;
path: string;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@system.router.d.ets#L100-L131 | 7f7b69829bf185642a0cbebd113117b1f619cbe9 | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/ets/module/ImageData.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, soft... | export class ImagesData {
id ?: number
src ?: Resource
name ?: Resource
vibratorFileL ?: string
vibratorFileM ?: string
vibratorFileH ?: string
audioName ?: string
} | AST#export_declaration#Left export AST#class_declaration#Left class ImagesData AST#class_body#Left { AST#property_declaration#Left id AST#ERROR#Left ? : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right AST#ERROR#Left src ? : Resource
name AST#ERROR... | export class ImagesData {
id ?: number
src ?: Resource
name ?: Resource
vibratorFileL ?: string
vibratorFileM ?: string
vibratorFileH ?: string
audioName ?: string
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/ets/module/ImageData.ets#L16-L24 | 862a38ccc66e61e497bca2f3e7ba46d7a13bf929 | gitee | |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/proxy/BaseInputBuilderProxy.ets | arkts | onChange | 输入内容变化时的回调函数
@param onChange StringCalBack = (content: string) => void
@returns | onChange(onChange: StringCallback) {
this.builderOptions.onChange = onChange;
return this
} | AST#method_declaration#Left onChange AST#parameter_list#Left ( AST#parameter#Left onChange : AST#type_annotation#Left AST#primary_type#Left StringCallback AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statemen... | onChange(onChange: StringCallback) {
this.builderOptions.onChange = onChange;
return this
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/BaseInputBuilderProxy.ets#L69-L72 | 05474fc416552b8b01a9ae439c8e52daf9dd5710 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/AppUtil.ets | arkts | offApplicationStateChange | 取消对应用前后台切换事件的监听。使用callback异步回调。仅支持主线程调用。
@param callback 回调函数。取值可以为使用ApplicationContext.on('applicationStateChange')方法定义的callback回调,也可以为空。
如果传入已定义的回调,则取消该监听。如果未传入参数,则取消当前应用对所有前后台切换事件的监听。 | static offApplicationStateChange(callback?: ApplicationStateChangeCallback) {
AppUtil.getApplicationContext().off('applicationStateChange', callback);
} | AST#method_declaration#Left static offApplicationStateChange AST#parameter_list#Left ( AST#parameter#Left callback ? : AST#type_annotation#Left AST#primary_type#Left ApplicationStateChangeCallback AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#L... | static offApplicationStateChange(callback?: ApplicationStateChangeCallback) {
AppUtil.getApplicationContext().off('applicationStateChange', callback);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/AppUtil.ets#L274-L276 | 5ab41a5b970728ea4dd96b5c5424750fa946bb73 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | buildStatsOverview | 数据概览卡片 | @Builder
buildStatsOverview() {
Column({ space: 16 }) {
Row() {
Text('数据概览')
.fontSize(this.getFontSize(18))
.fontWeight(FontWeight.Medium)
.fontColor(this.COLORS.textPrimary)
.layoutWeight(1)
Text('查看详情')
.fontSize(this.getFontSize(14))
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildStatsOverview AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_... | @Builder
buildStatsOverview() {
Column({ space: 16 }) {
Row() {
Text('数据概览')
.fontSize(this.getFontSize(18))
.fontWeight(FontWeight.Medium)
.fontColor(this.COLORS.textPrimary)
.layoutWeight(1)
Text('查看详情')
.fontSize(this.getFontSize(14))
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L1349-L1405 | 953002003eb5e98a611ba700971ea3958a3e10b8 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/TempUtil.ets | arkts | C2F | 摄氏度转华氏度
@param c 摄氏度
@return 华氏度 | static C2F(c: number): number {
return c * (9 / 5) + 32
} | AST#method_declaration#Left static C2F AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST... | static C2F(c: number): number {
return c * (9 / 5) + 32
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/TempUtil.ets#L30-L32 | f928d104bfe954da285fbbf4d582ccf8811c8509 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | VideoPlayerSample/entry/src/main/ets/model/BasicDataSource.ets | arkts | notifyDataAdd | Notify the LazyForEach component to add a child component at the index corresponding to the specified index. | notifyDataAdd(index: number): void {
this.listeners.forEach((listener: DataChangeListener) => {
listener.onDataAdd(index);
})
} | AST#method_declaration#Left notifyDataAdd AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Righ... | notifyDataAdd(index: number): void {
this.listeners.forEach((listener: DataChangeListener) => {
listener.onDataAdd(index);
})
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/VideoPlayerSample/entry/src/main/ets/model/BasicDataSource.ets#L52-L56 | e2eea677e2d2cd55cf0da59b12c60e0b266fa691 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/imagecompression/src/main/ets/view/ImageCompression.ets | arkts | getSelectFormat | 获取当前选中的输出格式
@returns selectFormat 格式名 | getSelectFormat(): string {
let selectFormat: string = '';
switch (this.outputFormatIndex) {
case 0: // 原格式
selectFormat = this.beforeCompressFmt;
break;
case 1: // PNG
selectFormat = 'png'; | AST#method_declaration#Left getSelectFormat AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left selectFormat : AST#... | getSelectFormat(): string {
let selectFormat: string = '';
switch (this.outputFormatIndex) {
case 0:
selectFormat = this.beforeCompressFmt;
break;
case 1:
selectFormat = 'png'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagecompression/src/main/ets/view/ImageCompression.ets#L466-L473 | bfc29201f0b3f1ada61eec53f25d1dfa0e28d366 | gitee |
iotjin/JhHarmonyDemo.git | 819e6c3b1db9984c042a181967784550e171b2e8 | JhCommon/src/main/ets/JhCommon/components/JhToast.ets | arkts | showInfo | / 警告弹框 | public static showInfo(loadingText: ResourceStr) {
JhToast._showToast(loadingText, _ToastType.info)
} | AST#method_declaration#Left public static showInfo AST#parameter_list#Left ( AST#parameter#Left loadingText : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_stateme... | public static showInfo(loadingText: ResourceStr) {
JhToast._showToast(loadingText, _ToastType.info)
} | https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhToast.ets#L59-L61 | 3154f4590365f1de1fb64a9e8ace0f222bfe63e2 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/analytics/AnalyticsPage.ets | arkts | buildBirthdayTab | 构建生日分析标签页 | @Builder
buildBirthdayTab(birthday: BirthdayStats) {
Scroll() {
Column({ space: UIConstants.DEFAULT_PADDING }) {
// 月份分布图
Card() {
Column({ space: UIConstants.DEFAULT_PADDING }) {
Text('月份分布')
.fontSize(UIConstants.FONT_SIZE_HEADING)
.fontWei... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildBirthdayTab AST#parameter_list#Left ( AST#parameter#Left birthday : AST#type_annotation#Left AST#primary_type#Left BirthdayStats AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_f... | @Builder
buildBirthdayTab(birthday: BirthdayStats) {
Scroll() {
Column({ space: UIConstants.DEFAULT_PADDING }) {
Card() {
Column({ space: UIConstants.DEFAULT_PADDING }) {
Text('月份分布')
.fontSize(UIConstants.FONT_SIZE_HEADING)
.fontWeight(Font... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/analytics/AnalyticsPage.ets#L277-L419 | 01836c8309a043ca2c56098d563928c67c7a4bb7 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/common/FeedbackService.ets | arkts | showResultDialog | 显示操作结果对话框 | async showResultDialog(
title: string,
message: string,
isSuccess: boolean,
actions?: Array<FeedbackAction>
): Promise<void> {
const icon = isSuccess ? '✅' : '❌';
const defaultActions: FeedbackAction[] = [{
text: '确定',
callback: () => {}
}];
const dialogActions = actions |... | AST#method_declaration#Left async showResultDialog AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left string AST#prim... | async showResultDialog(
title: string,
message: string,
isSuccess: boolean,
actions?: Array<FeedbackAction>
): Promise<void> {
const icon = isSuccess ? '✅' : '❌';
const defaultActions: FeedbackAction[] = [{
text: '确定',
callback: () => {}
}];
const dialogActions = actions |... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/common/FeedbackService.ets#L170-L192 | 13d030a7cda80973396c4588056c92df98966fad | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/videocreategif/src/main/ets/components/GifCreateView.ets | arkts | this | 开始生成gif文件 | this.createGif(this.srcFilePath, this.startTime, this.endTime); | AST#method_declaration#Left this AST#ERROR#Left . createG if AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left this AST#parameter#Right AST#ERROR#Left . srcFilePath AST#ERROR#Right , AST#parameter#Left this AST#parameter#Right AST#ERROR#Left . startTime AST#ERROR#Right , AST#parameter#Left this AST#parameter... | this.createGif(this.srcFilePath, this.startTime, this.endTime); | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videocreategif/src/main/ets/components/GifCreateView.ets#L53-L53 | f7174cd593142bedb1c22cf91824bc19fa604a53 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/services/storage/PreferencesService.ets | arkts | getString | 获取字符串值
@param key 键
@param defaultValue 默认值
@returns 字符串值 | async getString(key: string, defaultValue: string = ''): Promise<string> {
try {
this.checkInitialized();
return await this.dataPreferences!.get(key, defaultValue) as string;
} catch (error) {
const businessError = error as BusinessError;
hilog.error(LogConstants.DOMAIN_APP, LogConstants... | AST#method_declaration#Left async getString AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left defaultValue : AST#type_annotation#Left AST#primary_type#Left string AST#primary_... | async getString(key: string, defaultValue: string = ''): Promise<string> {
try {
this.checkInitialized();
return await this.dataPreferences!.get(key, defaultValue) as string;
} catch (error) {
const businessError = error as BusinessError;
hilog.error(LogConstants.DOMAIN_APP, LogConstants... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/storage/PreferencesService.ets#L82-L91 | 86d196bbafc54444722c13ac2057ea6fb43d9462 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | getLabelXOffset | returns the horizontal offset of the y-label | public getLabelXOffset(): number {
return this.mXLabelOffset;
} | AST#method_declaration#Left public getLabelXOffset 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_e... | public getLabelXOffset(): number {
return this.mXLabelOffset;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L190-L192 | e09aa7c8f5a6febf3b288a94bc0a9073caee237f | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.TreeView.d.ets | arkts | off | Destroy event.
@param { type } event Registered Events.
@param { callback }.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Destroy event.
@param { type } event Registered Events.
@param { callback }.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11 | off(type: TreeListenType, callback?: (callbackParam: CallbackParam) => void): void; | AST#method_declaration#Left off AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left TreeListenType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback ? : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left... | off(type: TreeListenType, callback?: (callbackParam: CallbackParam) => void): void; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.TreeView.d.ets#L174-L174 | d1eb006a798e30a1e05f79f8a017a2d1035c6c1f | gitee |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/ArkState.ets | arkts | AbstractProperty is an alias to the referenced storage property. | export interface AbstractProperty<T> {
/**
* @returns the name of the referenced storage property
*/
info(): string
/**
* @returns the value of the referenced storage property
*/
get(): T
/**
* Updates the value of the referenced storage property.
* @param newValue - ne... | AST#export_declaration#Left export AST#interface_declaration#Left interface AbstractProperty AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#object_type#Left { /**
* @returns the name of the referenced storage property
*/ AST#type_member#Left info ... | export interface AbstractProperty<T> {
info(): string
get(): T
set(newValue: T): void
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/ArkState.ets#L21-L35 | 09a84803adc2449abfdd7b3debc2ca135b956cc9 | gitee | |
openharmony/graphic_graphic_2d | 46a11e91c9709942196ad2a7afea2e0fcd1349f3 | interfaces/kits/ani/drawing/ets/@ohos.graphics.drawing.ets | arkts | Lattice is the class for dividing an image into grids.
@syscap SystemCapability.Graphics.Drawing
@since 12 | export class Lattice {
static { loadLibraryWithPermissionCheck("drawing_ani_core", "@ohos.graphics.drawing"); } | AST#export_declaration#Left export AST#class_declaration#Left class Lattice 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#parameter_list... | export class Lattice {
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#L984-L985 | 9c03fcbe7d00cb181cd2b9d82949c42089377ac4 | gitee | |
Active-hue/ArkTS-Accounting.git | c432916d305b407557f08e35017c3fd70668e441 | entry/src/main/ets/common/BillData.ets | arkts | getAllBills | 获取所有账单 | static async getAllBills(): Promise<BillItem[]> {
try {
const data = AppStorage.Get<string>(BillDataManager.STORAGE_KEY);
console.info('BillDataManager: 读取数据:', data);
if (data) {
const bills: BillItem[] = JSON.parse(data as string) as BillItem[];
console.info('BillDataManager: 解析后... | AST#method_declaration#Left static async getAllBills AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left BillItem [ ] AST#array_type#Right AST#prim... | static async getAllBills(): Promise<BillItem[]> {
try {
const data = AppStorage.Get<string>(BillDataManager.STORAGE_KEY);
console.info('BillDataManager: 读取数据:', data);
if (data) {
const bills: BillItem[] = JSON.parse(data as string) as BillItem[];
console.info('BillDataManager: 解析后... | https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/common/BillData.ets#L40-L55 | f5dce3b9a694ba030c8db7a23b33586aa4259021 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets | arkts | bootloaderVersion | Bootloader版本号 | static bootloaderVersion(): string {
return deviceInfo.bootloaderVersion
} | AST#method_declaration#Left static bootloaderVersion AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member... | static bootloaderVersion(): string {
return deviceInfo.bootloaderVersion
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets#L92-L94 | e12473ff32c011558ab20d490fbc5d5e88ec8735 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.