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
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/TrainRecordPage.ets
arkts
navBar
本年卡路里 导航栏样式
@Builder navBar(tex:string, index:number){ Column({space:5}){ Text(tex) .fontColor(index == this.curIndex ? "#6C55E4" : "#CCCCCC") .fontSize(20) } }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right navBar AST#parameter_list#Left ( AST#parameter#Left tex : 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#prim...
@Builder navBar(tex:string, index:number){ Column({space:5}){ Text(tex) .fontColor(index == this.curIndex ? "#6C55E4" : "#CCCCCC") .fontSize(20) } }
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/TrainRecordPage.ets#L21-L29
ec8ba8b1da857f76ae83357a6dd09ecbeb7ff3db
github
iotjin/JhHarmonyDemo.git
819e6c3b1db9984c042a181967784550e171b2e8
JhCommon/src/main/ets/JhCommon/utils/JhEncryptUtils.ets
arkts
decodeBase64
/ Base64解码
public static decodeBase64(data: string) { const decoded: string = CryptoJS.enc.Base64.parse(data).toString(CryptoJS.enc.Utf8) return decoded }
AST#method_declaration#Left public static decodeBase64 AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_decl...
public static decodeBase64(data: string) { const decoded: string = CryptoJS.enc.Base64.parse(data).toString(CryptoJS.enc.Utf8) return decoded }
https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/utils/JhEncryptUtils.ets#L21-L24
4c4ebf5216c638f734339e2869f0dccc333c76e2
github
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/common/RdbHelper.ets
arkts
deleteTask
Delete a task @param taskId - ID of task to delete
async deleteTask(taskId: number): Promise<void> { if (!this.rdbStore) { throw new Error('Database not initialized'); } const predicates = new relationalStore.RdbPredicates(Constants.TABLE_TASKS); predicates.equalTo('id', taskId); try { await this.rdbStore.delete(predicates); cons...
AST#method_declaration#Left async deleteTask AST#parameter_list#Left ( AST#parameter#Left taskId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ...
async deleteTask(taskId: number): Promise<void> { if (!this.rdbStore) { throw new Error('Database not initialized'); } const predicates = new relationalStore.RdbPredicates(Constants.TABLE_TASKS); predicates.equalTo('id', taskId); try { await this.rdbStore.delete(predicates); cons...
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/common/RdbHelper.ets#L300-L316
6e2161484cf5ebadf8e48453a70b7c18ada270f1
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/dealstridesolution/src/main/ets/components/XComponentView.ets
arkts
aboutToAppear
相机设备索引
aboutToAppear(): void { if (this.xComponentSurfaceId !== '') { CameraService.initCamera(this.cameraDeviceIndex, this.xComponentSurfaceId); } }
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_exp...
aboutToAppear(): void { if (this.xComponentSurfaceId !== '') { CameraService.initCamera(this.cameraDeviceIndex, this.xComponentSurfaceId); } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/dealstridesolution/src/main/ets/components/XComponentView.ets#L43-L47
a092417a0f8c12f19ff02ae976a869061c649556
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/myData/WordUserDbAccess.ets
arkts
deleteWordUser
====== 删除 ======
async deleteWordUser(titleEn: string): Promise<void> { if (!this.db) return; const titleEnBase64 = StringEncoder.encodedToBase64(titleEn) if (!titleEnBase64) return; const sql = `DELETE FROM ${Tables.Learn.NAME} WHERE ${Tables.Learn.Col.TITLE_EN} = ?`; await this.db.updateDb(sql, [titleEnBase64]);...
AST#method_declaration#Left async deleteWordUser AST#parameter_list#Left ( AST#parameter#Left titleEn : 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#...
async deleteWordUser(titleEn: string): Promise<void> { if (!this.db) return; const titleEnBase64 = StringEncoder.encodedToBase64(titleEn) if (!titleEnBase64) return; const sql = `DELETE FROM ${Tables.Learn.NAME} WHERE ${Tables.Learn.Col.TITLE_EN} = ?`; await this.db.updateDb(sql, [titleEnBase64]);...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/myData/WordUserDbAccess.ets#L427-L439
571deff93772f378cf6e4dc6230d5e649d5c2e94
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/Rect.ets
arkts
@ts-nocheck 移植的Rect类 @param left @param top @param right @param bottom @param r
export default class MyRect { public left: number; public top: number; public right: number; public bottom: number; /** * Create a new rectangle with the specified coordinates. Note: no range * checking is performed, so the caller must ensure that left <= right and * top <= bottom. * * @param ...
AST#export_declaration#Left export default AST#class_declaration#Left class MyRect AST#class_body#Left { AST#property_declaration#Left public left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left publi...
export default class MyRect { public left: number; public top: number; public right: number; public bottom: number; constructor(left?: number, top?: number, right?: number, bottom?: number, r?: MyRect) { this.left = left == undefined ? 0 : left; this.top = top == undefined ? 0 : top; this.righ...
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/Rect.ets#L25-L230
69eb1f6f8e0889177f324dfcb7c23ad26398a541
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.file.fs.d.ets
arkts
Conflict Files type @interface ConflictFiles @syscap SystemCapability.FileManagement.File.FileIO @since 20
export interface ConflictFiles { /** * The path of the source file. * * @type { string } * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ srcFile: string; /** * The path of the destination file. * * @type { string } * @syscap SystemCapability.FileManagement.Fi...
AST#export_declaration#Left export AST#interface_declaration#Left interface ConflictFiles AST#object_type#Left { /** * The path of the source file. * * @type { string } * @syscap SystemCapability.FileManagement.File.FileIO * @since 20 */ AST#type_member#Left srcFile : AST#type_annotation#Left AST#pri...
export interface ConflictFiles { srcFile: string; destFile: string; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.file.fs.d.ets#L4306-L4325
fecc72332a3fd1d937cd784481de15c7b8a17e82
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_settings.ets
arkts
import_one_pair
Sets the corresponding value of key, and save it in settings_list. @param key A string, the key of the setting. @param value A string, the corresponding value of key to be set.
static import_one_pair(key: string, value: string) { let key_default_index = bunch_of_settings.settings_defaults_key.indexOf(key); if (key_default_index == -1) { // unregistered setting console.error('[Error][Meow][bunch_of_settings][get] Unregistered setting key: ' + key); } let key_default...
AST#method_declaration#Left static import_one_pair 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 value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_...
static import_one_pair(key: string, value: string) { let key_default_index = bunch_of_settings.settings_defaults_key.indexOf(key); if (key_default_index == -1) { console.error('[Error][Meow][bunch_of_settings][get] Unregistered setting key: ' + key); } let key_default_type = bunch_of_settin...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_settings.ets#L270-L296
ca909700dfe4600e1c1419fef1e9805271c1b406
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SettingsTypes.ets
arkts
设置迁移规则接口
export interface SettingsMigrationRule { key: string; transform: (oldValue: Record<string, string | number | boolean>) => Record<string, string | number | boolean>; fallback?: Record<string, string | number | boolean>; }
AST#export_declaration#Left export AST#interface_declaration#Left interface SettingsMigrationRule AST#object_type#Left { AST#type_member#Left key : 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 transform : AST#type_ann...
export interface SettingsMigrationRule { key: string; transform: (oldValue: Record<string, string | number | boolean>) => Record<string, string | number | boolean>; fallback?: Record<string, string | number | boolean>; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L527-L531
a9f8ebbb557f338d9f640ec6205b254a82c7b5a8
github
tomorrowKreswell/Ledger.git
1f2783ae70b8540d677af8a27f29db1b4089ea69
ledger/entry/src/main/ets/common/database/tables/AccountTable.ets
arkts
updateData
更新账目数据
updateData(account: Account, callback: Function) { // 生成值桶,包含要更新的数据 const valueBucket: relationalStore.ValuesBucket = generateBucket(account); // 创建 RdbPredicates 对象,指定更新条件为账目ID匹配 let predicates = new relationalStore.RdbPredicates(CommonConstants.ACCOUNT_TABLE.tableName); predicates.equalTo('id', ac...
AST#method_declaration#Left updateData AST#parameter_list#Left ( AST#parameter#Left account : AST#type_annotation#Left AST#primary_type#Left Account AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_ty...
updateData(account: Account, callback: Function) { const valueBucket: relationalStore.ValuesBucket = generateBucket(account); let predicates = new relationalStore.RdbPredicates(CommonConstants.ACCOUNT_TABLE.tableName); predicates.equalTo('id', account.id); this.accountTable.updateData(pre...
https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/common/database/tables/AccountTable.ets#L64-L72
7ba98a6ed329f27634a34d30247c9f6466f64f55
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/foldablescreencases/src/main/ets/model/WindowModel.ets
arkts
窗口管理模型
export default class WindowModel { constructor() { } /** * 缓存的当前WindowStage实例 */ private windowStage?: window.WindowStage = undefined; /** * 缓存windowStage * @param windowStage 当前WindowStage实例 * @returns {void} */ setWindowStage(windowStage: window.WindowStage): void { this.windowStag...
AST#export_declaration#Left export default AST#class_declaration#Left class WindowModel AST#class_body#Left { AST#constructor_declaration#Left constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { } AST#block_statement#Right AST#constructor_declaration#Right /** * 缓存的当前WindowSta...
export default class WindowModel { constructor() { } private windowStage?: window.WindowStage = undefined; setWindowStage(windowStage: window.WindowStage): void { this.windowStage = windowStage; } setMainWindowImmersive(enable: boolean): void { if (this.windowStage === undefined) { ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/foldablescreencases/src/main/ets/model/WindowModel.ets#L23-L83
bb78c266e23d7505a260730ed56facab299b9e1a
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/component/OrderCard.ets
arkts
buildGoodsPreview
构建订单商品预览 @returns {void} 无返回值
@Builder private buildGoodsPreview(): void { Stack({ alignContent: Alignment.Center }) { List({ space: 8 }) { ForEach(this.getGoodsList(), (goods: OrderGoods): void => { ListItem() { NetWorkImage({ model: goods.spec?.images?.[0] ?? goods.goodsInfo?.mainPic ?? "", ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private buildGoodsPreview AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AS...
@Builder private buildGoodsPreview(): void { Stack({ alignContent: Alignment.Center }) { List({ space: 8 }) { ForEach(this.getGoodsList(), (goods: OrderGoods): void => { ListItem() { NetWorkImage({ model: goods.spec?.images?.[0] ?? goods.goodsInfo?.mainPic ?? "", ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/component/OrderCard.ets#L110-L149
45aae495b4233f94a84d4363731beea33b04ce63
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_speech/src/main/ets/TextReaderHelper.ets
arkts
stop
朗读控件停止朗读,执行播放面板的关闭,注销监听,重置参数。 @returns
static async stop(): Promise<void> { return TextReader.stop(); }
AST#method_declaration#Left static async stop AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_argu...
static async stop(): Promise<void> { return TextReader.stop(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_speech/src/main/ets/TextReaderHelper.ets#L77-L79
73a9e1f08ae479cd955085e7330028d048595565
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/social/CommunityService.ets
arkts
getMockEvents
获取模拟活动数据
private getMockEvents(limit: number): CommunityEvent[] { const events = [ { title: '生日主题摄影比赛', description: '分享最美好的生日瞬间' }, { title: '线上生日派对策划', description: '学习如何策划完美的生日派对' }, { title: '手工生日卡片制作', description: '一起制作独特的生日卡片' }, { title: '生日美食分享会', description: '分享你的生日美食制作技巧' } ]; re...
AST#method_declaration#Left private getMockEvents AST#parameter_list#Left ( AST#parameter#Left limit : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Lef...
private getMockEvents(limit: number): CommunityEvent[] { const events = [ { title: '生日主题摄影比赛', description: '分享最美好的生日瞬间' }, { title: '线上生日派对策划', description: '学习如何策划完美的生日派对' }, { title: '手工生日卡片制作', description: '一起制作独特的生日卡片' }, { title: '生日美食分享会', description: '分享你的生日美食制作技巧' } ]; re...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/social/CommunityService.ets#L802-L831
1f5128c925334b3198d6ce4fc4738c30abffbd68
github
dcm23333/FishManager.git
952dde4475268ac16f3480f3d55f82033aa6b467
FishManager/entry/src/main/ets/common/contants/commonContants.ets
arkts
‘2.2%’
export const THOUSANDTH_33: string = '3.3%';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left THOUSANDTH_33 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '3.3%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declar...
export const THOUSANDTH_33: string = '3.3%';
https://github.com/dcm23333/FishManager.git/blob/952dde4475268ac16f3480f3d55f82033aa6b467/FishManager/entry/src/main/ets/common/contants/commonContants.ets#L48-L48
6057acdcfc9559d9dd30ec22e95f5242ece99cd5
github
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/structures/ReactionEmoji.ets
arkts
get
应用约束1:添加返回类型标注
get identifier(): string { if (this.id) return `${this.name}:${this.id}`; return encodeURIComponent(this.name); }
AST#method_declaration#Left get AST#ERROR#Left ident if ier AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expressio...
get identifier(): string { if (this.id) return `${this.name}:${this.id}`; return encodeURIComponent(this.name); }
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/ReactionEmoji.ets#L16-L19
12113532ec47b4b991af32078b13f6929ea64af4
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.util.d.ets
arkts
isBigUint64Array
Check whether the entered value is of biguint64array array array type. @param { Object } value - A BigUint64Array value @returns { boolean } Returns true if the value is a BigUint64Array instance. @syscap SystemCapability.Utils.Lang @crossplatform @atomicservice @since 20
isBigUint64Array(value: Object): boolean;
AST#method_declaration#Left isBigUint64Array AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_typ...
isBigUint64Array(value: Object): boolean;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1180-L1180
7ae594726b80605cfcf2b783f03f33f9f38ef53a
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets
arkts
registerBuilder
通过名称注册builder
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/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets#L20-L22
7a113dafc8f0167faa2d6073c0bf1a76d143f8d5
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/DialogBuilder.ets
arkts
CustomContentDialogBuilder
自定义内容弹框builder 不设置自定义样式(如:标题、按钮时)将直接使用系统组件CustomContentDialog
@Builder export function CustomContentDialogBuilder(options: ICustomContentOptions) { if (options.buttons?.[0] instanceof CustomButtonOptions || options.buttons?.[0] && (options.buttons?.[0] as CustomButtonOptions)?.customStyleId || options.style?.customHeader //自定义标题栏 || options.attaches?.length || !...
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function CustomContentDialogBuilder AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ICustomContentOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Rig...
@Builder export function CustomContentDialogBuilder(options: ICustomContentOptions) { if (options.buttons?.[0] instanceof CustomButtonOptions || options.buttons?.[0] && (options.buttons?.[0] as CustomButtonOptions)?.customStyleId || options.style?.customHeader || options.attaches?.length || !options....
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogBuilder.ets#L191-L218
5d3b5118f3045aad8987d40ba692661065be687b
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/Speech/Recorder/RecordingView.ets
arkts
RecordingView
波纹动画组件
@ComponentV2 export struct RecordingView { // ===================== 父组件传入参数 ===================== @Param isTalking : boolean = true; // 是否检测到用户说话 // ===================== 自定义事件 ===================== @Event onStopRecording: () => void; // 停止录音事件回调 // ===================== 组件内部状态 ===========...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct RecordingView AST#component_body#Left { // ===================== 父组件传入参数 ===================== AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right isTalking : AST#type_annotation#Left AST#pr...
@ComponentV2 export struct RecordingView { @Param isTalking : boolean = true; @Event onStopRecording: () => void; @Local private waveSpeed : number = 0.08; @Local private waveAmplitude: number = 10; @Local private waveHeight : number = 50; @Monitor('isTal...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Speech/Recorder/RecordingView.ets#L4-L74
f254dd96f5b28d2a709c555c091dae04f8bbe268
github
kico0909/crazy_miner.git
13eae3ac4d8ca11ecf2c97b375f82f24ab7919b9
entry/src/main/ets/common/game/types/world.ets
arkts
角色做出一个动作 返回数据的声明
export interface TWorldAction { perStep: number // 挖掘进度条步长 event: TMinerActionEventItem | undefined message: string[] // 挖掘消息 exp: number // 一次动作获得的经验 levelUp: boolean // player 是否升级 }
AST#export_declaration#Left export AST#interface_declaration#Left interface TWorldAction AST#object_type#Left { AST#type_member#Left perStep : 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 event : AST#type_ann...
export interface TWorldAction { perStep: number event: TMinerActionEventItem | undefined message: string[] exp: number levelUp: boolean }
https://github.com/kico0909/crazy_miner.git/blob/13eae3ac4d8ca11ecf2c97b375f82f24ab7919b9/entry/src/main/ets/common/game/types/world.ets#L42-L48
bee1f5da9e11fa4aeb082d3fa2193f7257701f49
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/pulltorefreshnews/src/main/ets/pages/PullToRefreshNews.ets
arkts
getNewsData
获取数据
getNewsData(): Array<NewsData> { // 从本地文件中获取数据 const value = getContext().resourceManager.getRawFileContentSync(this.jsonFileDir); // 解码为utf-8格式 const textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: true }); const textDecoderResult = textDecoder.decodeWithStream(new Uint8Array(...
AST#method_declaration#Left getNewsData 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 NewsData AST#primary_type#Right AST#type_annotation#Right > AST#type_argument...
getNewsData(): Array<NewsData> { const value = getContext().resourceManager.getRawFileContentSync(this.jsonFileDir); const textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: true }); const textDecoderResult = textDecoder.decodeWithStream(new Uint8Array(value.buffer)); const ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pulltorefreshnews/src/main/ets/pages/PullToRefreshNews.ets#L385-L403
b586adb978102925a0be850db84d3c92e2e3690d
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/datastore/src/main/ets/datasource/account/AccountStoreDataSource.ets
arkts
@file 账号密码本地存储数据源接口 @author Joker.X
export interface AccountStoreDataSource { /** * 保存账号 * @param {string} account 用户账号 * @returns {Promise<void>} Promise<void> */ setAccount(account: string): Promise<void>; /** * 读取账号 * @returns {Promise<string>} 用户账号,默认空字符串 */ getAccount(): Promise<string>; /** * 保存密码 * @param {st...
AST#export_declaration#Left export AST#interface_declaration#Left interface AccountStoreDataSource AST#object_type#Left { /** * 保存账号 * @param {string} account 用户账号 * @returns {Promise<void>} Promise<void> */ AST#type_member#Left setAccount AST#parameter_list#Left ( AST#parameter#Left account : AST#type_anno...
export interface AccountStoreDataSource { setAccount(account: string): Promise<void>; getAccount(): Promise<string>; setPassword(password: string): Promise<void>; getPassword(): Promise<string>; }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/datastore/src/main/ets/datasource/account/AccountStoreDataSource.ets#L5-L31
4f8ffc548df920fbe53da2e7ba612c1345d2a6d8
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/blendmode/src/main/ets/model/DataSource.ets
arkts
pushData
添加数据 @param data 虚拟数据
pushData(data: Array<PendantType>): void { data.forEach((item: PendantType) => { this.pendantData.push(item); this.notifyDataAdd(this.pendantData.length - 1); }) }
AST#method_declaration#Left pushData AST#parameter_list#Left ( AST#parameter#Left data : 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 PendantType AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#R...
pushData(data: Array<PendantType>): void { data.forEach((item: PendantType) => { this.pendantData.push(item); this.notifyDataAdd(this.pendantData.length - 1); }) }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/blendmode/src/main/ets/model/DataSource.ets#L101-L106
83c3b91dcef93a42f53a46323be07852387626c1
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/utils/JSONUtil.ets
arkts
TODO JSON工具类 author: 桃花镇童长老ᥫ᭡ since: 2024/05/01
export class JSONUtil { /** * JSON字符串转Class对象 * @param jsonStr JSON字符串 * @param cls 类名 * @returns */ static jsonToBean<T>(jsonStr: string, clazz?: Constructor<T>, reviver?: JSON.Transformer, options?: JSON.ParseOptions): T | null { try { if (StrUtil.isEmpty(jsonStr)) { return null...
AST#export_declaration#Left export AST#class_declaration#Left class JSONUtil AST#class_body#Left { /** * JSON字符串转Class对象 * @param jsonStr JSON字符串 * @param cls 类名 * @returns */ AST#method_declaration#Left static jsonToBean AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST...
export class JSONUtil { static jsonToBean<T>(jsonStr: string, clazz?: Constructor<T>, reviver?: JSON.Transformer, options?: JSON.ParseOptions): T | null { try { if (StrUtil.isEmpty(jsonStr)) { return null; } if (!options) { options = { bigIntMode: JSON.BigIntMode.PARSE_AS_BI...
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/utils/JSONUtil.ets#L28-L143
7525458be08b8a69adaedd4f5f5d7c18083a6f42
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/view/CustomCalendarPickerDialog.ets
arkts
readyToClose
底部导航栏高度
readyToClose() { setTimeout(() => { this.controller.close(); }, TRANSITION_DURATION) animateTo({ duration: TRANSITION_DURATION, }, () => { this.customY = 800; }) }
AST#method_declaration#Left readyToClose 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 setTimeout ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right ...
readyToClose() { setTimeout(() => { this.controller.close(); }, TRANSITION_DURATION) animateTo({ duration: TRANSITION_DURATION, }, () => { this.customY = 800; }) }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/view/CustomCalendarPickerDialog.ets#L58-L67
6090db4b03852cdbf1ef611978766d96a436d286
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/shortvideo/src/main/ets/view/CommentView.ets
arkts
CommentComponent
评论组件
@Component export struct CommentComponent { listScroll: ListScroller = new ListScroller(); commentData: CommentDataSource = new CommentDataSource(); @StorageLink('bottomHeight') bottomHeight: number | undefined = AppStorage.get('bottomHeight'); // 底部系统导航栏高度 build() { Column() { List({ scroller: this....
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CommentComponent AST#component_body#Left { AST#property_declaration#Left listScroll : AST#type_annotation#Left AST#primary_type#Left ListScroller AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left ...
@Component export struct CommentComponent { listScroll: ListScroller = new ListScroller(); commentData: CommentDataSource = new CommentDataSource(); @StorageLink('bottomHeight') bottomHeight: number | undefined = AppStorage.get('bottomHeight'); build() { Column() { List({ scroller: this.listScroll }...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/shortvideo/src/main/ets/view/CommentView.ets#L57-L88
10cffd2f0f9edd4848593c111fde4e2713886a28
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
完整农历系统设计.ets
arkts
getGanZhi
获取干支
private static getGanZhi(offset: number): string { return HEAVENLY_STEMS[offset % 10] + EARTHLY_BRANCHES[offset % 12]; }
AST#method_declaration#Left private static getGanZhi AST#parameter_list#Left ( AST#parameter#Left offset : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#pri...
private static getGanZhi(offset: number): string { return HEAVENLY_STEMS[offset % 10] + EARTHLY_BRANCHES[offset % 12]; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/完整农历系统设计.ets#L432-L434
13f922a0c4a15fa3d39e4073e2f78a4facfb20f1
github
liudi25385/mybit.git
865f64ff6b2e10f5b79100064dff05e67607a5bc
entry/src/main/ets/utils/PermissionsUtil.ets
arkts
requestCameraPermission
申请相机权限 @returns
static async requestCameraPermission(){ let grantStatus = await PermissionsUtil.reqPermissionsFromUser(['ohos.permission.CAMERA']) for (let i = 0; i < grantStatus.length; i++) { if (grantStatus[i] === 0) { // 用户授权,可以继续访问目标操作 return true; } } return false; }
AST#method_declaration#Left static async requestCameraPermission AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left grantStatus = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_exp...
static async requestCameraPermission(){ let grantStatus = await PermissionsUtil.reqPermissionsFromUser(['ohos.permission.CAMERA']) for (let i = 0; i < grantStatus.length; i++) { if (grantStatus[i] === 0) { return true; } } return false; }
https://github.com/liudi25385/mybit.git/blob/865f64ff6b2e10f5b79100064dff05e67607a5bc/entry/src/main/ets/utils/PermissionsUtil.ets#L18-L27
2b1d5288f548edd1a95e61af5ba520b00742a8bf
github
iichen-bycode/ArkTsWanandroid.git
ad128756a6c703d9a72cf7f6da128c27fc63bd00
entry/src/main/ets/http/api.ets
arkts
公众号作者列表 @param date @returns
export function wxAuthorList() { return axiosClient.get<CommonModel[]>({ url: `wxarticle/chapters/json`, }) }
AST#export_declaration#Left export AST#function_declaration#Left function wxAuthorList 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#expre...
export function wxAuthorList() { return axiosClient.get<CommonModel[]>({ url: `wxarticle/chapters/json`, }) }
https://github.com/iichen-bycode/ArkTsWanandroid.git/blob/ad128756a6c703d9a72cf7f6da128c27fc63bd00/entry/src/main/ets/http/api.ets#L135-L139
f5864b8021d5001afeee3e7ed978300ba711ba65
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/theme/ThemeManager.ets
arkts
setAnimationConfig
设置动画配置
async setAnimationConfig(config: Partial<AnimationConfig>): Promise<void> { try { if (!this.currentTheme) return; const oldAnimation = { ...this.currentTheme.animationConfig }; this.currentTheme.animationConfig = { ...this.currentTheme.animationConfig, ...config }; ...
AST#method_declaration#Left async setAnimationConfig AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AnimationConfig AST#primary_type#Right AST#type_annotation#Righ...
async setAnimationConfig(config: Partial<AnimationConfig>): Promise<void> { try { if (!this.currentTheme) return; const oldAnimation = { ...this.currentTheme.animationConfig }; this.currentTheme.animationConfig = { ...this.currentTheme.animationConfig, ...config }; ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/theme/ThemeManager.ets#L342-L365
81ddbb318166cd7361d82b7262ddcda08921e22a
github
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/services/NotificationService.ets
arkts
initialize
初始化通知服务
async initialize(context: common.UIAbilityContext): Promise<void> { if (this.isInitialized) { return; } try { // 请求通知权限 const hasPermission = await this.requestNotificationPermission(context); if (!hasPermission) { console.warn('[NotificationService] 通知权限未授予'); } ...
AST#method_declaration#Left async initialize 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_list#Right : ...
async initialize(context: common.UIAbilityContext): Promise<void> { if (this.isInitialized) { return; } try { const hasPermission = await this.requestNotificationPermission(context); if (!hasPermission) { console.warn('[NotificationService] 通知权限未授予'); } ...
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/services/NotificationService.ets#L63-L84
02f2f68c8b213dc221fd6ee3bfe728766acbf647
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/util/CryptoSyncUtil.ets
arkts
encodeCBC
加密-CBC模式 @param str 待加密的字符串 @param key 给定秘钥规格密钥 @param iv iv偏移量字符串 @param symAlgName 秘钥规格 @param symEncryptName 加密规格 @param keyName 密钥长度 @param keyCoding 密钥编码方式(utf8/hex/base64) @param resultCoding 返回结果编码方式(hex/base64) @returns
static encodeCBC(str: string, key: string, iv: string, symAlgName: string, symEncryptName: string, keyName: number, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding): OutDTO<string> { //转换key let symKey = CryptoSyncUtil.convertKeyFromStr(key, symAlgName, keyName, keyCoding); // 初始化加...
AST#method_declaration#Left static encodeCBC AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Rig...
static encodeCBC(str: string, key: string, iv: string, symAlgName: string, symEncryptName: string, keyName: number, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding): OutDTO<string> { let symKey = CryptoSyncUtil.convertKeyFromStr(key, symAlgName, keyName, keyCoding); let mode ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoSyncUtil.ets#L160-L178
4516b2c6662ccfa0cbffd082fc4b1773c372d5f6
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/utils/DateHelper.ets
arkts
getRanges
获取年月日时分秒的可选范围 @param containType 是否包含 @param type 1-年、2-月、3-日、4-时、5-分、6-秒。 @param startDate 开始日期 @param endDate 结束日期 @param selectDate 选中日期 @returns
static getRanges(containType: boolean, type: number, startDate: Date, endDate: Date, selectDate: Date): string[] { let ranges: string[] = []; if (containType) { if (type == 1) { //年 let startYear = startDate.getFullYear(); let endYear = endDate.getFullYear(); for (let y = startYear...
AST#method_declaration#Left static getRanges AST#parameter_list#Left ( AST#parameter#Left containType : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left number AST#primar...
static getRanges(containType: boolean, type: number, startDate: Date, endDate: Date, selectDate: Date): string[] { let ranges: string[] = []; if (containType) { if (type == 1) { let startYear = startDate.getFullYear(); let endYear = endDate.getFullYear(); for (let y = startYear; y...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/utils/DateHelper.ets#L165-L237
5c451c13b81784b1a022d2a55fbe8070ea8c96f3
gitee
yangsongming/ArkTs-HuXiHelper.git
ed148299fc6dcf351bcc0f2863a5aee4885fbaf5
ets/pages/ZhuanPage.ets
arkts
startAnimator
Start animator.
startAnimator() { let randomAngle = Math.round(Math.random() * CommonConstants.CIRCLE); // Obtaining prize information. this.prizeData = this.drawModel.showPrizeData(randomAngle); animateTo({ duration: CommonConstants.DURATION, curve: Curve.Ease, delay: 0, iterations: 1, p...
AST#method_declaration#Left startAnimator AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left randomAngle = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expres...
startAnimator() { let randomAngle = Math.round(Math.random() * CommonConstants.CIRCLE); this.prizeData = this.drawModel.showPrizeData(randomAngle); animateTo({ duration: CommonConstants.DURATION, curve: Curve.Ease, delay: 0, iterations: 1, playMode: PlayMode.Normal, ...
https://github.com/yangsongming/ArkTs-HuXiHelper.git/blob/ed148299fc6dcf351bcc0f2863a5aee4885fbaf5/ets/pages/ZhuanPage.ets#L82-L102
4e61e2c6741f4ad5793bc541073df5f1a1687e29
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/view/Reader.ets
arkts
calcCornerXY
/ 计算拖拽点对应的拖拽脚 ///
private calcCornerXY(y: number) { this.cornerX = this.canvasSize.width; if (y <= this.canvasSize.height / 2) { this.cornerY = 0; } else { this.cornerY = this.canvasSize.height; } }
AST#method_declaration#Left private calcCornerXY AST#parameter_list#Left ( AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expre...
private calcCornerXY(y: number) { this.cornerX = this.canvasSize.width; if (y <= this.canvasSize.height / 2) { this.cornerY = 0; } else { this.cornerY = this.canvasSize.height; } }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/view/Reader.ets#L683-L690
56640b2cd6e510f4078af2af9f3efcfe50a68ca7
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/model/ILoadingOptions.ets
arkts
Loading参数
export interface ILoadingOptions extends IBaseDialogOptions { /** * 观察数据,支持随时更新loading的content */ observedData?: LoadingObserved /** * 样式配置 */ style?: ILoadingDialogStyle /** * 加载中文字(非动态变化) * @tip:如果需要动态变化,这里不传。改为传参ObservedData进行变化 */ content?: ResourceStr; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ILoadingOptions AST#extends_clause#Left extends IBaseDialogOptions AST#extends_clause#Right AST#object_type#Left { /** * 观察数据,支持随时更新loading的content */ AST#type_member#Left observedData ? : AST#type_annotation#Left AST#primary_type#Left Lo...
export interface ILoadingOptions extends IBaseDialogOptions { observedData?: LoadingObserved style?: ILoadingDialogStyle content?: ResourceStr; }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/model/ILoadingOptions.ets#L8-L22
5cb996d2df35a8568b5e33ccef671cd1fec2424f
github
L1rics06/arkTS-.git
991fd131bfdb11e2933152133c97453d86092ac0
entry/src/main/ets/pages/NetworkUtil.ets
arkts
getChatMessages
获取聊天消息
static async getChatMessages( sessionId: string, pageNum: number = 1, pageSize: number = 20 ): Promise<ResponseDao<MessageListResponse>> { try { const params: ChatMessagesParams = { sessionId, pageNum, pageSize }; const response: AxiosResponse<ResponseDao<MessageListResponse>> = await axi...
AST#method_declaration#Left static async getChatMessages AST#parameter_list#Left ( AST#parameter#Left sessionId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pageNum : AST#type_annotation#Left AST#primary_type#Left numbe...
static async getChatMessages( sessionId: string, pageNum: number = 1, pageSize: number = 20 ): Promise<ResponseDao<MessageListResponse>> { try { const params: ChatMessagesParams = { sessionId, pageNum, pageSize }; const response: AxiosResponse<ResponseDao<MessageListResponse>> = await axi...
https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L513-L533
9191188f4a4e67ec0e4ed32aa01a2db384fa3155
github
sedlei/Smart-park-system.git
253228f73e419e92fd83777f564889d202f7c699
@huaweicloud/iot-device-sdk/src/main/ets/client/DeviceClient.d.ets
arkts
set
设置属性监听器,用于接收平台下发的属性读写。 此监听器只能接收平台到直连设备的请求,子设备的请求由AbstractGateway处理 @param propertyListener 属性监听器
set propertyListener(value: PropertyListener | null);
AST#method_declaration#Left set AST#ERROR#Left property List ener AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left PropertyListener AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#t...
set propertyListener(value: PropertyListener | null);
https://github.com/sedlei/Smart-park-system.git/blob/253228f73e419e92fd83777f564889d202f7c699/@huaweicloud/iot-device-sdk/src/main/ets/client/DeviceClient.d.ets#L38-L38
8bcaaaedaf95e15d5a57514490f777e09859c58a
github
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/SimpleNotificationManager.ets
arkts
sendTaskDueReminder
发送任务到期提醒
async sendTaskDueReminder(task: TaskItem): Promise<boolean> { if (!this.reminderSettings.taskReminderEnabled || !task.dueDate) { return false; } try { const title = '任务到期提醒'; const content = `任务即将到期:${task.title}`; return await this.sendNotification(title, content); } catch (er...
AST#method_declaration#Left async sendTaskDueReminder AST#parameter_list#Left ( AST#parameter#Left task : AST#type_annotation#Left AST#primary_type#Left TaskItem 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_t...
async sendTaskDueReminder(task: TaskItem): Promise<boolean> { if (!this.reminderSettings.taskReminderEnabled || !task.dueDate) { return false; } try { const title = '任务到期提醒'; const content = `任务即将到期:${task.title}`; return await this.sendNotification(title, content); } catch (er...
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/SimpleNotificationManager.ets#L104-L118
8b4058f028a48410db04ee2fe4d96ceeffaa4a7c
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_axios/src/main/ets/ui/AxiosLoadingUtil.ets
arkts
showLoading
根据参数创建窗口 @param options @returns
static async showLoading(options?: efAxiosLoadingOptions): Promise<void> { let ctx = getContext() as common.UIAbilityContext; //创建后计数器加一 思路由coder_liu提供 WinLoadingUtil.showTimes += 1 if (WinLoadingUtil.showTimes > 1) { //已经有一个在显示了,不要过多的创建 return } try { //当前窗口的编码 let winN...
AST#method_declaration#Left static async showLoading AST#parameter_list#Left ( AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left efAxiosLoadingOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#L...
static async showLoading(options?: efAxiosLoadingOptions): Promise<void> { let ctx = getContext() as common.UIAbilityContext; WinLoadingUtil.showTimes += 1 if (WinLoadingUtil.showTimes > 1) { return } try { let winName = 'efAxiosLoading' + RandomUtil.randomNumber(2000,...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_axios/src/main/ets/ui/AxiosLoadingUtil.ets#L46-L94
c2daf4217aea86947300a865a1b9813b18db1c3e
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/skeletondiagram/src/main/ets/common/CommonConstants.ets
arkts
Common constants for common component.
export class CommonConstants { // font family static readonly HARMONY_HEI_TI_FONT_FAMILY = 'HarmonyHeiTi'; static readonly HARMONY_HEI_TI_MEDIUM_FONT_FAMILY = 'HarmonyHeiTi-Medium'; // opacity static readonly FIRST_LEVEL_OPACITY: number = 0.9; static readonly SECOND_LEVEL_OPACITY: number = 0.6; static rea...
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { // font family AST#property_declaration#Left static readonly HARMONY_HEI_TI_FONT_FAMILY = AST#expression#Left 'HarmonyHeiTi' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left stati...
export class CommonConstants { static readonly HARMONY_HEI_TI_FONT_FAMILY = 'HarmonyHeiTi'; static readonly HARMONY_HEI_TI_MEDIUM_FONT_FAMILY = 'HarmonyHeiTi-Medium'; static readonly FIRST_LEVEL_OPACITY: number = 0.9; static readonly SECOND_LEVEL_OPACITY: number = 0.6; static readonly HALF_OPACITY: numb...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/skeletondiagram/src/main/ets/common/CommonConstants.ets#L19-L54
4abee597d6f23fbc7c24f47241ecbff48323a165
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/CommonConstant.ets
arkts
Common constants for all features.
export class CommonConstants { /** * animation duration of content switching. */ static readonly DURATION_ADS = 200; /** * Height of head portrait. */ static readonly HEIGHT_HEAD = 40; /** * Height of carousel title. */ static readonly HEIGHT_CAROUSEL_TITLE = 90; /** * Font size of ta...
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * animation duration of content switching. */ AST#property_declaration#Left static readonly DURATION_ADS = AST#expression#Left 200 AST#expression#Right ; AST#property_declaration#Right /** * Height of ...
export class CommonConstants { static readonly DURATION_ADS = 200; static readonly HEIGHT_HEAD = 40; static readonly HEIGHT_CAROUSEL_TITLE = 90; static readonly FONT_SIZE_PAGE_CONTENT = 28; static readonly FONT_WEIGHT_LIGHT = 400; static readonly FONT_WEIGHT_NORMAL = 500; static reado...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/SwiperArkTS/entry/src/main/ets/common/constants/CommonConstant.ets#L19-L248
797364215ff4d279f72c6f9fb25977f476efd353
gitee
openharmony-tpc/ImageKnife
bc55de9e2edd79ed4646ce37177ad94b432874f7
library/src/main/ets/ImageKnife.ets
arkts
reload
重新加载
reload(request: ImageKnifeRequest) { if (request.requestState == ImageKnifeRequestState.ERROR) { request.requestState = ImageKnifeRequestState.PROGRESS ImageKnife.getInstance().execute(request) } }
AST#method_declaration#Left reload AST#parameter_list#Left ( AST#parameter#Left request : AST#type_annotation#Left AST#primary_type#Left ImageKnifeRequest AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_s...
reload(request: ImageKnifeRequest) { if (request.requestState == ImageKnifeRequestState.ERROR) { request.requestState = ImageKnifeRequestState.PROGRESS ImageKnife.getInstance().execute(request) } }
https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/ImageKnife.ets#L87-L92
230395367a03a9854f55635f80bb9c5ef53902e3
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/structures/Channel.ets
arkts
setup
应用约束24: 为数据参数定义明确类型
setup(data: ChannelData): void { this.id = data.id; }
AST#method_declaration#Left setup AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left ChannelData AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AS...
setup(data: ChannelData): void { this.id = data.id; }
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/Channel.ets#L20-L22
a2b23da09a0252356285ae71e10e8f86c80f87cd
github
smarthane/DrawerLayout.git
0f6e554c8451ff3bd28f5f718cc7d4329a5fa5ec
DrawerLayout/src/main/ets/components/DrawerLayout.ets
arkts
onPortrait
当满足媒体查询条件时,触发回调
private onPortrait(mediaQueryResult) { this.model.isScreenPortrait = !mediaQueryResult.matches; if (this.model.onScreenPortraitCallback) { this.model.onScreenPortraitCallback(!mediaQueryResult.matches) } this.resetData(); }
AST#method_declaration#Left private onPortrait AST#parameter_list#Left ( AST#parameter#Left mediaQueryResult AST#parameter#Right ) 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 AST...
private onPortrait(mediaQueryResult) { this.model.isScreenPortrait = !mediaQueryResult.matches; if (this.model.onScreenPortraitCallback) { this.model.onScreenPortraitCallback(!mediaQueryResult.matches) } this.resetData(); }
https://github.com/smarthane/DrawerLayout.git/blob/0f6e554c8451ff3bd28f5f718cc7d4329a5fa5ec/DrawerLayout/src/main/ets/components/DrawerLayout.ets#L48-L54
3edf47d5b48211ad8a4c3db8e426d04fc6209bc0
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
CanvasDraw/entry/src/main/ets/view/GlassCoverView.ets
arkts
GlassCoverView
glass overlay effect
@Preview @Component export default struct GlassCoverView { @Prop @Watch('onDraw') pointsToDraw: number[][] = []; private settings = new RenderingContextSettings(true); private renderContext = new CanvasRenderingContext2D(this.settings); private viewWidth: number = 0; private viewHeight: number = 0; build()...
AST#decorated_export_declaration#Left AST#decorator#Left @ Preview AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export default struct GlassCoverView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right AST#decorator#Left @ Watch ( AST#expression...
@Preview @Component export default struct GlassCoverView { @Prop @Watch('onDraw') pointsToDraw: number[][] = []; private settings = new RenderingContextSettings(true); private renderContext = new CanvasRenderingContext2D(this.settings); private viewWidth: number = 0; private viewHeight: number = 0; build()...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/CanvasDraw/entry/src/main/ets/view/GlassCoverView.ets#L27-L92
de21fa4c400c09a66251a1b834d3f53eb96e354b
gitee
openharmony-sig/knowledge_demo_smart_home
6cdf5d81ef84217f386c4200bfc4124a0ded5a0d
FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets
arkts
createDevice
创建设备 @param deviceId 设备ID,name 设备名称,ownerId 所有者ID
static async createDevice(deviceId: string, name: string, ownerId: string, secret: string, typeId: number) { let postData = { id: deviceId, name: name, ownerId: ownerId, secret: secret, typeId: typeId } let httpRequest = http.createHttp(); let data = await httpRequest.requ...
AST#method_declaration#Left static async createDevice AST#parameter_list#Left ( AST#parameter#Left deviceId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#p...
static async createDevice(deviceId: string, name: string, ownerId: string, secret: string, typeId: number) { let postData = { id: deviceId, name: name, ownerId: ownerId, secret: secret, typeId: typeId } let httpRequest = http.createHttp(); let data = await httpRequest.requ...
https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets#L185-L215
34aae3257a45e7c51662251f88d80c3abd5c3ba5
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.deviceInfo.d.ets
arkts
get
Obtains the Distribution OS version. <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS version. distributionOSVersion will return the ISV OS version If ISV not specified, it will return the same value as osFullName @syscap SystemCapability.Startup.SystemInfo @since 20 @arkts 1.2
static get distributionOSVersion(): string;
AST#method_declaration#Left static get AST#ERROR#Left distributionOSVersion AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right
static get distributionOSVersion(): string;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.deviceInfo.d.ets#L408-L408
904ad0558187f93b40438ba49b6524db9d8c4e58
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/NumberUtil.ets
arkts
toNumber
将字符串转换为Number。 @param value 要转换的字符串 @param defaultValue 异常时给默认值 @returns
static toNumber(value: string, defaultValue: number = Number.NaN): number { let num = Number(value).valueOf(); if (isNaN(num)) { return defaultValue; } return num }
AST#method_declaration#Left static toNumber AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left defaultValue : AST#type_annotation#Left AST#primary_type#Left number AST#primar...
static toNumber(value: string, defaultValue: number = Number.NaN): number { let num = Number(value).valueOf(); if (isNaN(num)) { return defaultValue; } return num }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/NumberUtil.ets#L101-L107
21071bc65696f93beb426855e465e0c1e5038eca
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/FileManagement/Photos/entry/src/main/ets/pages/PhotoGridPage.ets
arkts
onInActive
The callback when current page is in the background
onInActive(): void { if (this.isActive) { Log.info(TAG, 'onInActive'); this.isActive = false; } }
AST#method_declaration#Left onInActive AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expres...
onInActive(): void { if (this.isActive) { Log.info(TAG, 'onInActive'); this.isActive = false; } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/FileManagement/Photos/entry/src/main/ets/pages/PhotoGridPage.ets#L392-L397
a8f5a03872c2ca9467baef30f7fb3fb64e94d246
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/CharUtil.ets
arkts
isDigit
判断字符串char是否是数字 @param char @returns
static isDigit(char: string): boolean { return i18n.Unicode.isDigit(char); }
AST#method_declaration#Left static isDigit AST#parameter_list#Left ( AST#parameter#Left char : 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#R...
static isDigit(char: string): boolean { return i18n.Unicode.isDigit(char); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/CharUtil.ets#L31-L33
fb90248442ec496581f9b4fe533d228da8d83131
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/RegexUtil.ets
arkts
isEmoji
判断字符串是否包含表情(匹配单个emoji或多个组合emoji的正则表达式) 注意:这个正则表达式可能不是完美的,因为新的emoji不断被添加到Unicode标准中 @param content @returns
static isEmoji(content: string): boolean { return RegexUtil.isMatch(content, RegexUtil.REG_EMOJI); }
AST#method_declaration#Left static isEmoji AST#parameter_list#Left ( AST#parameter#Left content : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_typ...
static isEmoji(content: string): boolean { return RegexUtil.isMatch(content, RegexUtil.REG_EMOJI); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/RegexUtil.ets#L248-L250
b2e1d3c82551a5105f67fea2be56dfba554fcc66
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/multiplescreening/src/main/ets/components/InfoCard.ets
arkts
InfoCard
最大行数 功能描述: 1.对列表数据进行渲染。 实现原理: 1.使用LazyForEach渲染卡片信息,使用ForEach渲染每个卡片里面小列表。 @param {SiteListDataSource} siteList - 场地信息集合(必需) @param {Array<string>} changData - 选择的数据的数组(必需)
@Component export struct InfoCard { @Link siteList: SiteListDataSource; // 场地信息集合 @Link changData: Array<string>; // 选择的数据的数组 build() { Column() { List() { LazyForEach(this.siteList, (site: SiteItem) => { ListItem() { Column() { this.productDetails(site) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct InfoCard AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right siteList : AST#type_annotation#Left AST#primary_type#Left SiteListDataSource AST#primary_type#Right AST#ty...
@Component export struct InfoCard { @Link siteList: SiteListDataSource; @Link changData: Array<string>; build() { Column() { List() { LazyForEach(this.siteList, (site: SiteItem) => { ListItem() { Column() { this.productDetails(site) this.produ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/multiplescreening/src/main/ets/components/InfoCard.ets#L34-L157
514adee7afa27b7a56f66e250f3a91fe4f9a99ce
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.util.d.ets
arkts
encodeInto
UTF-8 encodes the input string and returns a Uint8Array containing the encoded bytes. @param { string } [input] - The string to be encoded. @returns { Uint8Array } Returns the encoded text. @syscap SystemCapability.Utils.Lang @crossplatform @atomicservice @since 20
encodeInto(input?: string): Uint8Array;
AST#method_declaration#Left encodeInto AST#parameter_list#Left ( AST#parameter#Left input ? : 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 Uint8Array AST#primary_type...
encodeInto(input?: string): Uint8Array;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1096-L1096
265bee555ce5412389f9f386c221a437f160d541
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_history_index_x_functions.ets
arkts
Access the disk and returns the label-link string[][] histories for given timestamps @param timestamps the timestamps of history @param max max number of result @returns the label-link string[][] histories, for example [["SEARCH", "bing.com"], ["CCW", "ccw.site"], ...]
export function get_histories_from_disk(timestamps: number[], max?: number): string[][] { let result: string[][] = []; if (timestamps.length == 0) { return []; } // console.log(log_head() + 'Starting to get history.') let year = new Date(timestamps[0]).getUTCFullYear(); let month = new Date(timestamps[0...
AST#export_declaration#Left export AST#function_declaration#Left function get_histories_from_disk AST#parameter_list#Left ( AST#parameter#Left timestamps : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Ri...
export function get_histories_from_disk(timestamps: number[], max?: number): string[][] { let result: string[][] = []; if (timestamps.length == 0) { return []; } let year = new Date(timestamps[0]).getUTCFullYear(); let month = new Date(timestamps[0]).getUTCMonth() + 1; let last_year = year; let las...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history_index_x_functions.ets#L196-L261
15647461a6e7c0b5f5ab84ddfba27e1ba5f1bc55
gitee
mhtcgr/ToDoList_For_Harmony.git
356d4c9a507205f02870e970203022a380c8a2a1
entry/src/main/ets/model/model.ets
arkts
初始化
constructor() { this.PriorityLevel = 0; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . PriorityLevel AST#me...
constructor() { this.PriorityLevel = 0; }
https://github.com/mhtcgr/ToDoList_For_Harmony.git/blob/356d4c9a507205f02870e970203022a380c8a2a1/entry/src/main/ets/model/model.ets#L70-L72
445349f6982e6264b160d8cf6f39f527506b5682
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/NotificationTypes.ets
arkts
日期范围接口
export interface DateRange { start: string; end: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface DateRange AST#object_type#Left { AST#type_member#Left start : 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 end : AST#type_annotation#Left AST...
export interface DateRange { start: string; end: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/NotificationTypes.ets#L103-L106
cc6faf7472751c48dde2e4738faef8a4f1d6c7a1
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/networkstatusobserver/Index.ets
arkts
VideoPage
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 { VideoPage } from './src/main/ets/pages/VideoPage';
AST#export_declaration#Left export { VideoPage } from './src/main/ets/pages/VideoPage' ; AST#export_declaration#Right
export { VideoPage } from './src/main/ets/pages/VideoPage';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/networkstatusobserver/Index.ets#L16-L16
d4ed2fd359c67517b1ea05bab21fe2c38fe464f4
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/DeviceUtils.ets
arkts
getNowCurrent
获取当前设备电池的电流,单位毫安。 @returns
static getNowCurrent(): number { return batteryInfo.nowCurrent; }
AST#method_declaration#Left static getNowCurrent AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_exp...
static getNowCurrent(): number { return batteryInfo.nowCurrent; }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/DeviceUtils.ets#L216-L218
2c80997d87bbf5ce9699ba010cd1052d4b9558b6
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/BaseInterface.ets
arkts
基础接口
export interface BaseInterface { // 当前选中的页签索引 curIndex: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface BaseInterface AST#object_type#Left { // 当前选中的页签索引 AST#type_member#Left curIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interfa...
export interface BaseInterface { curIndex: number; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/BaseInterface.ets#L20-L23
bfe24ac9a6509ab9574bad4dffdfa146e7ef46e0
gitee
njkndxz/learn-ArkTs.git
70fabab8ee28e3637329d53a4ec93afc72a001c2
entry/src/main/ets/pages/学习/40.生命周期.ets
arkts
aboutToDisappear
组件被销毁时
aboutToDisappear(): void { }
AST#method_declaration#Left aboutToDisappear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
aboutToDisappear(): void { }
https://github.com/njkndxz/learn-ArkTs.git/blob/70fabab8ee28e3637329d53a4ec93afc72a001c2/entry/src/main/ets/pages/学习/40.生命周期.ets#L31-L32
1ff11e358bc20433b15d11ded047752efa55245a
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/OrderRepository.ets
arkts
@file 订单仓库,封装订单相关网络请求 @author Joker.X
export class OrderRepository { /** * 订单网络数据源 */ private networkDataSource: OrderNetworkDataSource; /** * 构造函数 * @param networkDataSource 可选的数据源实例,便于测试注入 */ constructor(networkDataSource?: OrderNetworkDataSource) { this.networkDataSource = networkDataSource ?? new OrderNetworkDataSourceImpl()...
AST#export_declaration#Left export AST#class_declaration#Left class OrderRepository AST#class_body#Left { /** * 订单网络数据源 */ AST#property_declaration#Left private networkDataSource : AST#type_annotation#Left AST#primary_type#Left OrderNetworkDataSource AST#primary_type#Right AST#type_annotation#Right ; AST#property...
export class OrderRepository { private networkDataSource: OrderNetworkDataSource; constructor(networkDataSource?: OrderNetworkDataSource) { this.networkDataSource = networkDataSource ?? new OrderNetworkDataSourceImpl(); } async alipayAppPay(params: Record<string, number>): Promise<NetworkResponse...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/OrderRepository.ets#L19-L121
028b22b1536dfe8008c8208dd728114e0fee5d79
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/AbilityUtils.ets
arkts
openBrowser
打开外部浏览器 @param url @param options
static openBrowser(url: string, options?: StartOptions) { let want: Want = { action: 'ohos.want.action.viewData', entities: ['entity.system.browsable'], uri: url } let context = getContext() as common.UIAbilityContext context.startAbility(want, options) }
AST#method_declaration#Left static openBrowser 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 options ? : AST#type_annotation#Left AST#primary_type#Left StartOptions AST#pr...
static openBrowser(url: string, options?: StartOptions) { let want: Want = { action: 'ohos.want.action.viewData', entities: ['entity.system.browsable'], uri: url } let context = getContext() as common.UIAbilityContext context.startAbility(want, options) }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/AbilityUtils.ets#L82-L90
15d7e2946cc314cd530d671b546acdab6cb904c8
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/shortvideo/src/main/ets/view/Side.ets
arkts
Side
展示视频播放界面右侧用户头像、视频评论数量、收藏数量、分享数量、作者是否被用户关注等信息
@Component export struct Side { @State head: ResourceStr = $r("app.media.shortvideo_app_icon"); // 头像 @State likeCount: string = ''; // 点赞数量 @State commentCount: string = ''; // 评论数量 @State favoriteCount: string = ''; // 收藏数量 @State shareCount: string = ''; // 分享数量 @State isFocus: boolean = true; // 是否关注 ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct Side AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right head : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#...
@Component export struct Side { @State head: ResourceStr = $r("app.media.shortvideo_app_icon"); @State likeCount: string = ''; @State commentCount: string = ''; @State favoriteCount: string = ''; @State shareCount: string = ''; @State isFocus: boolean = true; @State isLike: boolean = false; @Stat...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/shortvideo/src/main/ets/view/Side.ets#L21-L218
59d4434306307d590331c71f1050137bd7011cf6
gitee
openharmony/multimedia_camera_framework
9873dd191f59efda885bc06897acf9b0660de8f2
frameworks/js/camera_napi/demo/entry/src/main/ets/views/CountdownPage.ets
arkts
CountdownPage
倒计时页面
@Component export struct CountdownPage { @Link countdownNum: number; // 倒计时的值 private countdownListData: Array<string> = ['2', '5', '10']; // 循环渲染 @StorageLink('countdownBol') countdownBol: boolean = true; build() { Row() { if (this.countdownBol && !this.countdownNum) { Row() { Butt...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CountdownPage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right countdownNum : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_...
@Component export struct CountdownPage { @Link countdownNum: number; private countdownListData: Array<string> = ['2', '5', '10']; @StorageLink('countdownBol') countdownBol: boolean = true; build() { Row() { if (this.countdownBol && !this.countdownNum) { Row() { Button() { ...
https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/demo/entry/src/main/ets/views/CountdownPage.ets#L21-L113
185b1658af92b4a4ace7d35d1989266a7ca449ea
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/dialog/src/main/ets/tips/TipsDialogManager.ets
arkts
showLoading
加载提示 弹窗 @param params
static showLoading(msg: string = ''): string { let dialogVo = new TipsDialogParams(TipsType.LOADING, msg) return PromptActionUtils.getInstance().openCustomDialog<TipsDialogParams>(wrapBuilder(TipsDialogBuilder), dialogVo) }
AST#method_declaration#Left static showLoading AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left...
static showLoading(msg: string = ''): string { let dialogVo = new TipsDialogParams(TipsType.LOADING, msg) return PromptActionUtils.getInstance().openCustomDialog<TipsDialogParams>(wrapBuilder(TipsDialogBuilder), dialogVo) }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/dialog/src/main/ets/tips/TipsDialogManager.ets#L11-L15
525b45cf07055e306aa5c031be64e335d90ad3f7
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Ability/StageAbilityDemo/entry/src/main/ets/view/BalanceComponent.ets
arkts
BalanceComponent
BalanceComponent right: The right component align start. left: The left component align end.
@Component export default struct BalanceComponent { @BuilderParam right: () => void = () => {}; @BuilderParam left: () => void = () => {}; build() { Row() { Row() { this.left() } .layoutWeight(BalanceStyle.LAYOUT_WEIGHT) .align(Alignment.Start) Row() { this.righ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct BalanceComponent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ BuilderParam AST#decorator#Right right : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ...
@Component export default struct BalanceComponent { @BuilderParam right: () => void = () => {}; @BuilderParam left: () => void = () => {}; build() { Row() { Row() { this.left() } .layoutWeight(BalanceStyle.LAYOUT_WEIGHT) .align(Alignment.Start) Row() { this.righ...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Ability/StageAbilityDemo/entry/src/main/ets/view/BalanceComponent.ets#L23-L43
ebaecbdc16e8f83dd5db03e805babff801046aab
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/handwritten/ContentModifierHooks.ets
arkts
@memo
export function hookRatingContentModifier( receiver: ArkRatingComponent, value?: ContentModifier<RatingConfiguration>) { const wrappedBuilder = value?.applyContent() if (!wrappedBuilder) { return } const ratingBuilder = (parentNode: KPointer, config: RatingConfiguration): KPointer => { ...
AST#export_declaration#Left export AST#function_declaration#Left function hookRatingContentModifier AST#parameter_list#Left ( AST#parameter#Left receiver : AST#type_annotation#Left AST#primary_type#Left ArkRatingComponent AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left value ? ...
export function hookRatingContentModifier( receiver: ArkRatingComponent, value?: ContentModifier<RatingConfiguration>) { const wrappedBuilder = value?.applyContent() if (!wrappedBuilder) { return } const ratingBuilder = (parentNode: KPointer, config: RatingConfiguration): KPointer => { ...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/handwritten/ContentModifierHooks.ets#L178-L191
8b35e95b20ad0b8ea2a11a98b47332b74f82298b
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/NumberUtil.ets
arkts
sub
减法 @param x @param y @returns
static sub(x: number, y: number): number { return NumberUtil.subDecimal(x, y).toNumber(); }
AST#method_declaration#Left static sub AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#typ...
static sub(x: number, y: number): number { return NumberUtil.subDecimal(x, y).toNumber(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/NumberUtil.ets#L188-L190
58f3ddafca54fa98b00d0491694ab48f2e17f066
gitee
cuilanxin/ArkTs-demo.git
3764799bb38e1f316055f57dae20822e215cb6f9
features/quickstart/src/main/ets/view/EnablementView.ets
arkts
EnablementView
const title: string = 'Step1 快速入门介绍'; const brief: string = '本篇教程实现了快速入门——一个用于了解和学习HarmonyOS的应用程序 。';
@Preview @Component export struct EnablementView{ // $r('app.media.banner_pic0') @State enablementList: Array<ArticleClass> = []; aboutToAppear(): void { this.getEnablementDataFormJSON() } getEnablementDataFormJSON() { getContext(this).resourceManager.getRawFileContent('EnablementData.json').then(va...
AST#decorated_export_declaration#Left AST#decorator#Left @ Preview AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct EnablementView AST#component_body#Left { // $r('app.media.banner_pic0') AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right enablementList : AS...
@Preview @Component export struct EnablementView{ @State enablementList: Array<ArticleClass> = []; aboutToAppear(): void { this.getEnablementDataFormJSON() } getEnablementDataFormJSON() { getContext(this).resourceManager.getRawFileContent('EnablementData.json').then(value => { let res: string...
https://github.com/cuilanxin/ArkTs-demo.git/blob/3764799bb38e1f316055f57dae20822e215cb6f9/features/quickstart/src/main/ets/view/EnablementView.ets#L48-L95
22ff62d4519a5b4753ad42ed879e8fb9a676799a
github
wustcat404/time-bar
d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8
time_bar/src/main/ets/components/interface/MiddleIndicatorOption.ets
arkts
Visual options for the middle indicator line on the time bar.
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/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/time_bar/src/main/ets/components/interface/MiddleIndicatorOption.ets#L19-L19
6104a1353a1025daf21ab5ebb6eb638aa8b3e6b2
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/share/SharePage.ets
arkts
generateShareImage
生成分享图片
async generateShareImage() { if (!this.contact) return; try { this.isGeneratingImage = true; this.shareImageUrl = await this.socialShareService.createShareImage( this.shareContent, this.contact, 'birthday_card' ); this.showSuccessToast('图片生成成功'); } catch (err...
AST#method_declaration#Left async generateShareImage AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right ...
async generateShareImage() { if (!this.contact) return; try { this.isGeneratingImage = true; this.shareImageUrl = await this.socialShareService.createShareImage( this.shareContent, this.contact, 'birthday_card' ); this.showSuccessToast('图片生成成功'); } catch (err...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/share/SharePage.ets#L139-L156
234985112b7bdd5f6cc9d75ccb95974c8ab6d2bd
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets
arkts
getConnectionState
获取连接状态
getConnectionState(): number { Log.showInfo(TAG, `getConnectionState: mConnectBluetoothDevice.connectionState = ${JSON.stringify(this.mConnectBluetoothDevice.connectionState)}`); return this.mConnectBluetoothDevice.connectionState!; }
AST#method_declaration#Left getConnectionState 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#expression_statement#Left AST#expression#Left AST#call_expression...
getConnectionState(): number { Log.showInfo(TAG, `getConnectionState: mConnectBluetoothDevice.connectionState = ${JSON.stringify(this.mConnectBluetoothDevice.connectionState)}`); return this.mConnectBluetoothDevice.connectionState!; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets#L157-L161
d4a8f5ca59f9be2e28c259d724ceeabe7d44f47b
gitee
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/EditInfoPage.ets
arkts
PhotoDialogBuilder
弹窗内容构建器
@Builder PhotoDialogBuilder() { Column() { // 1. 拍照选项 Button('拍照') .width('100%') .height(55) .fontSize(18) .fontColor('#333333') .backgroundColor('#FFFFFF') .borderRadius(0) .onClick(() => { this.photoDialog.close(); // 选择后关闭弹窗 ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right PhotoDialogBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 1. 拍照选项...
@Builder PhotoDialogBuilder() { Column() { Button('拍照') .width('100%') .height(55) .fontSize(18) .fontColor('#333333') .backgroundColor('#FFFFFF') .borderRadius(0) .onClick(() => { this.photoDialog.close(); }) ...
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/EditInfoPage.ets#L398-L444
a3174020825159f2ad69c54ecbeb84b16222c34b
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/SM4.ets
arkts
TODO SM4加解密 author: 桃花镇童长老ᥫ᭡ since: 2024/07/01
export class SM4 { /** * 加密(GCM模式),异步 * @param data 加密或者解密的数据。data不能为null。 * @param symKey 指定加密或解密的密钥。 * @param gcmParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。 * @param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(SM4_128|GCM|PKCS7、SM4_128|GCM|PKCS5、等) ...
AST#export_declaration#Left export AST#class_declaration#Left class SM4 AST#class_body#Left { /** * 加密(GCM模式),异步 * @param data 加密或者解密的数据。data不能为null。 * @param symKey 指定加密或解密的密钥。 * @param gcmParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。 * @param transformation 待生成Ciph...
export class SM4 { static async encryptGCM(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7'): Promise<cryptoFramework.DataBlob> { let cipher = cryptoFramework.createCipher(transformation); await ciph...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SM4.ets#L25-L399
ee30a2b829bbbad0707590181ad2932e793cf8e4
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/Solutions/Social/GrapeSquare/feature/authorizedControl/src/main/ets/model/TrendsDataSource.ets
arkts
deleteData
删除列表中的对象
public deleteData(data: Trends): void { Logger.info(TAG, `delete data , data = ${data.user.userId}}`); let index = this.indexOf(data); this.deleteDataByIndex(index); }
AST#method_declaration#Left public deleteData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Trends AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#R...
public deleteData(data: Trends): void { Logger.info(TAG, `delete data , data = ${data.user.userId}}`); let index = this.indexOf(data); this.deleteDataByIndex(index); }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/Social/GrapeSquare/feature/authorizedControl/src/main/ets/model/TrendsDataSource.ets#L66-L70
d77d013b51c098ad5db27d4008bb3b7d9b1d4b8a
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Distributed/DistributeDraw/entry/src/main/ets/common/utils/RemoteDeviceUtil.ets
arkts
registerDeviceStateListener
Register the device status listener.
registerDeviceStateListener(): void { if (this.myDeviceManager === undefined) { Logger.error('RemoteDeviceModel', 'registerDeviceStateListener deviceManager has not initialized'); return; } try { // Registering a device status change listener. this.myDeviceManager.on('deviceStateCha...
AST#method_declaration#Left registerDeviceStateListener AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expr...
registerDeviceStateListener(): void { if (this.myDeviceManager === undefined) { Logger.error('RemoteDeviceModel', 'registerDeviceStateListener deviceManager has not initialized'); return; } try { this.myDeviceManager.on('deviceStateChange', (data) => { if (data === null) { ...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/DistributeDraw/entry/src/main/ets/common/utils/RemoteDeviceUtil.ets#L135-L155
12ad30726478f48bfed5c8fc06c1111244bb6aa9
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/state/src/main/ets/WindowSafeAreaState.ets
arkts
updateSafeArea
更新安全区数据 @param {number} topInset - 顶部安全区高度(vp) @param {number} leftInset - 左侧安全区宽度(vp) @param {number} bottomInset - 底部安全区高度(vp) @param {number} rightInset - 右侧安全区宽度(vp) @returns {void} 无返回值 @example state.updateSafeArea(24, 0, 32, 0);
updateSafeArea(topInset: number, leftInset: number, bottomInset: number, rightInset: number): void { this.topInset = topInset; this.leftInset = leftInset; this.bottomInset = bottomInset; this.rightInset = rightInset; }
AST#method_declaration#Left updateSafeArea AST#parameter_list#Left ( AST#parameter#Left topInset : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left leftInset : AST#type_annotation#Left AST#primary_type#Left number AST#primary...
updateSafeArea(topInset: number, leftInset: number, bottomInset: number, rightInset: number): void { this.topInset = topInset; this.leftInset = leftInset; this.bottomInset = bottomInset; this.rightInset = rightInset; }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/state/src/main/ets/WindowSafeAreaState.ets#L50-L55
7870317a67ccb7060c3b3be5eba5f8a2af6475c8
github
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/search/InterpolationSearch.ets
arkts
插值查找算法实现 该算法是二分查找的改进版本,适用于均匀分布的已排序数组
export class InterpolationSearch { /** * 标准插值查找 * @param arr 已排序的数组 * @param target 目标值 * @returns 目标值在数组中的索引,如果不存在则返回-1 */ public static search(arr: number[], target: number): number { if (!arr || arr.length === 0) { return -1; } let left = 0; let right = arr.length - 1; ...
AST#export_declaration#Left export AST#class_declaration#Left class InterpolationSearch AST#class_body#Left { /** * 标准插值查找 * @param arr 已排序的数组 * @param target 目标值 * @returns 目标值在数组中的索引,如果不存在则返回-1 */ AST#method_declaration#Left public static search AST#parameter_list#Left ( AST#parameter#Left arr : AST#ty...
export class InterpolationSearch { public static search(arr: number[], target: number): number { if (!arr || arr.length === 0) { return -1; } let left = 0; let right = arr.length - 1; while (left <= right && target >= arr[left] && target <= arr[right]) { if (left === right) { ...
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/search/InterpolationSearch.ets#L5-L170
bae80011ade45f99fcbed8e87dd90e07a942c7d8
github
Lateautumn00/HarmonyOS_WeChat.git
88993b308d5018c11d4e6ddf7838a96c6384201c
entry/src/main/ets/typings/interface.d.ets
arkts
列表 image 图片 name 名称 isShow 是否展示
export interface ListComs{ image:string name:string isShow?:Boolean path?:string buttonType?:string buttonIsOn?:Boolean }
AST#export_declaration#Left export AST#interface_declaration#Left interface ListComs AST#object_type#Left { AST#type_member#Left image : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right AST#type_member#Left name : AST#type_annotation#Left AST#p...
export interface ListComs{ image:string name:string isShow?:Boolean path?:string buttonType?:string buttonIsOn?:Boolean }
https://github.com/Lateautumn00/HarmonyOS_WeChat.git/blob/88993b308d5018c11d4e6ddf7838a96c6384201c/entry/src/main/ets/typings/interface.d.ets#L3-L10
6ed206dc431e63bcee0243d317798f62cae6171d
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/web/src/main/ets/WebViewManager.ets
arkts
prepareForPageLoad
预加载 @param url @param connect @param numSockets
static prepareForPageLoad(url: string | string[], connect: boolean = true, numSockets: number = 2) { if (Array.isArray(url)) { url.forEach((item) => webview.WebviewController.prepareForPageLoad(item, connect, numSockets)) } else { webview.WebviewController.prepareForPageLoad(url, connect, numSockets...
AST#method_declaration#Left static prepareForPageLoad AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#union_type#Righ...
static prepareForPageLoad(url: string | string[], connect: boolean = true, numSockets: number = 2) { if (Array.isArray(url)) { url.forEach((item) => webview.WebviewController.prepareForPageLoad(item, connect, numSockets)) } else { webview.WebviewController.prepareForPageLoad(url, connect, numSockets...
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/web/src/main/ets/WebViewManager.ets#L63-L69
083741dc549c77f3ff588060d7c4b1a55212187c
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Scroll.ets
arkts
LargePaddingHorizontalScroll
带大内边距的水平滚动布局
@ComponentV2 export struct LargePaddingHorizontalScroll { /** * 滚动控制器 */ @Param scroller: Scroller = new Scroller(); /** * 是否填充最大尺寸 */ @Param fillMaxSize: boolean = false; /** * 是否填充最大宽度 */ @Param fillMaxWidth: boolean = true; /** * 宽度 */ @Param widthValue: Length | undef...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct LargePaddingHorizontalScroll AST#component_body#Left { /** * 滚动控制器 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right scroller : AST#type_annotation#Left AST#primary_type#Left Scro...
@ComponentV2 export struct LargePaddingHorizontalScroll { @Param scroller: Scroller = new Scroller(); @Param fillMaxSize: boolean = false; @Param fillMaxWidth: boolean = true; @Param widthValue: Length | undefined = undefined; @Param heightValue: Length | undefined = undefined; @...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Scroll.ets#L514-L568
567c6995c1a260873963b0e3b93328f3db2b336a
github
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/common/ThemeManager.ets
arkts
resetToDefault
重置为默认主题
async resetToDefault(): Promise<boolean> { return await this.setCurrentTheme('minimal'); }
AST#method_declaration#Left async resetToDefault 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 boolean AST#primary_type#Right AST#type_annotation#Right > AST#typ...
async resetToDefault(): Promise<boolean> { return await this.setCurrentTheme('minimal'); }
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/ThemeManager.ets#L251-L253
23984086f3c5663c7124a3cd033779d611bd796b
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/app/views/CircleView.ets
arkts
CircleView
======================= CircleView =======================
@ComponentV2 export struct CircleView { // ========== 外部参数 ========== @Param parts : GraphPart[] = []; @Param allCount : number = 100; @Param ringWidth : number = 40; @Param ring3DWidth : number = 8...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct CircleView AST#component_body#Left { // ========== 外部参数 ========== AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right parts : AST#type_annotation#Left AST#primary_type#Left AST#array_type#L...
@ComponentV2 export struct CircleView { @Param parts : GraphPart[] = []; @Param allCount : number = 100; @Param ringWidth : number = 40; @Param ring3DWidth : number = 8; @Param bgColor ...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/CircleView.ets#L19-L108
e1521d1094688d1fe6aaaea8f9ddc10f75bd69c1
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets
arkts
EnvProp
Called when a property value is checked. @since 7 @deprecated since 10
static EnvProp<T>(key: string, value: T): boolean { return Environment.envProp(key, value) }
AST#method_declaration#Left static EnvProp AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Rig...
static EnvProp<T>(key: string, value: T): boolean { return Environment.envProp(key, value) }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L298-L300
70305dd53839ee448f191d19a335b3f7a1f9efe5
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/util/CryptoSyncUtil.ets
arkts
decodeCBC
解密-CBC模式 @param str 加密的字符串 @param aesKey 给定秘钥规格密钥 @param iv iv偏移量字符串 @param symAlgName 秘钥规格 @param symEncryptName 加密规格 @param keyName 密钥长度 @param keyCoding 密钥编码方式(utf8/hex/base64) @param dataCoding 入参字符串编码方式(hex/base64) @returns
static decodeCBC(str: string, key: string, iv: string, symAlgName: string, symEncryptName: string, keyName: number, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding): OutDTO<string> { //转换密钥 let symKey = CryptoSyncUtil.convertKeyFromStr(key, symAlgName, keyName, keyCoding); // 初始化加解密操...
AST#method_declaration#Left static decodeCBC AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Rig...
static decodeCBC(str: string, key: string, iv: string, symAlgName: string, symEncryptName: string, keyName: number, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding): OutDTO<string> { let symKey = CryptoSyncUtil.convertKeyFromStr(key, symAlgName, keyName, keyCoding); let mode = ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoSyncUtil.ets#L223-L237
3c1be8b6b2d3de624292f2385d45e91bcb772b64
gitee
JinnyWang-Space/guanlanwenjuan.git
601c4aa6c427e643d7bf42bc21945f658738e38c
common/src/main/ets/database/DistributedDB.ets
arkts
getSurveyById
根据 id 获取当前问卷的所有数据
async getSurveyById(surveyId: number): Promise<Survey | null> { if (!this.rdbStore) { Logger.info('[getSurveyById]', 'getSurveyById() has no callback!'); return null; } try { const surveyPredicates: relationalStore.RdbPredicates = new relationalStore.RdbPredicates('surveys'); ...
AST#method_declaration#Left async getSurveyById AST#parameter_list#Left ( AST#parameter#Left surveyId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#...
async getSurveyById(surveyId: number): Promise<Survey | null> { if (!this.rdbStore) { Logger.info('[getSurveyById]', 'getSurveyById() has no callback!'); return null; } try { const surveyPredicates: relationalStore.RdbPredicates = new relationalStore.RdbPredicates('surveys'); ...
https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/common/src/main/ets/database/DistributedDB.ets#L117-L175
24a755b11f2d43a9ae1c846e4629ecf5b49c22a5
github
DompetApp/Dompet.harmony.git
ba5aae3d265458588a4866a71f9ac55bbd0a4a92
entry/src/main/ets/configure/sqlite.ets
arkts
initUserDatabase
创建/关闭/销毁 User Database
static async initUserDatabase(): Promise<void> { Sqliter.appUser ??= await AppDatabaser.recentUser() return Sqliter.openUserDatabase() }
AST#method_declaration#Left static async initUserDatabase 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 > A...
static async initUserDatabase(): Promise<void> { Sqliter.appUser ??= await AppDatabaser.recentUser() return Sqliter.openUserDatabase() }
https://github.com/DompetApp/Dompet.harmony.git/blob/ba5aae3d265458588a4866a71f9ac55bbd0a4a92/entry/src/main/ets/configure/sqlite.ets#L54-L57
3df3c5d6d29c975f630a9e9498c18b2906eee38e
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/OHLayoutAlign/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
with percent of the index component
export const INDEX_COMPONENT_WITH_PERCENT: string = '93.3%';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left INDEX_COMPONENT_WITH_PERCENT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '93.3%' AST#expression#Right AST#variable_declarator#Right ; AST...
export const INDEX_COMPONENT_WITH_PERCENT: string = '93.3%';
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/OHLayoutAlign/entry/src/main/ets/common/constants/CommonConstants.ets#L44-L44
873c198bcbaa414959df569a27415d831dbec6bd
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
getTodosOnDate
获取指定日期的代办事项
private getTodosOnDate(date: Date): TodoItem[] { return this.todos.filter(todo => { if (!todo.dueDate) return false; return todo.dueDate.getFullYear() === date.getFullYear() && todo.dueDate.getMonth() === date.getMonth() && todo.dueDate.getDate() === date.getDate(); }); }
AST#method_declaration#Left private getTodosOnDate AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ...
private getTodosOnDate(date: Date): TodoItem[] { return this.todos.filter(todo => { if (!todo.dueDate) return false; return todo.dueDate.getFullYear() === date.getFullYear() && todo.dueDate.getMonth() === date.getMonth() && todo.dueDate.getDate() === date.getDate(); }); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L4397-L4404
106e22ac4d408b463bc60aa2330ee447363ab68c
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ColorTemplate.ets
arkts
getHoloBlue
@return
public static getHoloBlue(): number { return Color.rgb(51, 181, 229); }
AST#method_declaration#Left public static getHoloBlue 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#call_...
public static getHoloBlue(): number { return Color.rgb(51, 181, 229); }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ColorTemplate.ets#L212-L214
251aaa378e2d961c522931f61439a590fe4f8d6f
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/TodoTypes.ets
arkts
更新代办事项参数
export interface UpdateTodoParams { id: string; title?: string; description?: string; date?: string; time?: string; type?: TodoType; priority?: TodoPriority; status?: TodoStatus; tags?: string[]; isAllDay?: boolean; reminder?: boolean; reminderTime?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface UpdateTodoParams AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left title ? : AST#type_annotation#...
export interface UpdateTodoParams { id: string; title?: string; description?: string; date?: string; time?: string; type?: TodoType; priority?: TodoPriority; status?: TodoStatus; tags?: string[]; isAllDay?: boolean; reminder?: boolean; reminderTime?: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/TodoTypes.ets#L65-L78
ff231e416aad31f381e30349475475741085cefe
github
xsdkhlgz/ATSOBJECT_OF_FIRST.git
8c14e875d7ec3f418bb7cdaae123a8fea87a7e76
entry/src/main/ets/viewmodel/RecordItem.ets
arkts
饮食记录中的记录项,可以是食物或运动
export default class RecordItem{ // id id:number //名称 name:ResourceStr //图片 image:ResourceStr //分类 categoryId:number //包含的卡路里 calorie:number //单位 unit:ResourceStr //潭水含量,单位(克) carbon:number //蛋白质含量,单位(克) protein:number //脂肪含量,单位(克) fat:number constructor
AST#export_declaration#Left export AST#ERROR#Left default class RecordItem { // id 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 name : ResourceStr //图片 image AST#ERROR#Right : AST#ERROR#Left ResourceStr //分...
export default class RecordItem{ id:number name:ResourceStr image:ResourceStr categoryId:number calorie:number unit:ResourceStr carbon:number protein:number fat:number constructor
https://github.com/xsdkhlgz/ATSOBJECT_OF_FIRST.git/blob/8c14e875d7ec3f418bb7cdaae123a8fea87a7e76/entry/src/main/ets/viewmodel/RecordItem.ets#L3-L23
4eb7f709aedcb8ebc6e75014ab53f0f003d91e8d
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.DialogV2.d.ets
arkts
AdvancedDialogV2Button
Declare AdvancedDialogV2Button. @class AdvancedDialogV2Button @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 18
@ObservedV2 export declare class AdvancedDialogV2Button { /** * Sets the Display Content of a Button. * * @type { ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 18 */ @Trace content: ResourceStr; /** * Sets the Button Callback. ...
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right class AdvancedDialogV2Button AST#class_body#Left { /** * Sets the Display Content of a Button. * * @type { ResourceStr }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @...
@ObservedV2 export declare class AdvancedDialogV2Button { @Trace content: ResourceStr; @Trace action?: AdvancedDialogV2ButtonAction; @Trace background?: ColorMetrics; @Trace fontColor?: ColorMetrics; @Trace buttonStyle?: ButtonStyleMode; @Trace role?: ButtonRole; @Trace ...
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.DialogV2.d.ets#L41-L145
9e5c408c665df6fe006edb95c2f3bd47f40ff00a
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/navigation/CommonGraph.ets
arkts
register
注册公共模块导航路由
register(): void { RouteBuild.register(CommonRoutes.About, wrapBuilder(AboutNav)); RouteBuild.register(CommonRoutes.Web, wrapBuilder(WebNav)); RouteBuild.register(CommonRoutes.Settings, wrapBuilder(SettingsNav)); RouteBuild.register(CommonRoutes.UserAgreement, wrapBuilder(UserAgreementNav)); RouteBu...
AST#method_declaration#Left register AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left...
register(): void { RouteBuild.register(CommonRoutes.About, wrapBuilder(AboutNav)); RouteBuild.register(CommonRoutes.Web, wrapBuilder(WebNav)); RouteBuild.register(CommonRoutes.Settings, wrapBuilder(SettingsNav)); RouteBuild.register(CommonRoutes.UserAgreement, wrapBuilder(UserAgreementNav)); RouteBu...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/navigation/CommonGraph.ets#L18-L25
3c2fafc14d4bb1a52b99bb912571eb1397cd290a
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ClickResponseOptimization/entry/src/main/ets/pages/CameraPage.ets
arkts
releaseCamera
release resources
public async releaseCamera() { try { // Photo Mode Session Paused await captureSession?.stop(); // Photo Mode Session Class Release await captureSession?.release(); // Turn off object class for photo input await cameraInput?.close(); // Preview output object class release ...
AST#method_declaration#Left public async releaseCamera AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { // Photo Mode Session Paused AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expre...
public async releaseCamera() { try { await captureSession?.stop(); await captureSession?.release(); await cameraInput?.close(); await previewOutput?.release(); await cameraOutput?.release(); } catch (e) { hilog.error(0x00, 'release input out...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ClickResponseOptimization/entry/src/main/ets/pages/CameraPage.ets#L42-L57
38d492cfacddf0a6d36c6558d1030fe747e4cb45
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/NotificationManager.ets
arkts
sendBatchBirthdayNotifications
批量发送生日提醒
async sendBatchBirthdayNotifications(): Promise<void> { if (!this.settings?.notification.enabled) { return; } try { const upcomingBirthdays = await this.getUpcomingBirthdays(); for (const item of upcomingBirthdays) { await this.sendBirthdayNotification(item.contact, item.da...
AST#method_declaration#Left async sendBatchBirthdayNotifications 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#Ri...
async sendBatchBirthdayNotifications(): Promise<void> { if (!this.settings?.notification.enabled) { return; } try { const upcomingBirthdays = await this.getUpcomingBirthdays(); for (const item of upcomingBirthdays) { await this.sendBirthdayNotification(item.contact, item.da...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationManager.ets#L276-L298
3ef4d18457f88360c1132ba7ce722c741e558109
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/GreetingTypes.ets
arkts
礼物推荐接口
export interface GiftRecommendation { id: string; name: string; description: string; type: GiftType; priceRange: PriceRange; estimatedPrice: string; reasoning: string; suitability: number; // 1-10评分 tags: string[]; imageUrl?: string; purchaseLinks?: string[]; alternatives?: string[]; personali...
AST#export_declaration#Left export AST#interface_declaration#Left interface GiftRecommendation AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#L...
export interface GiftRecommendation { id: string; name: string; description: string; type: GiftType; priceRange: PriceRange; estimatedPrice: string; reasoning: string; suitability: number; tags: string[]; imageUrl?: string; purchaseLinks?: string[]; alternatives?: string[]; personalizedNote: ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GreetingTypes.ets#L548-L563
69f5c30208fd1c6b1a872c82a3ef9bf84af5406e
github
anhao0226/harmony-music-player.git
4bc1d8f9f5fdb573af387d3ba9ad333c9beb8073
entry/src/main/ets/api/SongApi.ets
arkts
获取mv详情 @param mvId @returns
export function fetchMovieDetail(mvId: number) { const params = { mvid: mvId }; return new Promise <MvDetail>((resolve, reject) => { httpRequestGet<MvDetailResponse>(AccessUrls.MvDetail, { queryParams: params }) .then((res) => { if (res.code === 200) { resolve(res.data); } else {...
AST#export_declaration#Left export AST#function_declaration#Left function fetchMovieDetail AST#parameter_list#Left ( AST#parameter#Left mvId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { ...
export function fetchMovieDetail(mvId: number) { const params = { mvid: mvId }; return new Promise <MvDetail>((resolve, reject) => { httpRequestGet<MvDetailResponse>(AccessUrls.MvDetail, { queryParams: params }) .then((res) => { if (res.code === 200) { resolve(res.data); } else {...
https://github.com/anhao0226/harmony-music-player.git/blob/4bc1d8f9f5fdb573af387d3ba9ad333c9beb8073/entry/src/main/ets/api/SongApi.ets#L244-L260
e496b8d2a40108fc2b19b625204d2a1a2fc59661
github