nwo stringclasses 449
values | path stringlengths 9 173 | language stringclasses 1
value | identifier stringlengths 1 53 | docstring stringlengths 5 4.13k | function stringlengths 10 87.2k | ast_function stringlengths 351 354k | obf_function stringlengths 10 87.2k | url stringlengths 30 175 | function_sha stringlengths 40 40 | source stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|
LJ666-ui/harmony-health-care | entry/src/main/ets/aiagent/OphthalmologyAgent.ets | arkts | getMyopiaPreventionAdvice | 近视预防建议 | private getMyopiaPreventionAdvice(): string {
return `【近视预防建议】
1. **科学用眼**
- 保持正确读写姿势
- 读写距离保持33cm以上
- 每用眼40分钟休息10分钟
2. **户外活动**
- 每天户外活动2小时以上
- 自然光有助于预防近视
- 多进行远眺活动
3. **光线环境**
- 读写时光线要充足
- 避免在强光或暗光下用眼
- 使用护眼台灯
4. **营养均衡**
- 补充维生素A、C、E
- 多吃绿叶蔬菜和水果
- 适量补充DHA
5. **定期检查**
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getMyopiaPreventionAdvice AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Le... | private getMyopiaPreventionAdvice(): string {
return `【近视预防建议】
1. **科学用眼**
- 保持正确读写姿势
- 读写距离保持33cm以上
- 每用眼40分钟休息10分钟
2. **户外活动**
- 每天户外活动2小时以上
- 自然光有助于预防近视
- 多进行远眺活动
3. **光线环境**
- 读写时光线要充足
- 避免在强光或暗光下用眼
- 使用护眼台灯
4. **营养均衡**
- 补充维生素A、C、E
- 多吃绿叶蔬菜和水果
- 适量补充DHA
5. **定期检查**
... | https://github.com/LJ666-ui/harmony-health-care | b984cd5984c42f254fa38ae25a20055cdb67f854 | github |
openharmony/arkui_ace_engine | examples/Info/entry/src/main/ets/pages/progress/ProgressTestCase006.ets | arkts | progress2 | contentModifier设置了小于Progress的宽高 | @Builder
function progress2(config: ProgressConfiguration) {
Column() {
Row({ space: 2 }) {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.select(config.enabled && config.value >= 20 ? true : false)
.selectedColor(0xed6f21)
.shape(CheckBoxShape.CIRCLE)
Checkbox({ name... | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left progress2 AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#require... | @Builder
function progress2(config: ProgressConfiguration) {
Column() {
Row({ space: 2 }) {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.select(config.enabled && config.value >= 20 ? true : false)
.selectedColor(0xed6f21)
.shape(CheckBoxShape.CIRCLE)
Checkbox({ name... | https://gitee.com/openharmony/arkui_ace_engine.git | bd94a1b05bbe25f58bff4c546de09d9930b3ab66 | gitee |
killetom/ktretrofit | ktretrofit/src/main/ets/retrofit/util/MetadataUtil.ets | arkts | markMultipart | Mark a method as multipart | static markMultipart(target: Object, propertyKey: string | symbol): void {
this.defineMetadata('retrofit:isMultipart', true, target, propertyKey);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left markMultipart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left target AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | static markMultipart(target: Object, propertyKey: string | symbol): void {
this.defineMetadata('retrofit:isMultipart', true, target, propertyKey);
} | https://github.com/killetom/ktretrofit | 028960936931cfe1acddda12250cbf471542a264 | github |
openharmony/applications_mms | entry/src/main/ets/utils/MmsPreferences.ets | arkts | getValueOfAutoRetrieveMmsSwitch | Obtains the value of the function of automatically downloading MMS messages. | public getValueOfAutoRetrieveMmsSwitch(): string {
return <string> this.getValueFromMap(common.string.KEY_OF_AUTO_RETRIEVE_SWITCH,
common.AUTO_RETRIEVE_MMS.NOT_WHEN_ROAMING);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getValueOfAutoRetrieveMmsSwitch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string... | public getValueOfAutoRetrieveMmsSwitch(): string {
return <string> this.getValueFromMap(common.string.KEY_OF_AUTO_RETRIEVE_SWITCH,
common.AUTO_RETRIEVE_MMS.NOT_WHEN_ROAMING);
} | https://gitee.com/openharmony/applications_mms.git | 89679dadcc4dccee4376865255b87da7c8e06f46 | gitee |
Joker-x-dev/CoolMallArkTS | feature/user/src/main/ets/viewmodel/FootprintViewModel.ets | arkts | convertFootprintsToGoods | 将足迹列表转换为商品列表
@param {Footprint[]} footprints - 足迹列表
@returns {Goods[]} 商品列表 | private convertFootprintsToGoods(footprints: Footprint[]): Goods[] {
return footprints.map((item: Footprint): Goods => {
const goods = new Goods();
goods.id = item.goodsId;
goods.title = item.goodsName;
goods.subTitle = item.goodsSubTitle ?? "";
goods.mainPic = item.goodsMainPic;
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertFootprintsToGoods AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left footprints AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AS... | private convertFootprintsToGoods(footprints: Footprint[]): Goods[] {
return footprints.map((item: Footprint): Goods => {
const goods = new Goods();
goods.id = item.goodsId;
goods.title = item.goodsName;
goods.subTitle = item.goodsSubTitle ?? "";
goods.mainPic = item.goodsMainPic;
... | https://github.com/Joker-x-dev/CoolMallArkTS | 296284c6cd880c8a48c83756cbdc16a38f71de74 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | set | Copies all elements of arr to the current Uint32Array starting from insertPos.
@param arr array to copy data from
@param insertPos start index where data from arr will be inserted
{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set} | public set(arr: number[], insertPos1: number): void {
const insertPos = insertPos1 as int
if (insertPos < 0 || insertPos + arr.length > this.length) {
throw new RangeError("set(insertPos: int, arr: number[]): size of arr is greater than Uint32Array.length")
}
for (let i =... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | public set(arr: number[], insertPos1: number): void {
const insertPos = insertPos1 as int
if (insertPos < 0 || insertPos + arr.length > this.length) {
throw new RangeError("set(insertPos: int, arr: number[]): size of arr is greater than Uint32Array.length")
}
for (let i =... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 780789bd2241217070f9a1ef4b2e9557cb8e6c9e | gitee |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test36_original_index.ets | arkts | testFlatten | --- Flatten nested array (manual) --- | function testFlatten(): string {
let nested: number[][] = [[1, 2], [3, 4, 5], [6]];
let flat: number[] = [];
for (let i: number = 0; i < nested.length; i++) {
let inner: number[] = nested[i];
for (let j: number = 0; j < inner.length; j++) {
flat.push(inner[j]);
}
}
return String(flat.length)... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testFlatten AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type... | function testFlatten(): string {
let nested: number[][] = [[1, 2], [3, 4, 5], [6]];
let flat: number[] = [];
for (let i: number = 0; i < nested.length; i++) {
let inner: number[] = nested[i];
for (let j: number = 0; j < inner.length; j++) {
flat.push(inner[j]);
}
}
return String(flat.length)... | https://github.com/miaochiahao/ark-ghidra | 9c037f341f51155e1e103184b5dc40ceee50fae8 | github |
openharmony/arkui_ace_engine | advanced_ui_component/treeview/source/treeview.ets | arkts | initSection | update delay init some nodes | public initSection(): void {
this.initHandler(this.listNode, 0, 1);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left initSection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression... | public initSection(): void {
this.initHandler(this.listNode, 0, 1);
} | https://gitee.com/openharmony/arkui_ace_engine.git | 109159c51dd6316822074d13c36ece04aa735a33 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Char.ets | arkts | isPartOfSurrogatePair | isPartOfSurrogatePair() checks whether the underlying char is low or high surrogate.
@returns { boolean }
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public isPartOfSurrogatePair(): boolean {
return Char.isPartOfSurrogatePair(this.value);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isPartOfSurrogatePair AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boo... | public isPartOfSurrogatePair(): boolean {
return Char.isPartOfSurrogatePair(this.value);
} | https://gitcode.com/iop123123/arkts-static-skills | a9feba82bde196439e4fe73168c79e640a81c070 | gitcode |
openharmony/codelabs | ETSUI/PositioningDemo/entry/src/main/ets/service/ReminderService.ets | arkts | getUnreadReminderCount | 获取未读提醒数量 | getUnreadReminderCount(): number {
return this.reminderHistory.filter(r => !r.isRead).length;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getUnreadReminderCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST... | getUnreadReminderCount(): number {
return this.reminderHistory.filter(r => !r.isRead).length;
} | https://gitcode.com/openharmony/codelabs | 67eadc099f54d96b14b1972a9c86de598248cff5 | gitcode |
dingzhilin1990/zhilinclaw | src/security/SandboxedExecutor.ets | arkts | execute | 在沙箱中执行代码
@param code 要执行的代码(WASM 字节码或 JS 字符串)
@param input 输入数据
@param context 执行上下文 | public async execute(
code: Uint8Array | string,
input?: any,
context?: Record<string, any>
): Promise<SandboxResult> {
const startTime = Date.now();
try {
// 安全检查
await this.performSecurityChecks('execute_code');
console.log('[SandboxedExecutor] 开始执行沙箱代码...');
// 创建沙... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left execute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left code AST#identifier#Right AST#:#Left : AST#:#Rig... | public async execute(
code: Uint8Array | string,
input?: any,
context?: Record<string, any>
): Promise<SandboxResult> {
const startTime = Date.now();
try {
// 安全检查
await this.performSecurityChecks('execute_code');
console.log('[SandboxedExecutor] 开始执行沙箱代码...');
// 创建沙... | https://github.com/dingzhilin1990/zhilinclaw | d88ffa44c0ff839df8e4b0b85288ce3bb3785caa | github |
NissonCX/CQU-HarmonyOS-APP-Dev-Final | entry/src/main/ets/utils/ExportManager.ets | arkts | getInstance | 获取 ExportManager 单例 | static getInstance(): ExportManager {
if (!ExportManager.instance) {
ExportManager.instance = new ExportManager();
}
return ExportManager.instance;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left ExportMana... | static getInstance(): ExportManager {
if (!ExportManager.instance) {
ExportManager.instance = new ExportManager();
}
return ExportManager.instance;
} | https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final | e9aebb15dc58a2e3365b04a827dbad5b73882e9f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/ItemTransitionAnimator.ets | arkts | calculateGridPositions | 计算网格布局的条目位置
@param itemCount 条目总数
@param columns 列数
@param itemWidth 条目宽度
@param itemHeight 条目高度
@param columnGap 列间距
@param rowGap 行间距
@param paddingLeft 左内边距
@param paddingTop 上内边距 | public calculateGridPositions(
itemCount: number,
columns: number,
itemWidth: number,
itemHeight: number,
columnGap: number,
rowGap: number,
paddingLeft: number = 0,
paddingTop: number = 0
): ItemPosition[] {
const positions: ItemPosition[] = [];
for (let i = 0; i < item... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left calculateGridPositions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left itemCount AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number A... | public calculateGridPositions(
itemCount: number,
columns: number,
itemWidth: number,
itemHeight: number,
columnGap: number,
rowGap: number,
paddingLeft: number = 0,
paddingTop: number = 0
): ItemPosition[] {
const positions: ItemPosition[] = [];
for (let i = 0; i < item... | https://github.com/DaLongZhuaZi/manxia | 0a5f28cd22244e6c3811dd2cd129a7ab31021b2f | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/BarDataSet.ets | arkts | getGradient | This method is deprecated.
Use getFill(...) instead.
@param index | public getGradient(index: number): Fill | null {
return this.getFill(index);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getGradient AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left num... | public getGradient(index: number): Fill | null {
return this.getFill(index);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | d6258960c3596b1ea5b525e2a3c3e541e8baee38 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Services/CacheStatusService.ets | arkts | getNovelCacheStatus | 获取小说缓存状态
@param bookId 小说ID
@param bookTitle 小说标题(可选)
@param totalChapters 总章节数(可选) | async getNovelCacheStatus(
bookId: string,
bookTitle?: string,
totalChapters?: number
): Promise<ContentCacheStats> {
const startedAt: number = Date.now();
const flowId: string = this.ensureCacheStatusFlow(CacheContentType.NOVEL, 0, bookId, bookTitle || '');
try {
logger.info(TAG, `获取小... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getNovelCacheStatus AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left bookId AST#identifier#Right AST#type_annotation#Left AST#:#... | async getNovelCacheStatus(
bookId: string,
bookTitle?: string,
totalChapters?: number
): Promise<ContentCacheStats> {
const startedAt: number = Date.now();
const flowId: string = this.ensureCacheStatusFlow(CacheContentType.NOVEL, 0, bookId, bookTitle || '');
try {
logger.info(TAG, `获取小... | https://github.com/DaLongZhuaZi/manxia | 3c0c8648e889bae95a9e47f99f081b166fec3ed6 | github |
openharmony-tpc/ohos_coap | libcoap/src/main/ets/components/mainpage/CoapClient.ets | arkts | setPayloadBinary | 客户端透传的字节内容
@param payload post,put透传的内容 | setPayloadBinary(payload: Uint8Array) {
this.coapClient.setPayloadBinary(payload, this.classId);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setPayloadBinary AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left payload AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Uint8Array AST#identi... | setPayloadBinary(payload: Uint8Array) {
this.coapClient.setPayloadBinary(payload, this.classId);
} | https://gitee.com/openharmony-tpc/ohos_coap.git | 7a4a014cc0c33f3a8f7c55ea558ea997f35cc577 | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets | arkts | disableDashedHighlightLine | Disables the highlight-line to be drawn in dashed mode. | public disableDashedHighlightLine(): void {
this.mHighlightDashPathEffect = null;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left disableDashedHighlightLine AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right... | public disableDashedHighlightLine(): void {
this.mHighlightDashPathEffect = null;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 451b135d2fc1ca22d5812cff1a87471c1481f09e | gitee |
Joker-x-dev/CoolMallArkTS | entry/src/main/ets/entryability/EntryAbility.ets | arkts | onWindowStageCreate | 窗口创建时调用
加载入口页面、初始化UI基础样式
@param {window.WindowStage} windowStage - 窗口阶段
@returns {Promise<void>} 无返回值的Promise | async onWindowStageCreate(windowStage: window.WindowStage): Promise<void> {
await this.initIBestORM();
windowStage.loadContent('view/EntryPage', (_) => {
IBestUIInitializer.initIBestUI(windowStage, this.context);
});
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left onWindowStageCreate AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left windowStage AST#identifier#Right AST#type_annotation#Left A... | async onWindowStageCreate(windowStage: window.WindowStage): Promise<void> {
await this.initIBestORM();
windowStage.loadContent('view/EntryPage', (_) => {
IBestUIInitializer.initIBestUI(windowStage, this.context);
});
} | https://github.com/Joker-x-dev/CoolMallArkTS | 95f5edb716fc182b6e99461c25dd235a59dcc6ea | github |
offlinecat-dev/OCNetORM | src/main/ets/errors/RelationError.ets | arkts | constructor | 构造函数
@param foreignKeySide 无效的外键位置配置 | constructor(foreignKeySide: string) {
const context = new ErrorContext()
context.operation = '配置外键位置'
context.details = `无效的外键位置: ${foreignKeySide}`
super(`无效的外键位置配置: '${foreignKeySide}',有效值为 'source' 或 'target'`, ERROR_INVALID_FOREIGN_KEY_SIDE, context)
this.name = 'InvalidForeignKeySideError'
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left foreignKeySide AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right... | constructor(foreignKeySide: string) {
const context = new ErrorContext()
context.operation = '配置外键位置'
context.details = `无效的外键位置: ${foreignKeySide}`
super(`无效的外键位置配置: '${foreignKeySide}',有效值为 'source' 或 'target'`, ERROR_INVALID_FOREIGN_KEY_SIDE, context)
this.name = 'InvalidForeignKeySideError'
... | https://github.com/offlinecat-dev/OCNetORM | 4170fa5bf9c069c6273c0f9f9ee5389cfce20e74 | github |
mybricks/comlib-harmony-normal | packages/rt-arkts/comlib/src/main/ets/_ChooseFile.ets | arkts | formatFileType | 格式化后缀 | function formatFileType(arr: string[]): string[] {
if (arr) {
return arr.join(',').split(',')
}
return []
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left formatFileType AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arr AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri... | function formatFileType(arr: string[]): string[] {
if (arr) {
return arr.join(',').split(',')
}
return []
} | https://github.com/mybricks/comlib-harmony-normal | 1b431108b1c603802298147e9cc01966c425ee15 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/AudioFocusManager.ets | arkts | isMuted | Check if audio is muted
Note: AudioVolumeManager.isMute is not available in current SDK | static async isMuted(): Promise<boolean> {
// AudioVolumeManager doesn't expose isMute directly in current SDK
return false;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left isMuted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left :... | static async isMuted(): Promise<boolean> {
// AudioVolumeManager doesn't expose isMute directly in current SDK
return false;
} | https://github.com/tangwengang-del/freerdp-harmonyos | db009a36033ff54dbeb319d22c77212ed6320f6f | github |
luojiang001/Pulse | Pulse/oh_modules/collect_personal_info/src/main/ets/common/WindowModel.ets | arkts | registerWindowBottomPadding | 监听底部避让区域变化 | public registerWindowBottomPadding() {
this.getWindowBottomPadding();
window.getLastWindow(getContext()).then(currentWindow => {
currentWindow.on('avoidAreaChange', this.getWindowBottomPadding);
})
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left registerWindowBottomPadding AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Lef... | public registerWindowBottomPadding() {
this.getWindowBottomPadding();
window.getLastWindow(getContext()).then(currentWindow => {
currentWindow.on('avoidAreaChange', this.getWindowBottomPadding);
})
} | https://github.com/luojiang001/Pulse | ca128f163a46ef6102f0659c3abf65157cf372f0 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | fill | Fills the Int16Array with specified value
@param { number } value - new value
@param { int } [start] - start index to begin fill from
@param { int } [end] - last index to end fill from, excluded
@returns { this } - modified Int16Array
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public fill(value: number, start?: int, end?: int): this {
this.fill(Int16Array.doubleToInt(value), start, end)
return this
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left fill AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERR... | public fill(value: number, start?: int, end?: int): this {
this.fill(Int16Array.doubleToInt(value), start, end)
return this
} | https://gitcode.com/iop123123/arkts-static-skills | f7a5e936080f115c1899346dbed0bffe39adb264 | gitcode |
richshaw2015/nds | ohos/entry/src/test/DependencyRelations.test.ets | arkts | calculateMacAddressDependentDisabledState | 计算MAC地址依赖设置的禁用状态
Requirements: 5.7
@param randomizeMac 是否随机MAC地址
@returns 依赖设置的禁用状态 | function calculateMacAddressDependentDisabledState(randomizeMac: boolean): Record<string, boolean> {
return {
'internal_mac_address': randomizeMac
};
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left calculateMacAddressDependentDisabledState AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left randomizeMac AST#identifier#Right AST#type_a... | function calculateMacAddressDependentDisabledState(randomizeMac: boolean): Record<string, boolean> {
return {
'internal_mac_address': randomizeMac
};
} | https://github.com/richshaw2015/nds | d1f7d4da6d85682712a6475f4ed4b56c99612082 | github |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/services/network/ApiClient.ets | arkts | searchTags | 搜索标签(用于标签选择弹层)
请求格式:/tags/filter/search?q=xxx&limit=8&selected_tags=... | async searchTags(
query: string = '',
categoryId: number | null = null,
selectedTags: string[] | null = null,
limit: number = 8,
filterForInput: boolean = false
): Promise<TagSearchResult> {
const params: Record<string, Object> = {};
params['q'] = query;
// Discourse 端对 limit 有上限保护:l... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left searchTags AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left query AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST... | async searchTags(
query: string = '',
categoryId: number | null = null,
selectedTags: string[] | null = null,
limit: number = 8,
filterForInput: boolean = false
): Promise<TagSearchResult> {
const params: Record<string, Object> = {};
params['q'] = query;
// Discourse 端对 limit 有上限保护:l... | https://github.com/Amaz1ny/HarmonyDO-public | 09eefa71115b6b12859bdcb9e0eac1fd70462889 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncLinkedConcurrentQueue.ets | arkts | constructor | Creates a LinkedConcurrentQueue with the provided capacity.
Throws a RangeError when the provided capacity is not positive.
@param { int } capacity The maximum number of elements accepted by the queue.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public constructor(capacity: int) {
if (capacity <= 0) {
// #33368: Add a typed Error for AsyncLock and other Error
throw new RangeError("LinkedConcurrentQueue:: Invalid capacity");
}
this.actualCapacity = capacity;
this.initializeQ... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left capacity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifi... | public constructor(capacity: int) {
if (capacity <= 0) {
// #33368: Add a typed Error for AsyncLock and other Error
throw new RangeError("LinkedConcurrentQueue:: Invalid capacity");
}
this.actualCapacity = capacity;
this.initializeQ... | https://gitcode.com/iop123123/arkts-static-skills | 6df2024f7f24c938ebc4d33eb4856301928afaa5 | gitcode |
midori52000/ArkPilot | Agent/entry/src/main/ets/skills/SkillsBackendService.ets | arkts | flattenGitHubZipRoot | GitHub ZIP 解压后内容在 {repo}-{branch}/ 子目录下,
将子目录内容移到 tempDir 根以简化路径解析。 | private flattenGitHubZipRoot(tempDir: string): void {
try {
const entries: string[] = fileIo.listFileSync(tempDir) as string[];
const dirs: string[] = entries.filter((entry: string): boolean => {
try {
const stat = fileIo.statSync(`${tempDir}/${entry}`);
return stat.isDirec... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left flattenGitHubZipRoot AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left tempDir AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AS... | private flattenGitHubZipRoot(tempDir: string): void {
try {
const entries: string[] = fileIo.listFileSync(tempDir) as string[];
const dirs: string[] = entries.filter((entry: string): boolean => {
try {
const stat = fileIo.statSync(`${tempDir}/${entry}`);
return stat.isDirec... | https://github.com/midori52000/ArkPilot | 2199d942072df53f299f7f6c116b67355de9f5b7 | github |
mqxu/HarmonyOS_In_Action | examples/01_foundation/F002_state_management/entry/src/main/ets/utils/StateManager.ets | arkts | reset | 重置计数器到指定值
@param currentValue 当前值
@param resetValue 重置值,默认为0
@returns 重置后的值 | static reset(currentValue: number, resetValue: number = 0): number {
return resetValue;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left reset AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left currentValue AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right... | static reset(currentValue: number, resetValue: number = 0): number {
return resetValue;
} | https://github.com/mqxu/HarmonyOS_In_Action | 1553ea63fced0e0fdfb8558e374f93e8ee8b4679 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/AsyncRWLock.ets | arkts | DecReadersClearState | Decrements reader count and clears lock state.
@param { long } state Current lock state
@returns { long } Updated state value with decremented reader count
@throws { RangeError } If the reader count would underflow
@syscap SystemCapability.Utils.Lang | public static DecReadersClearState(state: long): long {
if ((state & State.READERS_MASK) == 0) {
throw new RangeError("AsyncReadWriteLock:: Too few readers");
}
return (state - State.ONE_READER) & ~State.STATE_MASK;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left DecReadersClearState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left state AST#identifier#Right AST#ERROR#Left AST#:#L... | public static DecReadersClearState(state: long): long {
if ((state & State.READERS_MASK) == 0) {
throw new RangeError("AsyncReadWriteLock:: Too few readers");
}
return (state - State.ONE_READER) & ~State.STATE_MASK;
} | https://gitcode.com/iop123123/arkts-static-skills | 12b339a39488270346d6e47325a957fe35c2ca66 | gitcode |
LJ666-ui/harmony-health-care | entry/src/main/ets/services/TerminalManager.ets | arkts | getCurrentTerminalConfig | 获取当前终端配置 | getCurrentTerminalConfig(): TerminalConfig | undefined {
if (!this.currentTerminal) {
return undefined;
}
return this.terminalConfigs.get(this.currentTerminal);
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getCurrentTerminalConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right ... | getCurrentTerminalConfig(): TerminalConfig | undefined {
if (!this.currentTerminal) {
return undefined;
}
return this.terminalConfigs.get(this.currentTerminal);
} | https://github.com/LJ666-ui/harmony-health-care | 939faed366e94e7244987a4dad19215023c209a8 | github |
terryma2024/happyword | harmonyos/entry/src/main/ets/services/ParentApiClient.ets | arkts | setFamilyIdForLessonApis | Sync lesson-import URLs with ``/api/v1/family/{family_id}/…``; pass '' or `_` when unbound. | setFamilyIdForLessonApis(raw: string): void {
const t: string = raw.trim();
this.familyIdSegment = t.length > 0 ? t : '_';
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setFamilyIdForLessonApis AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left raw AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#... | setFamilyIdForLessonApis(raw: string): void {
const t: string = raw.trim();
this.familyIdSegment = t.length > 0 ? t : '_';
} | https://github.com/terryma2024/happyword | 6b5f97eee3a7e504b0c83dcbe8771e7be0ba1b53 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/StoragePaths.ets | arkts | getVmLogPath | 获取指定 VM 的日志路径 | static getVmLogPath(vmName: string): string {
return `${StoragePaths.getVmDir(vmName)}/qemu.log`
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getVmLogPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left vmName AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s... | static getVmLogPath(vmName: string): string {
return `${StoragePaths.getVmDir(vmName)}/qemu.log`
} | https://github.com/AetheriumSimulator/qemu-hmos | 9b7f8f4df053f88110a995733105fc10b73ebaf9 | github |
openharmony/applications_contacts | entry/src/main/ets/presenter/contact/ContactListPresenter.ets | arkts | loginAccount | Log in to Huawei ID. | loginAccount() {
HiLog.i(TAG, 'loginAccount !!');
router.push(
{
url: '',
params: {}
}
);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left loginAccount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left ... | loginAccount() {
HiLog.i(TAG, 'loginAccount !!');
router.push(
{
url: '',
params: {}
}
);
} | https://gitee.com/openharmony/applications_contacts.git | 8e15f62f0e8c115f4b1f3c1e6a3e4802f1127ce1 | gitee |
lidaixian999/Smart_Car | entry/src/main/ets/model/SsapManager.ets | arkts | getServices | 获取服务列表 | public getServices(): Promise<Array<ssap.Service>> {
return new Promise((resolve, reject) => {
if (!this.client) {
const errorMsg = 'Client not initialized';
hilog.error(this.domainId, this.logTag, errorMsg);
reject(new Error(errorMsg));
return;
}
hilog.info(this... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getServices AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression... | public getServices(): Promise<Array<ssap.Service>> {
return new Promise((resolve, reject) => {
if (!this.client) {
const errorMsg = 'Client not initialized';
hilog.error(this.domainId, this.logTag, errorMsg);
reject(new Error(errorMsg));
return;
}
hilog.info(this... | https://github.com/lidaixian999/Smart_Car | a3e11901e8a4049ad556c9228fd75c0254eca6d6 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/NotificationManager.ets | arkts | sendDownloadCompleteNotification | 发送下载完成通知 | public async sendDownloadCompleteNotification(
taskId: string,
fileName: string
): Promise<boolean> {
const config: NotificationConfig = {
id: this.getNotificationId(taskId),
title: '下载完成',
text: fileName,
type: NotificationType.DOWNLOAD_COMPLETE
};
return this.sendNotifi... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left sendDownloadCompleteNotification AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left taskId AST#identifier#R... | public async sendDownloadCompleteNotification(
taskId: string,
fileName: string
): Promise<boolean> {
const config: NotificationConfig = {
id: this.getNotificationId(taskId),
title: '下载完成',
text: fileName,
type: NotificationType.DOWNLOAD_COMPLETE
};
return this.sendNotifi... | https://github.com/DaLongZhuaZi/manxia | 3b1f25a15cc8dfa6381a7e8fcb3da9da1df7b080 | github |
NissonCX/CQU-HarmonyOS-APP-Dev-Final | entry/src/main/ets/utils/ReminderManager.ets | arkts | getNotificationId | 获取通知ID(用于通知管理) | private getNotificationId(id: string): number {
// 将字符串ID转换为数字ID
let hash = 0;
for (let i = 0; i < id.length; i++) {
hash = ((hash << 5) - hash) + id.charCodeAt(i);
hash = hash & hash; // Convert to 32bit integer
}
return Math.abs(hash);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getNotificationId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | private getNotificationId(id: string): number {
// 将字符串ID转换为数字ID
let hash = 0;
for (let i = 0; i < id.length; i++) {
hash = ((hash << 5) - hash) + id.charCodeAt(i);
hash = hash & hash; // Convert to 32bit integer
}
return Math.abs(hash);
} | https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final | 1fba2cc87cff39f01acbc451bc96012f8e0a974f | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.stream.ets | arkts | on | Registering Event Messages.
@param { string } event - Register Event.
@param { Function } callback - event callbacks. | on(event: string, callback: Function): void {
this.listener!.on(event, callback);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left on AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#Right... | on(event: string, callback: Function): void {
this.listener!.on(event, callback);
} | https://gitcode.com/iop123123/arkts-static-skills | a4bf40f5dadebd86df3e1563f2646501e558c4b9 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncLinkedConcurrentQueue.ets | arkts | requireFirstNodeLocked | Returns the first linked node that still carries a queue element.
Throws when the queue invariants are broken while the queue is expected to be non-empty.
@returns { ListNode<T> } The first linked node after the sentinel head.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | private requireFirstNodeLocked(): ListNode<T> {
const firstNode = this.head.next;
if (firstNode === undefined) {
throw new Error("LinkedConcurrentQueue:: missing first node");
}
return firstNode;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left requireFirstNodeLocked AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expre... | private requireFirstNodeLocked(): ListNode<T> {
const firstNode = this.head.next;
if (firstNode === undefined) {
throw new Error("LinkedConcurrentQueue:: missing first node");
}
return firstNode;
} | https://gitcode.com/iop123123/arkts-static-skills | 86ac73d955e620f15a9b6385540bded566de5a61 | gitcode |
the-wwyang/kids-learning-app | src/main/ets/storage/UserSettingsStorageService.ets | arkts | getLastModifiedTime | 获取最后修改时间 | static async getLastModifiedTime(): Promise<string> {
try {
return await dataStorage.getString(
UserSettingsStorageService.STORE_NAME,
UserSettingsStorageService.KEY_LAST_MODIFIED,
''
);
} catch (error) {
return '';
}
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left getLastModifiedTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ... | static async getLastModifiedTime(): Promise<string> {
try {
return await dataStorage.getString(
UserSettingsStorageService.STORE_NAME,
UserSettingsStorageService.KEY_LAST_MODIFIED,
''
);
} catch (error) {
return '';
}
} | https://github.com/the-wwyang/kids-learning-app | 6d9085ab34349a2df321f6ad64c2683d7948ed2e | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/TemplateFactory.ets | arkts | createEntries | 批量创建条目 | createEntries(
templates: ITemplate[],
parentGroup: KdbxGroup,
options?: TemplateApplyOptions
): KdbxEntry[] {
const result: KdbxEntry[] = [];
for (let i = 0; i < templates.length; i++) {
result.push(this.createEntry(templates[i], parentGroup, options));
}
return result;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left createEntries AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left templates AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifi... | createEntries(
templates: ITemplate[],
parentGroup: KdbxGroup,
options?: TemplateApplyOptions
): KdbxEntry[] {
const result: KdbxEntry[] = [];
for (let i = 0; i < templates.length; i++) {
result.push(this.createEntry(templates[i], parentGroup, options));
}
return result;
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateFactory.ets#L141-L151 | 0ea43985f263b12913c772c34227cef74f901eb0 | github |
huaweicloud/huaweicloud-iot-device-sdk-arkts | huaweicloud_iot_device_library/src/main/ets/client/DeviceClient.ets | arkts | publishRawMessage | 发布原始消息,原始消息和设备消息(DeviceMessage)的区别是:
1、可以自定义topic,该topic需要在平台侧配置
2、不限制payload的格式
@param rawMessage 原始消息
@param qos | publishRawMessage(rawMessage: RawMessage, qos: IoTMqttQos = 0): Promise<IoTMqttResponse> {
if (!this.mqttClient) {
return new Promise<IoTMqttResponse>((resolve, reject) => reject("mqtt client is null"));
}
const publishOption: IoTMqttPublishOptions = {
topic: rawMessage.topic,
qos: qos,
... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left publishRawMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rawMessage AST#identifier#Right AST#:#Left : AST#:#Right... | publishRawMessage(rawMessage: RawMessage, qos: IoTMqttQos = 0): Promise<IoTMqttResponse> {
if (!this.mqttClient) {
return new Promise<IoTMqttResponse>((resolve, reject) => reject("mqtt client is null"));
}
const publishOption: IoTMqttPublishOptions = {
topic: rawMessage.topic,
qos: qos,
... | https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts | 40a627a48796a033e9b6299be1694ef276c3706b | github |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/components/swiper/TnSwiper.ets | arkts | resolveIndicatorAlignment | 将 TnSwiperIndicatorPosition 映射到 Stack 的 Alignment
@param position 指示器位置
@returns Alignment 枚举 | function resolveIndicatorAlignment(position: TnSwiperIndicatorPosition): Alignment {
switch (position) {
case "left-top":
return Alignment.TopStart;
case "center-top":
return Alignment.Top;
case "right-top":
return Alignment.TopEnd;
case "left-bottom":
return Alignment.BottomSt... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left resolveIndicatorAlignment AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left position AST#identifier#Right AST#type_annotation#Left AST#:... | function resolveIndicatorAlignment(position: TnSwiperIndicatorPosition): Alignment {
switch (position) {
case "left-top":
return Alignment.TopStart;
case "center-top":
return Alignment.Top;
case "right-top":
return Alignment.TopEnd;
case "left-bottom":
return Alignment.BottomSt... | https://github.com/codelably/tuniao-ui | 38760ce2a20c7818a5f405eceaf6ce81b4a5cf00 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.Deque.ets | arkts | getLast | Returns the last element of the deque without removing it.
@returns { T } The last element of the deque. | public getLast(): T {
this.checkEmptyContainer();
return this.buffer[(this.rear - 1 + this.capacity) % this.capacity] as T;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLast AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifi... | public getLast(): T {
this.checkEmptyContainer();
return this.buffer[(this.rear - 1 + this.capacity) % this.capacity] as T;
} | https://gitcode.com/iop123123/arkts-static-skills | a60b600204c0174c07259c1b656dfc4ad3e1f655 | gitcode |
aimilin6688/KeePassHO | entry/src/main/ets/services/kdbx/KdbxCsvService.ets | arkts | getGroupByPath | 获取分组
@param rootGroup 根分组
@param groupPath 分组路径
@returns 结果 | private static getGroupByPath(rootGroup: KdbxGroup, groupPath: string): KdbxGroup {
if (!groupPath || groupPath === '') {
return rootGroup;
}
let currentGroup: KdbxGroup = rootGroup;
const groups = groupPath.split("/");
for (let groupName of groups) {
if (!groupName) {
continue... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left getGroupByPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rootGroup AST#identifier#Right AST#:#... | private static getGroupByPath(rootGroup: KdbxGroup, groupPath: string): KdbxGroup {
if (!groupPath || groupPath === '') {
return rootGroup;
}
let currentGroup: KdbxGroup = rootGroup;
const groups = groupPath.split("/");
for (let groupName of groups) {
if (!groupName) {
continue... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxCsvService.ets#L136-L162 | 1853316b76535acfdb3afd193017ef7ebcd48222 | github |
offlinecat-dev/OCNetORM | src/main/ets/repository/BatchInsertResult.ets | arkts | createSuccess | 创建成功的批量插入结果
@param insertedCount 成功插入的数量
@param totalCount 总数量
@returns BatchInsertResult 实例 | static createSuccess(insertedCount: number, totalCount: number): BatchInsertResult {
const result = new BatchInsertResult()
result.success = true
result.insertedCount = insertedCount
result.totalCount = totalCount
return result
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createSuccess AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left insertedCount AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#nu... | static createSuccess(insertedCount: number, totalCount: number): BatchInsertResult {
const result = new BatchInsertResult()
result.success = true
result.insertedCount = insertedCount
result.totalCount = totalCount
return result
} | https://github.com/offlinecat-dev/OCNetORM | 2cee3ba0c862adc65629a561ac2a0a30373ad64c | github |
CPF-ApplicationTPC/imageknifepro | entry/src/main/ets/pages/TestDesiredSizeDecode.ets | arkts | formatDecodeMemoryEstLine | 按解码像素 ×4(RGBA)粗算单帧 PixelMap 内存,并与原图像素对比。 | public static formatDecodeMemoryEstLine(imageInfo: ImageInfo, frame: DecodeImageInfo | undefined): string {
if (frame === undefined || frame.contentWidth === undefined || frame.contentHeight === undefined) {
return '估算内存:—'
}
const cw = frame.contentWidth
const ch = frame.contentHeight
const... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left formatDecodeMemoryEstLine AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left imageInfo AST#identifier#Righ... | public static formatDecodeMemoryEstLine(imageInfo: ImageInfo, frame: DecodeImageInfo | undefined): string {
if (frame === undefined || frame.contentWidth === undefined || frame.contentHeight === undefined) {
return '估算内存:—'
}
const cw = frame.contentWidth
const ch = frame.contentHeight
const... | https://gitcode.com/CPF-ApplicationTPC/imageknifepro/blob/5b2c39b2925d2e6c4a267ce62edc340b3150dcb9/entry/src/main/ets/pages/TestDesiredSizeDecode.ets#L517-L537 | 2d9d5419e3d3f01707bd96df49b66a53e815e315 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/repository/BatchInsertOptions.ets | arkts | createDefault | 创建默认选项(使用事务,执行钩子)
@returns 默认的 BatchInsertOptions 实例 | static createDefault(): BatchInsertOptions {
return new BatchInsertOptions()
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createDefault AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left BatchIns... | static createDefault(): BatchInsertOptions {
return new BatchInsertOptions()
} | https://github.com/offlinecat-dev/OCNetORM | b261ff8cf0ec246dcb1dfc7e9526cc0802747b34 | github |
guoxiucai/ohos-scrcpy-app | scrcpy_server/entry/src/main/ets/scrcpyservice/InputInjector.ets | arkts | setStreamSize | Set the stream resolution so touch coordinates can be scaled to real device pixels. | setStreamSize(width: number, height: number): void {
this.streamWidth = width;
this.streamHeight = height;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setStreamSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left width AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , ... | setStreamSize(width: number, height: number): void {
this.streamWidth = width;
this.streamHeight = height;
} | https://github.com/guoxiucai/ohos-scrcpy-app | 5a2b5df3b9adcb0b3a912d7eace8cab99a6cc41b | github |
yangyongzhen/hmmovie | entry/src/main/ets/utils/EfAVPlayer.ets | arkts | _onStateChange | 私有用于处理状态变化事件。 | private async _onStateChange() {
const avPlayer = await this.init();
avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => {
this.state = state as EfAVPlayerState
switch (state) {
case 'idle':
break;
case 'initialized':
avPlayer.p... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left _onStateChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS... | private async _onStateChange() {
const avPlayer = await this.init();
avPlayer.on('stateChange', async (state: string, reason: media.StateChangeReason) => {
this.state = state as EfAVPlayerState
switch (state) {
case 'idle':
break;
case 'initialized':
avPlayer.p... | https://github.com/yangyongzhen/hmmovie | e11adb0cc4747a4c4cbc342a6a824fc606fce433 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/NdsRomCache.ets | arkts | removeCacheChangeListener | 移除缓存变化监听器 | removeCacheChangeListener(listener: CacheChangeListener): void {
const index = this.cacheChangeListeners.indexOf(listener);
if (index >= 0) {
this.cacheChangeListeners.splice(index, 1);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left removeCacheChangeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CacheChangeListener AST#id... | removeCacheChangeListener(listener: CacheChangeListener): void {
const index = this.cacheChangeListeners.indexOf(listener);
if (index >= 0) {
this.cacheChangeListeners.splice(index, 1);
}
} | https://github.com/richshaw2015/nds | 7719c1994b7c1e81492ad41957e91621e5b01e38 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Services/DataService.ets | arkts | clearReadingHistory | 清除阅读历史 | public async clearReadingHistory(): Promise<void> {
try {
await this.dataManager.clearUserReadHistory(this.currentUserId);
logger.info(TAG, '阅读历史已清除');
} catch (error) {
logger.error(TAG, '清除阅读历史失败' + String(error));
throw error as Error;
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left clearReadingHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ... | public async clearReadingHistory(): Promise<void> {
try {
await this.dataManager.clearUserReadHistory(this.currentUserId);
logger.info(TAG, '阅读历史已清除');
} catch (error) {
logger.error(TAG, '清除阅读历史失败' + String(error));
throw error as Error;
}
} | https://github.com/DaLongZhuaZi/manxia | 8bb6cbcb080adb0b90462efb68bfb4c4acb47423 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/UUIDGenerator.ets | arkts | convertLegacyId | 从数字ID转换为字符串ID(用于数据迁移) | public convertLegacyId(id: number | string): string {
if (typeof id === 'string') {
return id;
}
// 将数字ID转换为带前缀的字符串ID
return `legacy_${id}_${Date.now()}`;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left convertLegacyId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#... | public convertLegacyId(id: number | string): string {
if (typeof id === 'string') {
return id;
}
// 将数字ID转换为带前缀的字符串ID
return `legacy_${id}_${Date.now()}`;
} | https://github.com/DaLongZhuaZi/manxia | c55d4484988caa28b0b26cc0df3608d94451c1fd | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/viewmodel/GoodsCategoryViewModel.ets | arkts | toggleLayoutMode | 切换布局模式
@returns {void} 无返回值 | toggleLayoutMode(): void {
this.isGridLayout = !this.isGridLayout;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toggleLayoutMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | toggleLayoutMode(): void {
this.isGridLayout = !this.isGridLayout;
} | https://github.com/Joker-x-dev/CoolMallArkTS | d275f70dfd954cbf9ca92ffa7f69b63fa89a52aa | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/listener/BarLineChartTouchListener.ets | arkts | performSwipe | Performs all necessary operations needed for swiping.
@param isTouchEvent whether it is a touch event
@param event the event object
@param distanceX the distance on the X axis
@param distanceY the distance on the Y axis | private performSwipe(isTouchEvent: boolean, event: TouchEvent | GestureEvent, distanceX: number, distanceY: number) {
let l: OnChartGestureListener | null = this.mChart.getOnChartGestureListener();
if (l != null) {
l.onChartTranslate(isTouchEvent, event, distanceX, distanceY);
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left performSwipe AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left isTouchEvent AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boolean#Left boolean AST... | private performSwipe(isTouchEvent: boolean, event: TouchEvent | GestureEvent, distanceX: number, distanceY: number) {
let l: OnChartGestureListener | null = this.mChart.getOnChartGestureListener();
if (l != null) {
l.onChartTranslate(isTouchEvent, event, distanceX, distanceY);
}
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 7d0b1dc69d17f0f7911266c4f40d243c58969651 | gitee |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/components/SessionView.ets | arkts | scrollBy | Scroll the view | scrollBy(dx: number, dy: number): void {
this.offsetX += dx;
this.offsetY += dy;
this.constrainOffset();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left scrollBy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dx AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , AST#,#Ri... | scrollBy(dx: number, dy: number): void {
this.offsetX += dx;
this.offsetY += dy;
this.constrainOffset();
} | https://github.com/tangwengang-del/freerdp-harmonyos | becda39188901b38187581d0a46c6a885798fea2 | github |
openharmony-sig/online_event | solution_student_challenge/基于OpenHarmony的OpenGit_潘骏翔/OpenGit/entry/src/main/ets/MainAbility/pages/search/search.ets | arkts | build | TextInput的内容,通过监听TextInput的onChange方法来改变 | build() {
Column() {
//顶部工具栏,包含:文本输入和搜索按钮
TopNavigation({ viewModel: $searchViewModel, inputText: $inputText })
//搜索结果
Column() {
List({ space: 16 }) {
ForEach(this.searchViewModel.repos, (item) => {
ListItem() {
RepoItem({ viewModel: $searchVie... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
//顶部工具栏,包含:文本输入和搜索按钮
TopNavigation({ viewModel: $searchViewModel, inputText: $inputText })
//搜索结果
Column() {
List({ space: 16 }) {
ForEach(this.searchViewModel.repos, (item) => {
ListItem() {
RepoItem({ viewModel: $searchVie... | https://gitee.com/openharmony-sig/online_event.git | 4b98aa92b7e70de134f14ccda8a97070f3fd0705 | gitee |
GrassyUnknown/Health-Life-HarmonyOS-Next | oh_modules/.ohpm/cjcalendar@2.0.4/oh_modules/cjcalendar/src/main/ets/components/components/CJCalendar.ets | arkts | __initAttrs | 初始化属性 | __initAttrs() {
// 初始化农历相关属性
if (this.showLunar) {
if (this.showJieQi == undefined) {
this.showJieQi = true
}
if (this.showJieRi == undefined) {
this.showJieRi = true
}
}
// 初始化defSelectedItems
this.__changeSelectItems(this.defSelectedItems)
// 操作模式初始化... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left __initAttrs AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A... | __initAttrs() {
// 初始化农历相关属性
if (this.showLunar) {
if (this.showJieQi == undefined) {
this.showJieQi = true
}
if (this.showJieRi == undefined) {
this.showJieRi = true
}
}
// 初始化defSelectedItems
this.__changeSelectItems(this.defSelectedItems)
// 操作模式初始化... | https://github.com/GrassyUnknown/Health-Life-HarmonyOS-Next | d837dc7f7fa99e5d7ff194c0c822106a42c6d40f | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets | arkts | equals | Checks for equality this instance with provided object, treated as a TupleType
@param {Type} other type to be checked against
@returns {boolean} true if object also has TupleType
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public override equals(other: Type): boolean {
return false
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left equals AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left other AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#... | public override equals(other: Type): boolean {
return false
} | https://gitcode.com/iop123123/arkts-static-skills | 2a0aeced1efb40126c77eff4a332d06404b95a37 | gitcode |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test35_original_index.ets | arkts | inRange | --- Chained range comparisons --- | function inRange(x: number, low: number, high: number): boolean {
return x >= low && x <= high;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left inRange AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left x AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#p... | function inRange(x: number, low: number, high: number): boolean {
return x >= low && x <= high;
} | https://github.com/miaochiahao/ark-ghidra | 8a61b57c1df75c1e2486ea16646dc37e8a5e844d | github |
tdcare/tdwebrtc | src/main/ets/MediaStream.ets | arkts | setContext | 设置上下文(需要在 initialize 前调用) | public setContext(context: common.Context): void {
this.context = context;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#... | public setContext(context: common.Context): void {
this.context = context;
} | https://github.com/tdcare/tdwebrtc | 1983293c8e4beec6dafbb6dcf34b1f6251685c23 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/MainMenuPage.ets | arkts | getMangaShelfCovers | 获取漫画书架封面列表(按当前预览规则) | private getMangaShelfCovers(): string[] {
const covers: string[] = [];
for (const manga of this.mangaList) {
if (covers.length >= this.getShelfPreviewCountForDisplay()) break;
const normalizedPath = this.normalizeDisplayPathForManga(manga);
if (normalizedPath) {
covers.push(normalize... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getMangaShelfCovers AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left... | private getMangaShelfCovers(): string[] {
const covers: string[] = [];
for (const manga of this.mangaList) {
if (covers.length >= this.getShelfPreviewCountForDisplay()) break;
const normalizedPath = this.normalizeDisplayPathForManga(manga);
if (normalizedPath) {
covers.push(normalize... | https://github.com/DaLongZhuaZi/manxia | a8c9cbf6bb72db20183075cd1621efcef935fa20 | github |
SummerKaze/HMOS-AppBundleNameForShared | entry/src/main/ets/pages/Index.ets | arkts | aboutToAppear | 组件即将出现时启动入场动画 | aboutToAppear(): void {
this.startEntranceAnimation();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | aboutToAppear(): void {
this.startEntranceAnimation();
} | https://github.com/SummerKaze/HMOS-AppBundleNameForShared | eb2423c2efe89f631cfe69049908fe6796e29d56 | github |
LiHuaJZOAQ/GuardSysAPP | entry/src/main/ets/pages/WifiManager.ets | arkts | getLocalIP | 获取本机IP地址 | static getLocalIP(): string {
try {
const ipAddress: number = wifiManager.getIpInfo().ipAddress;
const localIP: string =
(ipAddress >>> 24) + "." +
((ipAddress >> 16) & 0xFF) + "." +
((ipAddress >> 8) & 0xFF) + "." +
(ipAddress & 0xFF);
return localIP;
}... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getLocalIP AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#stri... | static getLocalIP(): string {
try {
const ipAddress: number = wifiManager.getIpInfo().ipAddress;
const localIP: string =
(ipAddress >>> 24) + "." +
((ipAddress >> 16) & 0xFF) + "." +
((ipAddress >> 8) & 0xFF) + "." +
(ipAddress & 0xFF);
return localIP;
}... | https://github.com/LiHuaJZOAQ/GuardSysAPP | 26aa9d82d33c768389e89ca2168fca54dab6885b | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | map | Creates a new Int16Array using fn(arr[i]) over all elements of current Int16Array
@param fn a function to apply for each element of current Int16Array
@returns a new Int16Array where for each element from current Int16Array fn was applied | public map(fn: (val: short) => short): Int16Array {
let newF: (val: short, index: int) => short =
(val: short, index: int): short => { return fn(val) }
return this.map(newF)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left map AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right... | public map(fn: (val: short) => short): Int16Array {
let newF: (val: short, index: int) => short =
(val: short, index: int): short => { return fn(val) }
return this.map(newF)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 9dbdd56560db55b925b5305fa3ca5ccd304ff5d1 | gitee |
YDYm233/EasyRandom_HarmonyNextApp | product/default/src/main/ets/sub_pages/metronome/MetronomePage.ets | arkts | stopMetronome | 停止节拍器 | stopMetronome(): void {
this.isRunning = false
this.beatLit = false
if (this.timerId) {
clearTimeout(this.timerId)
this.timerId = 0
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left stopMetronome AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | stopMetronome(): void {
this.isRunning = false
this.beatLit = false
if (this.timerId) {
clearTimeout(this.timerId)
this.timerId = 0
}
} | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | 6a693f87889c560a7a10be21d78734d60e92d847 | github |
openharmony/arkui_ace_engine | advanced_ui_component/arcbutton/source/arcbutton.ets | arkts | findCircleIntersections | 查找两圆的交点
@param C1 第一个圆
@param c2 第二个圆
@returns 两圆相交的点的数组 | findCircleIntersections(firstCircus: ArcButtonCircle, secondCircus: ArcButtonCircle): ArcButtonPoint[] {
const firstCircusR = firstCircus.radius;
const firstCircusCenterX = firstCircus.center.x;
const firstCircusCenterY = firstCircus.center.y;
const secondCircusR = secondCircus.radius;
const seco... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left findCircleIntersections AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left firstCircus AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ArcButtonC... | findCircleIntersections(firstCircus: ArcButtonCircle, secondCircus: ArcButtonCircle): ArcButtonPoint[] {
const firstCircusR = firstCircus.radius;
const firstCircusCenterX = firstCircus.center.x;
const firstCircusCenterY = firstCircus.center.y;
const secondCircusR = secondCircus.radius;
const seco... | https://gitee.com/openharmony/arkui_ace_engine.git | b498fb604525b24b21429f6b2ca0fef1bba05f07 | gitee |
daugf2527/harmonyos-libretro-emulator | deprecated/legacy/archive/entry/src/main/ets/pages/Game2048.ets | arkts | renderFrame | 渲染帧到 Canvas | renderFrame(frame: FrameData) {
try {
// 打印详细调试信息 (仅首帧)
if (this.renderCount === 0) {
hilog.info(0xD002, 'Game2048', '========== 首帧渲染调试信息 ==========');
hilog.info(0xD002, 'Game2048',
`Canvas 尺寸: ${this.canvasContext.width}x${this.canvasContext.height}, 帧尺寸: ${frame.width}x${... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left renderFrame AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left frame AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left FrameData AST#identifier#Rig... | renderFrame(frame: FrameData) {
try {
// 打印详细调试信息 (仅首帧)
if (this.renderCount === 0) {
hilog.info(0xD002, 'Game2048', '========== 首帧渲染调试信息 ==========');
hilog.info(0xD002, 'Game2048',
`Canvas 尺寸: ${this.canvasContext.width}x${this.canvasContext.height}, 帧尺寸: ${frame.width}x${... | https://github.com/daugf2527/harmonyos-libretro-emulator | 456cfff2764a2f978484ec729b98e71620c5e362 | github |
CLMC2025/Vignette | entry/src/main/ets/ui/Animations.ets | arkts | SlideOut | 滑出动画组件 | @Builder
function SlideOut(
key: string,
direction: AnimationDirection = AnimationDirection.LEFT,
duration: number = 300
): void {
Column() {
// 内容直接嵌入
}
.translate({
x: direction === AnimationDirection.LEFT ? 100 :
direction === AnimationDirection.RIGHT ? -100 : 0,
y: direction === Anim... | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left SlideOut AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required... | @Builder
function SlideOut(
key: string,
direction: AnimationDirection = AnimationDirection.LEFT,
duration: number = 300
): void {
Column() {
// 内容直接嵌入
}
.translate({
x: direction === AnimationDirection.LEFT ? 100 :
direction === AnimationDirection.RIGHT ? -100 : 0,
y: direction === Anim... | https://github.com/CLMC2025/Vignette | 3c4b590a880003b9b6dfaab01f35d20d3f3e56e6 | github |
RicardoWesleyli/HarmonyNEXT_Examples | Chapter14/entry/src/main/ets/network/NetworkManager.ets | arkts | sendRequest | 发送HTTP请求并返回响应结果 | private static async sendRequest(httpRequest: http.HttpRequest, url: string, options: http.HttpRequestOptions): Promise<http.HttpResponse> {
return new Promise<http.HttpResponse>((resolve, reject) => {
httpRequest.request(url, options, (error, data) => {
if (error) {
console.log("error cod... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left sendRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identif... | private static async sendRequest(httpRequest: http.HttpRequest, url: string, options: http.HttpRequestOptions): Promise<http.HttpResponse> {
return new Promise<http.HttpResponse>((resolve, reject) => {
httpRequest.request(url, options, (error, data) => {
if (error) {
console.log("error cod... | https://github.com/RicardoWesleyli/HarmonyNEXT_Examples | f2d255dab2a4f8f529d7a5cb47bf960cb1e96edc | github |
LZZLHY/hlib | entry/src/main/ets/utils/SecretStore.ets | arkts | encrypt | ─── 加解密 ───────────────────────────────────────────
加密:plain → "sec1:<base64(nonce|cipher|tag)>";失败回退原文。 | static async encrypt(plain: string): Promise<string> {
if (!SecretStore.usable || plain.length === 0) {
return plain;
}
if (plain.startsWith(CIPHER_PREFIX)) {
return plain;
}
try {
const data: Uint8Array = TEXT_ENCODER.encodeInto(plain);
const nonce: Uint8Array = await Sec... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left encrypt AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left plain AST#identifier#Right AST#:#Left : AST#:#Ri... | static async encrypt(plain: string): Promise<string> {
if (!SecretStore.usable || plain.length === 0) {
return plain;
}
if (plain.startsWith(CIPHER_PREFIX)) {
return plain;
}
try {
const data: Uint8Array = TEXT_ENCODER.encodeInto(plain);
const nonce: Uint8Array = await Sec... | https://github.com/LZZLHY/hlib | 46a40765bc957b1e3c50ea3ac19c867eac1b38dd | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/ChartData.ets | arkts | getColors | Returns all colors used across all DataSet objects this object
represents.
@return | public getColors(): number[] | null {
if (this.mDataSets == null)
return null;
let clrcnt: number = 0;
for (let i = 0; i < this.mDataSets.listSize; i++) {
clrcnt += this.mDataSets.get(i).getColors().size();
}
let colors: number[] = new Array(clrcnt);
let cnt: number = 0
fo... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getColors AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#s... | public getColors(): number[] | null {
if (this.mDataSets == null)
return null;
let clrcnt: number = 0;
for (let i = 0; i < this.mDataSets.listSize; i++) {
clrcnt += this.mDataSets.get(i).getColors().size();
}
let colors: number[] = new Array(clrcnt);
let cnt: number = 0
fo... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 8a391d76631467a73b368a66f8df6e00512dafa7 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets | arkts | resolve | Resolves type by internal descriptor, part of implementation
@param {RuntimeTypeDescriptor} td internal runtime type descriptor
@param {RuntimeLinker} contextLinker in which classes must be searched
@returns {Type | undefined} instance of appropriate type or undefined if resolving is failed
@static
@syscap SystemCapabi... | public static resolve(td: RuntimeTypeDescriptor, contextLinker: RuntimeLinker): Type | undefined {
let kind = (TypeAPI.getTypeKind(td, contextLinker) & TypeKindMask).toByte()
switch (kind) {
case TypeKind.NONE:
return undefined
case TypeKind.VOID:
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left resolve AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left td AST#identifier#Right AST#:#Left : AST#:#Righ... | public static resolve(td: RuntimeTypeDescriptor, contextLinker: RuntimeLinker): Type | undefined {
let kind = (TypeAPI.getTypeKind(td, contextLinker) & TypeKindMask).toByte()
switch (kind) {
case TypeKind.NONE:
return undefined
case TypeKind.VOID:
... | https://gitcode.com/iop123123/arkts-static-skills | e77f625da9f8e226d04e2f872fb1bc7080dcabde | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.LinkedList.ets | arkts | get | Gets the element at the specified index.
@param index The index of the element to get.
@returns The element at the specified index, or undefined if the index is out of range. | public get(index: int): T {
this.checkIndexType(index);
this.checkIndex(index, this.elementNum - 1);
let currentNode: ListNode<T> | undefined = this.getNode(index);
return currentNode!.element;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left get AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#iden... | public get(index: int): T {
this.checkIndexType(index);
this.checkIndex(index, this.elementNum - 1);
let currentNode: ListNode<T> | undefined = this.getNode(index);
return currentNode!.element;
} | https://gitcode.com/iop123123/arkts-static-skills | 99e8fd2bfe88c4d5747561fdaad24d01be1bb5e5 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | findParentEndTag | 查找父元素结束标签位置 | private findParentEndTag(content: string, startIndex: number): number {
// 简化实现:向后查找第一个闭合标签
let depth = 0;
let i = startIndex;
while (i < content.length) {
const tagMatch = content.substring(i).match(/^<\/?([a-zA-Z][a-zA-Z0-9]*)[^>]*>/);
if (tagMatch) {
if (tagMatch[0].startsWith('... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left findParentEndTag AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left content AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st... | private findParentEndTag(content: string, startIndex: number): number {
// 简化实现:向后查找第一个闭合标签
let depth = 0;
let i = startIndex;
while (i < content.length) {
const tagMatch = content.substring(i).match(/^<\/?([a-zA-Z][a-zA-Z0-9]*)[^>]*>/);
if (tagMatch) {
if (tagMatch[0].startsWith('... | https://github.com/DaLongZhuaZi/manxia | bbbe06149922621dbca71c0784043e9b7bc4b242 | github |
HarmonyCandies/image_cropper | image_cropper/src/main/ets/model/Geometry.ets | arkts | distance | Magnitude of the offset | get distance(): number {
return Math.sqrt(this.dx**2 + this.dy**2);
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left distance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AS... | get distance(): number {
return Math.sqrt(this.dx**2 + this.dy**2);
} | https://github.com/HarmonyCandies/image_cropper/blob/dd3664946b413166307b736a5763f998084364e1/image_cropper/src/main/ets/model/Geometry.ets#L83-L85 | cb07526b48d3113062a3cbe2f009f8fdd5280df4 | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/userdata/history/scripts/indexing.ets | arkts | loadIndexFromDiskSync | Read
Reads the index file and returns a meowHistoryIndexFileBundle. You shouldn't call this sync function directly! Use the concurrent wrap!
@param indexFilePath The path of the index file.
@param dataFilePath The path of the data file.
@returns A meowHistoryIndexFileBundle. | @Concurrent
async function loadIndexFromDiskSync(indexFilePath: string, dataFilePath: string) {
let indexFileBundle = new meowHistoryIndexFileBundle(indexFilePath, dataFilePath);
await indexFileBundle.init();
return indexFileBundle;
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Concurrent AST#identifier#Right AST#decorator#Right AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left loadIndexFromDiskSync AST#identifier#Right AST#formal_... | @Concurrent
async function loadIndexFromDiskSync(indexFilePath: string, dataFilePath: string) {
let indexFileBundle = new meowHistoryIndexFileBundle(indexFilePath, dataFilePath);
await indexFileBundle.init();
return indexFileBundle;
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | 0e29ad583091729b53232ada8480220ec376ffaf | github |
kumaleap/ArkLuban | library/src/main/ets/luban/LubanEngine.ets | arkts | needCompress | 判断是否需要压缩
@param fileSize 文件大小(字节)
@param width 宽度
@param height 高度
@returns 是否需要压缩 | private static needCompress(fileSize: number, width: number, height: number, ignoreBy: number = 100): boolean {
// 小于 100KB 的图片不压缩
if (fileSize < ignoreBy * 1024) {
return false;
}
// 像素小于 32万的图片不压缩
if (width * height < 320000) {
return false;
}
return true;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left needCompress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left fileSize AST#identifier#Right AST#ERROR#Left AST#:#Lef... | private static needCompress(fileSize: number, width: number, height: number, ignoreBy: number = 100): boolean {
// 小于 100KB 的图片不压缩
if (fileSize < ignoreBy * 1024) {
return false;
}
// 像素小于 32万的图片不压缩
if (width * height < 320000) {
return false;
}
return true;
} | https://github.com/kumaleap/ArkLuban | 74adbb5123b11daa6c10d3310240e8cf9c1f2aa5 | github |
CLMC2025/Vignette | entry/src/main/ets/context/ContextValidator.ets | arkts | getWarnings | 获取警告问题 | getWarnings(): ValidationIssue[] {
return this.issues.filter((issue: ValidationIssue): boolean =>
issue.severity === IssueSeverity.WARNING
);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getWarnings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left... | getWarnings(): ValidationIssue[] {
return this.issues.filter((issue: ValidationIssue): boolean =>
issue.severity === IssueSeverity.WARNING
);
} | https://github.com/CLMC2025/Vignette | accfb3eccb20a5ec597b331da90ba6392c9fccaa | github |
wuba/omni-ui | omni_component/src/main/ets/components/popup/BaseAttachPopup.ets | arkts | beforeShow | Popup显示之前,可做一些数据处理 | beforeShow(): void {
if (this.attachViewId != null) {
let componentInfo = componentUtils.getRectangleById(this.attachViewId)
this.popupConfig.attachViewComponentInfo = componentInfo
const y = componentInfo.screenOffset.y
const x = componentInfo.screenOffset.x
const h = componentInfo.... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left beforeShow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#L... | beforeShow(): void {
if (this.attachViewId != null) {
let componentInfo = componentUtils.getRectangleById(this.attachViewId)
this.popupConfig.attachViewComponentInfo = componentInfo
const y = componentInfo.screenOffset.y
const x = componentInfo.screenOffset.x
const h = componentInfo.... | https://github.com/wuba/omni-ui | b8f05eb459bfb8d97220f8a3f7253a84122ab21a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Theme/AppColors.ets | arkts | getColorForTheme | 获取指定主题下的颜色值
@param role 颜色角色
@param theme 主题类型
@returns 指定主题对应的颜色字符串 | function getColorForTheme(role: ColorRole, theme: ThemeType): string {
const isDark = theme === ThemeType.DARK || theme === ThemeType.PRIVACY;
const colorValue = ThemePalette[role];
return isDark ? colorValue.dark : colorValue.light;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getColorForTheme AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left role AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | function getColorForTheme(role: ColorRole, theme: ThemeType): string {
const isDark = theme === ThemeType.DARK || theme === ThemeType.PRIVACY;
const colorValue = ThemePalette[role];
return isDark ? colorValue.dark : colorValue.light;
} | https://github.com/DaLongZhuaZi/manxia | 969898c00c01a4eae91d5e3cd4c64e65e69d4b89 | github |
OpenHarmonyToolkitsPlaza/LocationKitDemo | entry/src/main/ets/pages/location/LocationKitPage.ets | arkts | reqPermissionFromUser | 请求用户位置权限 | reqPermissionFromUser() {
const context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
reqPermissionsFromUser(PERMISSIONS, context, () => {
this.isLocationAccess = true
}, () => {
this.isLocationAccess = false
this.getUIContext().showAlertDialog({
title: $... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left reqPermissionFromUser AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_bl... | reqPermissionFromUser() {
const context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
reqPermissionsFromUser(PERMISSIONS, context, () => {
this.isLocationAccess = true
}, () => {
this.isLocationAccess = false
this.getUIContext().showAlertDialog({
title: $... | https://gitcode.com/OpenHarmonyToolkitsPlaza/LocationKitDemo | 7f430e3ff7182c1723113becdb5fca5234fc9d63 | gitcode |
PollenWang6/HiXD | entry/src/main/ets/services/EhallService.ets | arkts | isDateInSemester | 判断当前日期是否在学期有效范围内(学期开始日 ~ 学期开始日 + maxWeeks*7天) | static isDateInSemester(code: string, maxWeeks: number): boolean {
const now: Date = new Date();
const start: Date = SemesterUtil.getSemesterStartDate(code);
if (now < start) return false;
const diffDays: number = Math.floor((now.getTime() - start.getTime()) / (1000 * 60 * 60 * 24));
return diffDa... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isDateInSemester AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left code AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | static isDateInSemester(code: string, maxWeeks: number): boolean {
const now: Date = new Date();
const start: Date = SemesterUtil.getSemesterStartDate(code);
if (now < start) return false;
const diffDays: number = Math.floor((now.getTime() - start.getTime()) / (1000 * 60 * 60 * 24));
return diffDa... | https://github.com/PollenWang6/HiXD | 0ab121d72585da574ab84548f9b2458e19c475ce | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/config/RouteConfigManager.ets | arkts | initialize | 初始化路由配置
从main_pages.json加载路由配置 | public initialize(): void {
if (this.initialized) {
return;
}
// 加载所有已注册的路由
// 注意:这些路由来自 main_pages.json 配置文件
const registeredRoutes: string[] = [
'pages/Index',
'pages/Login',
'pages/Register',
'pages/HomePage',
'pages/MedicalPage',
'pages/HealthPage',
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left initialize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Rig... | public initialize(): void {
if (this.initialized) {
return;
}
// 加载所有已注册的路由
// 注意:这些路由来自 main_pages.json 配置文件
const registeredRoutes: string[] = [
'pages/Index',
'pages/Login',
'pages/Register',
'pages/HomePage',
'pages/MedicalPage',
'pages/HealthPage',
... | https://github.com/LJ666-ui/harmony-health-care | 52cc993d3f84acd47b543ec537afb149f0aaeecf | github |
offlinecat-dev/OCNetORM | src/main/ets/core/EntityMetadata.ets | arkts | getDeletedAtColumn | 获取软删除时间戳列名
@returns 软删除时间戳列名 | getDeletedAtColumn(): string {
if (!this.deletedAtColumn) {
return 'deleted_at'
}
return this.deletedAtColumn
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getDeletedAtColumn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#sta... | getDeletedAtColumn(): string {
if (!this.deletedAtColumn) {
return 'deleted_at'
}
return this.deletedAtColumn
} | https://github.com/offlinecat-dev/OCNetORM | 320768cc4fbe2a51a23d7c379af7bba4728080e3 | github |
ibestservices/ibest-ui | library/src/main/ets/components/tree/index.ets | arkts | remove | 删除当前节点 | remove(){
this.onRemoveNode(this.data)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left remove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST#... | remove(){
this.onRemoveNode(this.data)
} | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/tree/index.ets#L406-L408 | 2bca0fc7ff0019a63eb41914c10dbfa41e8b9f1e | github |
the-wwyang/kids-learning-app | src/main/ets/services/StatisticsService.ets | arkts | generateTrendData | 生成学习趋势数据
@param dailyRecords 每日记录列表
@param days 统计天数
@returns 趋势数据 | static generateTrendData(dailyRecords: DailyRecord[], days: number = 7): TrendData {
// 按日期排序
const sorted = [...dailyRecords].sort((a, b) => a.date.localeCompare(b.date));
// 取最近N天
const recent = sorted.slice(-days);
const dates: string[] = [];
const questionCounts: number[] = [];
const... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left generateTrendData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dailyRecords AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscr... | static generateTrendData(dailyRecords: DailyRecord[], days: number = 7): TrendData {
// 按日期排序
const sorted = [...dailyRecords].sort((a, b) => a.date.localeCompare(b.date));
// 取最近N天
const recent = sorted.slice(-days);
const dates: string[] = [];
const questionCounts: number[] = [];
const... | https://github.com/the-wwyang/kids-learning-app | 4176ef8d7aef70e06ad39fd065c007897e8cfd6f | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | set | Copies all elements of arr to the current Uint32Array starting from insertPos.
{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set}
@param { FixedArray<long> } arr - array to copy data from
@param { int } insertPos - start index where data from arr will be inserted
@th... | public set(arr: FixedArray<long>, insertPos: int): void {
if (insertPos < 0 || insertPos + arr.length > this.lengthInt) {
throw new RangeError("set(insertPos: int, arr: FixedArray<long>): size of arr is greater than Uint32Array.length")
}
for (let i = 0; i < arr.length; i++) {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | public set(arr: FixedArray<long>, insertPos: int): void {
if (insertPos < 0 || insertPos + arr.length > this.lengthInt) {
throw new RangeError("set(insertPos: int, arr: FixedArray<long>): size of arr is greater than Uint32Array.length")
}
for (let i = 0; i < arr.length; i++) {
... | https://gitcode.com/iop123123/arkts-static-skills | dcf6bbce41571464004aeed248ebefba3a5127bd | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets | arkts | join | Concatenates the specified string array by inserting
the specified prefix before each element, the specified
suffix after each element, and the specified separator
between all elements.
@param { String[] } strings string array
@param { String } delim separator between all elements
@param { String } prefix prefix before... | public static join(strings: String[], delim: String, prefix: String, suffix: String): String {
let resStr: String = '';
for (let i: int = 0; i < strings.length; i++) {
resStr += prefix + strings[i] + suffix;
if (i != strings.length - 1) {
resStr += delim;
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left join AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left strings AST... | public static join(strings: String[], delim: String, prefix: String, suffix: String): String {
let resStr: String = '';
for (let i: int = 0; i < strings.length; i++) {
resStr += prefix + strings[i] + suffix;
if (i != strings.length - 1) {
resStr += delim;
... | https://gitcode.com/iop123123/arkts-static-skills | f8cbbae2b6db96d860bb964652ab4a8b2e45c303 | gitcode |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/pages/PerformanceMonitorPage.ets | arkts | refreshData | 刷新所有统计数据 | refreshData(): void {
this.isLoading = true;
// 获取性能统计
const statsMap = PerformanceMonitor.getStats();
const methodList: MethodStats[] = [];
let totalCount = 0;
let totalTime = 0;
let slowCount = 0;
statsMap.forEach((stats, methodName) => {
const slowRate = stats.count > 0
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left refreshData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#... | refreshData(): void {
this.isLoading = true;
// 获取性能统计
const statsMap = PerformanceMonitor.getStats();
const methodList: MethodStats[] = [];
let totalCount = 0;
let totalTime = 0;
let slowCount = 0;
statsMap.forEach((stats, methodName) => {
const slowRate = stats.count > 0
... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 2ceaf7dd4e3842d56ba9ed41cc62f03e9b426af5 | github |
buqiuz/Account | entry/src/main/ets/pages/Index.ets | arkts | accumulateByTitle | 根据 title 累加 amount | accumulateByTitle(billItems: BillItem[],selectedDate:Date): Map<string, number> {
const result: Map<string, number> = new Map();
billItems.forEach(item => {
if (item.accountType===this.searchType&&this.timeUtil.formatYearMonth(selectedDate.toString())===this.timeUtil.formatYearMonth(item.time)) {
... | AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left accumulateByTitle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left billItems AST#identifier#Right AST#:#Left : AST#:#Righ... | accumulateByTitle(billItems: BillItem[],selectedDate:Date): Map<string, number> {
const result: Map<string, number> = new Map();
billItems.forEach(item => {
if (item.accountType===this.searchType&&this.timeUtil.formatYearMonth(selectedDate.toString())===this.timeUtil.formatYearMonth(item.time)) {
... | https://github.com/buqiuz/Account | 1665397a67d89b19c9fddf58dec776f7079839dd | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test12_original_index.ets | arkts | testObjectIteration | --- Object.keys/values iteration pattern --- | function testObjectIteration(): string {
let scores: Record<string, number> = {};
scores['math'] = 95;
scores['english'] = 87;
scores['science'] = 92;
let keys: string[] = Object.keys(scores);
let total: number = 0;
for (let i: number = 0; i < keys.length; i++) {
let key: string = keys[i];
total =... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testObjectIteration AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefi... | function testObjectIteration(): string {
let scores: Record<string, number> = {};
scores['math'] = 95;
scores['english'] = 87;
scores['science'] = 92;
let keys: string[] = Object.keys(scores);
let total: number = 0;
for (let i: number = 0; i < keys.length; i++) {
let key: string = keys[i];
total =... | https://github.com/miaochiahao/ark-ghidra | c31d355dcd28c0eb5daab3c435f11a60fd480478 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/components/ImageLoadStateManager.ets | arkts | getAllStates | 获取所有页面状态(用于调试) | getAllStates(): Map<string, PageState> {
return new Map(this.pageStates);
} | AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getAllStates AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Le... | getAllStates(): Map<string, PageState> {
return new Map(this.pageStates);
} | https://github.com/DaLongZhuaZi/manxia | 7c239d881c8292a393d9c89a2935e2a96fb19b08 | github |
openharmony-tpc/openharmony_tpc_samples | SmartRefreshLayout/library/src/main/ets/components/topRefresh/BezierRadarRefresh.ets | arkts | drawDot | 绘制下拉时的 多个点
@param canvas 画布
@param width 宽度
@param height 高度 | drawDot(canvas: CanvasRenderingContext2D, width: number, height: number) {
if (this.mDotAlpha > 0) {
canvas.fillStyle = this.mAccentColor;
let num: number = 7;
let x: number = px2vp(height);
let wide: number = (1 * width / num) * this.mDotFraction - ((this.mDotFraction > 1) ? (... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left drawDot AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left canvas AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CanvasRenderingContext2D AST#id... | drawDot(canvas: CanvasRenderingContext2D, width: number, height: number) {
if (this.mDotAlpha > 0) {
canvas.fillStyle = this.mAccentColor;
let num: number = 7;
let x: number = px2vp(height);
let wide: number = (1 * width / num) * this.mDotFraction - ((this.mDotFraction > 1) ? (... | https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git | 32c3534b611e691d2a52fdd5737c815d020a673e | gitee |
chendi126/harmonyOS-TCP | entry/src/main/ets/common/GlassStyles.ets | arkts | getGlassCardBackgroundColor | 获取玻璃卡片背景色 | static getGlassCardBackgroundColor(): string {
return GlassColors.GLASS_CARD;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getGlassCardBackgroundColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Lef... | static getGlassCardBackgroundColor(): string {
return GlassColors.GLASS_CARD;
} | https://github.com/chendi126/harmonyOS-TCP | 8743dcec0d50766669c2586696b20ad992477941 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Box.ets | arkts | get | Gets the long value wrapped in this LongBox.
@returns { long } The long value wrapped in this LongBox
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public get(): long {
return this.value;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left get AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right... | public get(): long {
return this.value;
} | https://gitcode.com/iop123123/arkts-static-skills | 58a6238d4f0d163b5d9a249e667402bf76de4b5c | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceSearchService.ets | arkts | saveToCache | 保存搜索结果到缓存 | private saveToCache(keyword: string, author: string | undefined, results: NovelSearchResult[], sourceResults: SourceSearchResult[]): void {
const cacheKey = this.getCacheKey(keyword, author);
const cache: SearchResultCache = {
keyword: keyword,
author: author,
timestamp: Date.now(),
re... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left saveToCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#... | private saveToCache(keyword: string, author: string | undefined, results: NovelSearchResult[], sourceResults: SourceSearchResult[]): void {
const cacheKey = this.getCacheKey(keyword, author);
const cache: SearchResultCache = {
keyword: keyword,
author: author,
timestamp: Date.now(),
re... | https://github.com/DaLongZhuaZi/manxia | cc70aa304d2eb75f7f6fe798efa3fa7faf02de43 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/DeviceAdaptationManager.ets | arkts | hasDeviceInfoChanged | 检查设备信息是否有变化 | private hasDeviceInfoChanged(newInfo: DeviceInfo): boolean {
if (!this.currentDeviceInfo) {
return true;
}
return this.currentDeviceInfo.deviceType !== newInfo.deviceType ||
this.currentDeviceInfo.orientation !== newInfo.orientation ||
this.currentDeviceInfo.breakpoint !== new... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left hasDeviceInfoChanged AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident... | private hasDeviceInfoChanged(newInfo: DeviceInfo): boolean {
if (!this.currentDeviceInfo) {
return true;
}
return this.currentDeviceInfo.deviceType !== newInfo.deviceType ||
this.currentDeviceInfo.orientation !== newInfo.orientation ||
this.currentDeviceInfo.breakpoint !== new... | https://github.com/DaLongZhuaZi/manxia | 9f641580bd01919eda27f6cca451788b2ffd6b71 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/components/RDPDisplay.ets | arkts | sendKeyboardEvent | 发送键盘事件 | async sendKeyboardEvent(scanCode: number, flags: number): Promise<void> {
if (this.state !== RDPConnectionState.CONNECTED) return
const keyEvent = RDPProtocol.createKeyboardInputEvent(scanCode, flags)
console.log(`发送RDP键盘事件: scanCode: ${scanCode}, flags: ${flags}`)
} | AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left sendKeyboardEvent AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left ... | async sendKeyboardEvent(scanCode: number, flags: number): Promise<void> {
if (this.state !== RDPConnectionState.CONNECTED) return
const keyEvent = RDPProtocol.createKeyboardInputEvent(scanCode, flags)
console.log(`发送RDP键盘事件: scanCode: ${scanCode}, flags: ${flags}`)
} | https://github.com/AetheriumSimulator/qemu-hmos | 8126d4399e222afe1a422a49478d8343f30e2cc6 | github |
HarmonyOS_Samples/MusicHome | features/player/src/main/ets/util/PlayerDataUtil.ets | arkts | playPrevious | Delegates to MediaService.playPrevious. | public static playPrevious(): void {
MediaService.getInstance().playPrevious();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left playPrevious AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#... | public static playPrevious(): void {
MediaService.getInstance().playPrevious();
} | https://gitcode.com/HarmonyOS_Samples/MusicHome | 75e87c34323848204d8b3e1579b8281fe1f98026 | gitcode |
openharmony/codelabs | ETSUI/MediaReview/entry/src/main/ets/utils/RdbUtil.ets | arkts | queryReviews | 评价查询与评分统计 | static async queryReviews(context: Context, bookId: string): Promise<DbReview[] | null> {
let rs: relationalStore.ResultSet | null = null
try {
const store = await RdbUtil.getStore(context)
if (!store) {
return RdbUtil.readMemory(bookId)
}
rs = await store.querySql(
`S... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left queryReviews AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : A... | static async queryReviews(context: Context, bookId: string): Promise<DbReview[] | null> {
let rs: relationalStore.ResultSet | null = null
try {
const store = await RdbUtil.getStore(context)
if (!store) {
return RdbUtil.readMemory(bookId)
}
rs = await store.querySql(
`S... | https://gitcode.com/openharmony/codelabs | 4eacef2460da32ff2213dfcf3af9180321ed34d4 | gitcode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.