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 |
|---|---|---|---|---|---|---|---|---|---|---|
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelDataManager.ets | arkts | getReaderSettings | ==================== 阅读设置 ====================
获取阅读设置 | async getReaderSettings(userId: string = 'default'): Promise<NovelReaderSettings> {
const store = this.getStore();
const rs = await store.querySql(
'SELECT * FROM novel_reader_settings WHERE userId = ?', [userId]
);
if (rs.goToFirstRow()) {
const settings: NovelReaderSettings = {
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getReaderSettings AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left userId AST#identifier#Right AST#type_annotation#Left AST#:#Le... | async getReaderSettings(userId: string = 'default'): Promise<NovelReaderSettings> {
const store = this.getStore();
const rs = await store.querySql(
'SELECT * FROM novel_reader_settings WHERE userId = ?', [userId]
);
if (rs.goToFirstRow()) {
const settings: NovelReaderSettings = {
... | https://github.com/DaLongZhuaZi/manxia | 357598993a51250219be8be87a7d51c67cf13a23 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/FontManager.ets | arkts | sanitizeFamilyName | 清理字体族名称,移除不支持的字符
某些字体的PostScript名称可能包含特殊字符,需要清理以确保系统能正确注册 | private sanitizeFamilyName(name: string): string {
if (!name) return '';
// 移除或替换不支持的字符
// 保留字母、数字、中文、日文、韩文、连字符和下划线
let sanitized = name
.replace(/[\x00-\x1F\x7F]/g, '') // 移除控制字符
.replace(/[<>:"\|?*]/g, '') // 移除文件名不支持的字符
.trim();
// 如果清理后为空,返回原始名称
return sani... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left sanitizeFamilyName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | private sanitizeFamilyName(name: string): string {
if (!name) return '';
// 移除或替换不支持的字符
// 保留字母、数字、中文、日文、韩文、连字符和下划线
let sanitized = name
.replace(/[\x00-\x1F\x7F]/g, '') // 移除控制字符
.replace(/[<>:"\|?*]/g, '') // 移除文件名不支持的字符
.trim();
// 如果清理后为空,返回原始名称
return sani... | https://github.com/DaLongZhuaZi/manxia | 6f5d55a9b910d39df64350851d85d1c255fcff15 | github |
bhengubv/aether-protocol | arkts/src/main/ets/incentive/TipPacketPayload.ets | arkts | writeLengthPrefixed | ── helpers ────────────────────────────────────────────────────────────────────
Writes a 4-byte LE int32 length prefix then `value`; returns bytes written. | function writeLengthPrefixed(
buffer: Uint8Array,
view: DataView,
offset: number,
value: Uint8Array
): number {
view.setInt32(offset, value.length, true);
buffer.set(value, offset + 4);
return 4 + value.length;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left writeLengthPrefixed AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left buffer AST#identifier#Right AST#type_annotation#Left AST#:#Left : ... | function writeLengthPrefixed(
buffer: Uint8Array,
view: DataView,
offset: number,
value: Uint8Array
): number {
view.setInt32(offset, value.length, true);
buffer.set(value, offset + 4);
return 4 + value.length;
} | https://github.com/bhengubv/aether-protocol | e2c7c9c838d1489c8b30bf49dc557b02c6129689 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/customkey/CustomKeyManager.ets | arkts | handleAnalogStickMovement | 处理模拟摇杆的连续移动输入
由 VirtualJoystick 组件直接调用(不经过 handleAction)
@param stick 'left' | 'right'
@param x 归一化水平值 -1.0 ~ 1.0
@param y 归一化垂直值 -1.0 ~ 1.0(屏幕坐标,向下为正) | handleAnalogStickMovement(stick: string, x: number, y: number): void {
// 归一化值 → 16-bit 轴值 (0x7FFE = 32766,与 Android 保持一致)
// Y 轴取反:屏幕坐标 Y 向下为正,游戏协议 Y 向上为正(与 AnalogStick.ets 一致)
const axisX = Math.round(x * 0x7FFE);
const negY: number = 0 - y;
const axisY = Math.round(negY * 0x7FFE);
if (stick... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left handleAnalogStickMovement AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left stick AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right A... | handleAnalogStickMovement(stick: string, x: number, y: number): void {
// 归一化值 → 16-bit 轴值 (0x7FFE = 32766,与 Android 保持一致)
// Y 轴取反:屏幕坐标 Y 向下为正,游戏协议 Y 向上为正(与 AnalogStick.ets 一致)
const axisX = Math.round(x * 0x7FFE);
const negY: number = 0 - y;
const axisY = Math.round(negY * 0x7FFE);
if (stick... | https://github.com/AlkaidLab/moonlight-harmony | 079f12b9b7c5347299088180df475db143f7022e | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/WebUploadServer.ets | arkts | notifyUploadComplete | 通知上传完成 | private notifyUploadComplete(filename: string, size: number): void {
for (const listener of this.uploadCompleteListeners) {
listener(filename, size);
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left notifyUploadComplete AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filename AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string A... | private notifyUploadComplete(filename: string, size: number): void {
for (const listener of this.uploadCompleteListeners) {
listener(filename, size);
}
} | https://github.com/richshaw2015/nds | 2f93b934ee88d92be9a7633358e0b9dabd4c200d | github |
codelably/HCompass | core/module/src/main/ets/ModuleRegistry.ets | arkts | size | 获取模块数量
@returns 模块数量 | get size(): number {
return this.modules.size;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left size 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#ER... | get size(): number {
return this.modules.size;
} | https://github.com/codelably/HCompass | 76f202a041ff6a1f034d233467507e8bb04d9fc8 | github |
openharmony-tpc/ImageKnife | library/src/main/ets/cache/FileCache.ets | arkts | initFileCache | 遍历缓存文件目录,初始化缓存 | public async initFileCache(path: string = FileCache.CACHE_FOLDER) {
if (this.isInited) {
return
}
let startTime = Date.now()
if (this.context && path.startsWith(this.context.cacheDir) === true) {
this.path = path
} else {
FileCache.CACHE_FOLDER = path
this.path = this.conte... | 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 initFileCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST... | public async initFileCache(path: string = FileCache.CACHE_FOLDER) {
if (this.isInited) {
return
}
let startTime = Date.now()
if (this.context && path.startsWith(this.context.cacheDir) === true) {
this.path = path
} else {
FileCache.CACHE_FOLDER = path
this.path = this.conte... | https://gitee.com/openharmony-tpc/ImageKnife.git | 91f1d6e4c67588a13be439bf3b94bb250dcd2308 | gitee |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/components/TerminalEmulator.ets | arkts | make256Colors | 256 色调色板 | function make256Colors(): string[] {
const c: string[] = [];
c.push('#1C1C1C','#CD0000','#00CD00','#CDCD00','#0000EE','#CD00CD','#00CDCD','#E5E5E5');
c.push('#555753','#FF0000','#00FF00','#FFFF00','#5C5CFF','#FF00FF','#00FFFF','#FFFFFF');
for (let r = 0; r < 6; r++) {
for (let g = 0; g < 6; g++) {
for... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left make256Colors 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#array_type#Le... | function make256Colors(): string[] {
const c: string[] = [];
c.push('#1C1C1C','#CD0000','#00CD00','#CDCD00','#0000EE','#CD00CD','#00CDCD','#E5E5E5');
c.push('#555753','#FF0000','#00FF00','#FFFF00','#5C5CFF','#FF00FF','#00FFFF','#FFFFFF');
for (let r = 0; r < 6; r++) {
for (let g = 0; g < 6; g++) {
for... | https://github.com/Mydstiny/RemoteDeskHarmonyOS | c77685bf7719b673d797159684c51dceda903710 | github |
OHPG/FinSdk | jellyfin/src/main/ets/api/VideosApi.ets | arkts | deleteAlternateSources | deleteAlternateSources
@summary Removes alternate video sources.
@param {VideosApiDeleteAlternateSourcesRequest} requestParameters Request parameters.
@throws {RequiredError}
@memberof VideosApi | public async deleteAlternateSources(requestParameters: VideosApiDeleteAlternateSourcesRequest): Promise<void> {
this.assertParam(requestParameters.itemId)
return this.apiClient.delete({path: `/Videos/${requestParameters.itemId}/AlternateSources`, parameters: requestParameters, excludeParams: ['itemId']})
} | 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 deleteAlternateSources AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#... | public async deleteAlternateSources(requestParameters: VideosApiDeleteAlternateSourcesRequest): Promise<void> {
this.assertParam(requestParameters.itemId)
return this.apiClient.delete({path: `/Videos/${requestParameters.itemId}/AlternateSources`, parameters: requestParameters, excludeParams: ['itemId']})
} | https://github.com/OHPG/FinSdk | 6ebeda17e479c16bbadc5fe67365c831ff307f45 | github |
xiebyapps/ClipLink | entry/src/main/ets/services/HistoryStorageService.ets | arkts | deleteRecord | Delete record | async deleteRecord(profileHash: string): Promise<void> {
try {
const store = await this.ensureStore();
const predicates = new relationalStore.RdbPredicates(this.TABLE_NAME);
predicates.equalTo('profileHash', profileHash);
await store.delete(predicates);
} catch (error) {
console.... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteRecord AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left profileHash AST#identifier#Right AST#type_annotation#Left AST#:#Le... | async deleteRecord(profileHash: string): Promise<void> {
try {
const store = await this.ensureStore();
const predicates = new relationalStore.RdbPredicates(this.TABLE_NAME);
predicates.equalTo('profileHash', profileHash);
await store.delete(predicates);
} catch (error) {
console.... | https://github.com/xiebyapps/ClipLink | 2436f8949bdf1085ca7ecd879b759d98f0e3a4d1 | github |
arkui-x/samples | CodeLab/Cases/feature/foldablescreencases/src/main/ets/components/MusicPlayerInfoComp.ets | arkts | updateWithFoldStatus | 根据折叠态和屏幕方向,修改样式,包括折叠屏设备和非折叠屏设备
@param curFoldStatus
@returns {void} | updateWithFoldStatus() {
// 修改图片尺寸、整个信息组件高度百分比、歌词百分比、歌词和其他信息的布局方向
if (this.curFoldStatus === display.FoldStatus.FOLD_STATUS_EXPANDED) {
// 折叠屏展开态
// 使用展开态的属性样式
logger.info("The device is currently in the expanded state");
this.curImgSize = CommonConstants.MUSIC_COVER_SIZE_EXPANDED;
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateWithFoldStatus 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_blo... | updateWithFoldStatus() {
// 修改图片尺寸、整个信息组件高度百分比、歌词百分比、歌词和其他信息的布局方向
if (this.curFoldStatus === display.FoldStatus.FOLD_STATUS_EXPANDED) {
// 折叠屏展开态
// 使用展开态的属性样式
logger.info("The device is currently in the expanded state");
this.curImgSize = CommonConstants.MUSIC_COVER_SIZE_EXPANDED;
... | https://gitcode.com/arkui-x/samples | 548a04a1f8b270f21b11dfe8949a836e8afe1aa7 | gitcode |
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/AuthRepository.ets | arkts | getSmsCode | 获取短信验证码
@param {Record<string, string>} params - 验证码请求参数
@returns {Promise<NetworkResponse<string>>} 短信发送结果 | async getSmsCode(params: Record<string, string>): Promise<NetworkResponse<string>> {
return this.networkDataSource.getSmsCode(params);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getSmsCode AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : AS... | async getSmsCode(params: Record<string, string>): Promise<NetworkResponse<string>> {
return this.networkDataSource.getSmsCode(params);
} | https://github.com/Joker-x-dev/CoolMallArkTS | 8d0489814bcd8cba5225c7ce7b3f5ce5f4c8b265 | github |
darcycui/DarcyHarmonyNext | entry/src/main/ets/pages/StartPage.ets | arkts | onPageShow | 生命周期方法 | onPageShow(): void {
Log.log('-->onPageShow')
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onPageShow 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... | onPageShow(): void {
Log.log('-->onPageShow')
} | https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/entry/src/main/ets/pages/StartPage.ets#L236-L238 | 27a448bde9fbf349a0dcf793a21dae97b27e1512 | github |
DaLongZhuaZi/NGF | ngf_framework/src/main/ets/hardware/facades/LocationManagerFacade.ets | arkts | isLocationEnabled | 检查是否开启了位置服务 | isLocationEnabled(): boolean {
try {
return geoLocationManager.isLocationEnabled();
} catch (e) {
logger.error(TAG, '检查位置服务状态失败: ' + e);
return false;
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isLocationEnabled 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 boolean AST#boolean#Right AST#ERROR#Right AST#s... | isLocationEnabled(): boolean {
try {
return geoLocationManager.isLocationEnabled();
} catch (e) {
logger.error(TAG, '检查位置服务状态失败: ' + e);
return false;
}
} | https://github.com/DaLongZhuaZi/NGF | 74c7b62a246fc4cd108e5d0c14010e7d05501989 | github |
Joker-x-dev/CoolMallArkTS | core/util/src/main/ets/permission/PermissionUtils.ets | arkts | wrapError | 统一封装业务异常,附加上下文提示
@param {unknown} error 捕获的异常
@param {string} message 补充说明
@returns {Error} 包装后的异常 | private wrapError(error: Unknown, message: string): Error {
if (error instanceof Error) {
error.message = `${message}:${error.message}`;
return error;
}
return new Error(message);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left wrapError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left error AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Un... | private wrapError(error: Unknown, message: string): Error {
if (error instanceof Error) {
error.message = `${message}:${error.message}`;
return error;
}
return new Error(message);
} | https://github.com/Joker-x-dev/CoolMallArkTS | a2cdef96fe9f5f4e2ac336d6a280cab95047206d | github |
arkui-x/samples | CodeLab/Cases/feature/eraser/src/main/ets/pages/EraserMainPage.ets | arkts | updateDrawResult | 更新绘制结果 | updateDrawResult() {
// TODO:知识点:通过组件截图componentSnapshot获取NodeContainer上当前绘制结果的pixelMap,需要设置waitUntilRenderFinished为true尽可能获取最新的渲染结果
componentSnapshot.get(Constants.NODE_CONTAINER_ID, { waitUntilRenderFinished: true })
.then(async (pixelMap: image.PixelMap) => {
if (this.currentImageNode !== nul... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateDrawResult 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#L... | updateDrawResult() {
// TODO:知识点:通过组件截图componentSnapshot获取NodeContainer上当前绘制结果的pixelMap,需要设置waitUntilRenderFinished为true尽可能获取最新的渲染结果
componentSnapshot.get(Constants.NODE_CONTAINER_ID, { waitUntilRenderFinished: true })
.then(async (pixelMap: image.PixelMap) => {
if (this.currentImageNode !== nul... | https://gitcode.com/arkui-x/samples | 323d8df5400df9c58bc0e84cd279ee99845f6290 | gitcode |
luojiang001/Pulse | Pulse/entry/src/main/ets/pages/component/ShouYe/DepartmentGridComponent.ets | arkts | aboutToAppear | 接收父组件的回调函数 | aboutToAppear() {
this.getDepartmentList();
} | AST#program#Left AST#expression_statement#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#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
this.getDepartmentList();
} | https://github.com/luojiang001/Pulse | dbe25ca50e30e0129338d1690c6d21e3d3cdb308 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceConfigParser.ets | arkts | getConfigSummary | 获取配置摘要信息 | getConfigSummary(config: MangaSourceConfig): ConfigSummaryResult {
const userAgentSummary = config.settings.userAgent ?
config.settings.userAgent.substring(0, 50) + '...' :
'Default User Agent';
return {
name: config.metadata.name,
version: config.metadata.version,
baseUrl: co... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getConfigSummary AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left MangaSourceConfig AST#identifier#Righ... | getConfigSummary(config: MangaSourceConfig): ConfigSummaryResult {
const userAgentSummary = config.settings.userAgent ?
config.settings.userAgent.substring(0, 50) + '...' :
'Default User Agent';
return {
name: config.metadata.name,
version: config.metadata.version,
baseUrl: co... | https://github.com/DaLongZhuaZi/manxia | 40d53b84d73b25f57dd2a98273b6ec00225589fd | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/core/SmartWardInitializer.ets | arkts | initializeTimeChecker | 初始化时间检测 | private initializeTimeChecker(): void {
console.log('SmartWardInitializer: Initializing time checker...');
// 注意:这里需要从smartward/core/checkers导入时间检测器
// const timeChecker = TimeChecker.getInstance();
// timeChecker.startTimeCheck();
console.log('SmartWardInitializer: Time checker initialization p... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initializeTimeChecker 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 A... | private initializeTimeChecker(): void {
console.log('SmartWardInitializer: Initializing time checker...');
// 注意:这里需要从smartward/core/checkers导入时间检测器
// const timeChecker = TimeChecker.getInstance();
// timeChecker.startTimeCheck();
console.log('SmartWardInitializer: Time checker initialization p... | https://github.com/LJ666-ui/harmony-health-care | 40d0421fd7e25d4e30bfdd882e516295a66879d8 | github |
Countly/countly-sdk-hos | library/src/main/ets/Countly.ets | arkts | haltAll | Halt every active instance (shared + every named instance) AND wipe
each one's persisted storage. Equivalent to calling `instance.halt()`
on each. Use for "user data deletion" flows; after this completes,
a fresh `initShared(cfg)` starts from a clean slate (new device ID,
empty queue, no cached config).
Per-instance ha... | public static async haltAll(): Promise<void> {
if (Countly.shared) {
await Countly.shared.halt();
Countly.shared = null;
}
const instances: CountlyInstance[] = [];
Countly.namedInstances.forEach((instance: CountlyInstance) => instances.push(instance));
for (let i = 0; i < instances.len... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left haltAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right ... | public static async haltAll(): Promise<void> {
if (Countly.shared) {
await Countly.shared.halt();
Countly.shared = null;
}
const instances: CountlyInstance[] = [];
Countly.namedInstances.forEach((instance: CountlyInstance) => instances.push(instance));
for (let i = 0; i < instances.len... | https://github.com/Countly/countly-sdk-hos | 816ef72bdf7146cd8aeb651d24496c3029c8d91d | github |
Harrisonls2004/WaterFlow | entry/src/main/ets/common/utils/FootprintManager.ets | arkts | clearFootprints | Clear all footprints for a user | static async clearFootprints(username: string): Promise<boolean> {
try {
console.log('FootprintManager: Clearing all footprints for user:', username);
if (!FootprintManager.preferencesInstance) {
console.error('FootprintManager: Preferences not initialized');
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 clearFootprints AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left... | static async clearFootprints(username: string): Promise<boolean> {
try {
console.log('FootprintManager: Clearing all footprints for user:', username);
if (!FootprintManager.preferencesInstance) {
console.error('FootprintManager: Preferences not initialized');
return false;
}
... | https://github.com/Harrisonls2004/WaterFlow | 1a3951ced4ff8300ef7c424dbfbb105ec536ad00 | github |
richshaw2015/nds | ohos/entry/src/test/NativeSync.test.ets | arkts | initValidationRules | 初始化验证规则 | private initValidationRules(): void {
// 布尔类型设置
this.validationRules.set('enable_rewind', { type: 'boolean' });
this.validationRules.set('sound_enabled', { type: 'boolean' });
this.validationRules.set('enable_jit', { type: 'boolean' });
this.validationRules.set('use_custom_bios', { type: 'boolean'... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initValidationRules 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... | private initValidationRules(): void {
// 布尔类型设置
this.validationRules.set('enable_rewind', { type: 'boolean' });
this.validationRules.set('sound_enabled', { type: 'boolean' });
this.validationRules.set('enable_jit', { type: 'boolean' });
this.validationRules.set('use_custom_bios', { type: 'boolean'... | https://github.com/richshaw2015/nds | 55cb18abe11b42ecbe4b9fea799f1ef4d01e4f8a | github |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/dao/StepDao.ets | arkts | rowToStep | 将数据库行转换为StepRecord对象 | private rowToStep(resultSet: relationalStore.ResultSet): StepRecord {
return {
id: resultSet.getString(resultSet.getColumnIndex('id')),
date: resultSet.getString(resultSet.getColumnIndex('date')),
steps: resultSet.getLong(resultSet.getColumnIndex('steps')),
calories: resultSet.getDouble(re... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left rowToStep AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_express... | private rowToStep(resultSet: relationalStore.ResultSet): StepRecord {
return {
id: resultSet.getString(resultSet.getColumnIndex('id')),
date: resultSet.getString(resultSet.getColumnIndex('date')),
steps: resultSet.getLong(resultSet.getColumnIndex('steps')),
calories: resultSet.getDouble(re... | https://gitcode.com/openharmony/codelabs | a20bd09d2cefbb3b9c0a2758b069245e1ec37ce1 | gitcode |
AlkaidLab/moonlight-harmony | entry/src/main/ets/components/ShortcutManager.ets | arkts | getDefaultShortcuts | 获取默认快捷键配置 | private getDefaultShortcuts(): Shortcut[] {
// 内置快捷键使用莫兰迪色系
return [
{
id: 'builtin_win',
name: 'Win',
keys: [VirtualKey.VK_LWIN],
icon: '⊞',
color: '#5BA3D0', // 蓝
isBuiltin: true
},
{
id: 'builtin_toggle_cursor',
name: '切换远端光... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getDefaultShortcuts 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 getDefaultShortcuts(): Shortcut[] {
// 内置快捷键使用莫兰迪色系
return [
{
id: 'builtin_win',
name: 'Win',
keys: [VirtualKey.VK_LWIN],
icon: '⊞',
color: '#5BA3D0', // 蓝
isBuiltin: true
},
{
id: 'builtin_toggle_cursor',
name: '切换远端光... | https://github.com/AlkaidLab/moonlight-harmony | 579514129ce0cd63cc547f91898da5052789ab7b | github |
openharmony/arkui_ace_engine | advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.TreeView.ets | arkts | getInstance | CollapseImageNodeFactory singleton function
@returns CollapseImageNodeFactory | public static getInstance(): CollapseImageNodeFactory {
if (!CollapseImageNodeFactory.instance) {
CollapseImageNodeFactory.instance = new CollapseImageNodeFactory();
}
return CollapseImageNodeFactory.instance as CollapseImageNodeFactory;
} | 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 getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L... | public static getInstance(): CollapseImageNodeFactory {
if (!CollapseImageNodeFactory.instance) {
CollapseImageNodeFactory.instance = new CollapseImageNodeFactory();
}
return CollapseImageNodeFactory.instance as CollapseImageNodeFactory;
} | https://gitcode.com/openharmony/arkui_ace_engine | fd51175377da3d5c255a666701fb5763234ed315 | gitcode |
killetom/ktretrofit | ktretrofit/src/main/ets/retrofit/util/MetadataUtil.ets | arkts | getPathParameters | Get path parameters metadata | static getPathParameters(target: Object, propertyKey?: string | symbol): Record<number, string> | null {
return this.getMetadata('retrofit:pathParams', target, propertyKey) || null;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getPathParameters 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#L... | static getPathParameters(target: Object, propertyKey?: string | symbol): Record<number, string> | null {
return this.getMetadata('retrofit:pathParams', target, propertyKey) || null;
} | https://github.com/killetom/ktretrofit | 9c4cf543e24bb7ea498ba7d5b33b93987dd7c12f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceValidator.ets | arkts | validateSourceSimple | 简单校验(仅搜索)- 兼容旧接口 | async validateSourceSimple(source: LegadoBookSource, testKeyword: string = '斗罗'): Promise<SourceValidationResult> {
return this.validateSource(source, {
checkSearch: true,
checkDiscovery: false,
checkInfo: false,
checkCategory: false,
checkContent: false,
keyword: testKeyword,
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left validateSourceSimple AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left source AST#identifier#Right AST#type_annotation#Left AST#:... | async validateSourceSimple(source: LegadoBookSource, testKeyword: string = '斗罗'): Promise<SourceValidationResult> {
return this.validateSource(source, {
checkSearch: true,
checkDiscovery: false,
checkInfo: false,
checkCategory: false,
checkContent: false,
keyword: testKeyword,
... | https://github.com/DaLongZhuaZi/manxia | e12205c4a312450be2623116c576d0ae4b70391e | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/DataView.ets | arkts | getInt16 | Read bytes as they represent given type
@param byteOffset zero index to read
@param littleEndian read as little or big endian
@returns read value | public getInt16(byteOffset: number, littleEndian: boolean): number {
return this.getInt16(byteOffset as int, littleEndian)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getInt16 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Rig... | public getInt16(byteOffset: number, littleEndian: boolean): number {
return this.getInt16(byteOffset as int, littleEndian)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 15bb74b34e230ecbd25cf0c5ad31bae9d3138155 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/MainMenuPage.ets | arkts | getShelfFilteredEBookList | 获取书架筛选后的电子书列表(应用排序和标签/作者筛选) | private getShelfFilteredEBookList(): EBook[] {
let baseList: EBook[] = this.ebookList;
// 如果是自定义书架,只显示用户明确添加的内容
if (this.selectedShelf !== null) {
const itemIds = this.typeShelfManager.getShelfItemIdsByType(this.selectedShelf.id, ContentType.EBOOK);
baseList = this.ebookList.filter((ebook... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getShelfFilteredEBookList 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#Rig... | private getShelfFilteredEBookList(): EBook[] {
let baseList: EBook[] = this.ebookList;
// 如果是自定义书架,只显示用户明确添加的内容
if (this.selectedShelf !== null) {
const itemIds = this.typeShelfManager.getShelfItemIdsByType(this.selectedShelf.id, ContentType.EBOOK);
baseList = this.ebookList.filter((ebook... | https://github.com/DaLongZhuaZi/manxia | 0174477469d251d0c5712f42a0427199107c215b | github |
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/CustomerServiceRepository.ets | arkts | constructor | 构造函数
@param networkDataSource 客服网络数据源 | constructor(networkDataSource?: CustomerServiceNetworkDataSource) {
this.networkDataSource = networkDataSource ?? new CustomerServiceNetworkDataSourceImpl();
} | 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#ERROR#Left AST#identifier#Left networkDataSource AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif... | constructor(networkDataSource?: CustomerServiceNetworkDataSource) {
this.networkDataSource = networkDataSource ?? new CustomerServiceNetworkDataSourceImpl();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 4438e73e6f3ec54c6951e99e498c58f2e0151eba | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/UndefinableObjectArray.ets | arkts | reserve | Increases capacity if passed argument is greater than current capacity
@param { int } capacity - The new capacity
@syscap SystemCapability.Utils.Lang | public reserve(capacity: int): void {
if (this.data.length < capacity) {
let newData : FixedArray<UndefinableObject> = new FixedArray<UndefinableObject>(capacity)
for (let i = 0; i < this.curSize; ++i) {
newData[i] = this.data[i]
}
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left reserve 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#identifier#R... | public reserve(capacity: int): void {
if (this.data.length < capacity) {
let newData : FixedArray<UndefinableObject> = new FixedArray<UndefinableObject>(capacity)
for (let i = 0; i < this.curSize; ++i) {
newData[i] = this.data[i]
}
... | https://gitcode.com/iop123123/arkts-static-skills | c627a6c0b0e97e03d9da75886340a852e40e1e4f | gitcode |
OHPG/FinSdk | emby/src/main/ets/api/UserApi.ets | arkts | authenticateUserByName | authenticateUserByName
@summary Authenticates a user by name.
@param authenticateUserByName requestParameters Request parameters.
@throws {RequiredError}
@memberof UserApi | public async authenticateUserByName(authenticateUserByName: AuthenticateUserByName): Promise<AuthenticationResult> {
return this.apiClient.post({ path: "/Users/AuthenticateByName", data: authenticateUserByName })
} | 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 authenticateUserByName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left authenticateUserByName AST#identi... | public async authenticateUserByName(authenticateUserByName: AuthenticateUserByName): Promise<AuthenticationResult> {
return this.apiClient.post({ path: "/Users/AuthenticateByName", data: authenticateUserByName })
} | https://github.com/OHPG/FinSdk | 8d5cbaef35a53b7bfb39348cb75c5af0fd8ebcfd | github |
openharmony-tpc/ImageKnife | entry/src/main/ets/common/CustomEngineKeyImpl.ets | arkts | generateFileKey | 生成文件缓存key | generateFileKey(loadSrc: string | PixelMap | Resource, signature?: string,isAnimator?: boolean): string {
let src = ""
if(signature == "aaa" && typeof loadSrc == "string") {
let num = loadSrc.indexOf("?")
let key = loadSrc.substring(0,num)
src = "loadSrc=" + key
} else {
src = (isA... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left generateFileKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left loadSrc AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#binary_expression#Left AST... | generateFileKey(loadSrc: string | PixelMap | Resource, signature?: string,isAnimator?: boolean): string {
let src = ""
if(signature == "aaa" && typeof loadSrc == "string") {
let num = loadSrc.indexOf("?")
let key = loadSrc.substring(0,num)
src = "loadSrc=" + key
} else {
src = (isA... | https://gitee.com/openharmony-tpc/ImageKnife.git | d5bd9f712a55a8247a74abdabdd55109ce9cc8f3 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/RegExp.ets | arkts | $_invoke | RegExp constructor call signature, used to create new RegExp instances.
@param { String } pattern Regular expression pattern.
@param { String } [flags] Regular expression flags.
@returns { RegExp } Newly created RegExp instance.
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static $_invoke(pattern: String, flags?: String) : RegExp {
return new RegExp(pattern, flags)
} | 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 $_invoke AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pattern AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#... | public static $_invoke(pattern: String, flags?: String) : RegExp {
return new RegExp(pattern, flags)
} | https://gitcode.com/iop123123/arkts-static-skills | 90ae163f73a52ae4e9a749b6f6dfd841372e5dde | gitcode |
Joker-x-dev/CoolMallArkTS | core/model/src/main/ets/entity/CategoryTree.ets | arkts | buildCategoryTree | 递归构建分类树
@param {CategoryTree} categoryTree - 当前分类节点
@param {Map<number, CategoryTree[]>} childrenMap - 子分类映射
@returns {CategoryTree} 构建完成的分类节点 | private static buildCategoryTree(
categoryTree: CategoryTree,
childrenMap: Map<number, CategoryTree[]>
): CategoryTree {
const children: CategoryTree[] = childrenMap.get(categoryTree.id) ?? [];
if (children.length === 0) {
return categoryTree;
}
categoryTree.children =
children.m... | 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 buildCategoryTree AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left categoryTree AST#identifier#Right ... | private static buildCategoryTree(
categoryTree: CategoryTree,
childrenMap: Map<number, CategoryTree[]>
): CategoryTree {
const children: CategoryTree[] = childrenMap.get(categoryTree.id) ?? [];
if (children.length === 0) {
return categoryTree;
}
categoryTree.children =
children.m... | https://github.com/Joker-x-dev/CoolMallArkTS | 3b62ee4a85a197c83612a367946a2a6fbb6f18b6 | github |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnFormViewModel.ets | arkts | setGender | ==================== 动态表单操作 ====================
设置性别
@param value 性别值 | setGender(value: string): void {
this.dynamicForm.gender = value;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setGender AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#... | setGender(value: string): void {
this.dynamicForm.gender = value;
} | https://github.com/codelably/tuniao-ui | 16f6960cad3ac532c57f42275b591b3f0f4cf684 | github |
harmonyos/codelabs | HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/service/ReminderAgent.ets | arkts | hasNotificationId | hasNotificationId | function hasNotificationId(params: number) {
if (!params) {
Logger.error(Const.REMINDER_AGENT_TAG, 'hasNotificationId params is undefined');
return;
}
return reminderAgent.getValidReminders().then((reminders) => {
if (!reminders.length) {
return false;
}
let notificationIdList: Array<num... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left hasNotificationId AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : AS... | function hasNotificationId(params: number) {
if (!params) {
Logger.error(Const.REMINDER_AGENT_TAG, 'hasNotificationId params is undefined');
return;
}
return reminderAgent.getValidReminders().then((reminders) => {
if (!reminders.length) {
return false;
}
let notificationIdList: Array<num... | https://gitee.com/harmonyos/codelabs.git | 5abaf11ef4db072fee7988edc846da51f82c9526 | gitee |
openharmony-sig/applications_clock | common/src/main/ets/manager/BreakpointManager.ets | arkts | unregister | Unregister breakpoint listening. | public unregister(): void {
for (const item of this.listenerList) {
item.listener.off('change');
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left unregister 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 unregister(): void {
for (const item of this.listenerList) {
item.listener.off('change');
}
} | https://gitee.com/openharmony-sig/applications_clock.git | d8b2568e1474602be1d0a8226af2331b6a915a5f | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebDAV/WebDAVNativeTest.ets | arkts | runTest | 运行单个测试 | private async runTest(testName: string, testFn: () => Promise<string>): Promise<void> {
const startTime = Date.now();
try {
logger.info(TAG, `开始测试: ${testName}`);
const message = await testFn();
const duration = Date.now() - startTime;
this.testResults.push({
testName,
... | 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 runTest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left testName AST#identifier#Right AST#ERROR#Left AST#:#Left : AS... | private async runTest(testName: string, testFn: () => Promise<string>): Promise<void> {
const startTime = Date.now();
try {
logger.info(TAG, `开始测试: ${testName}`);
const message = await testFn();
const duration = Date.now() - startTime;
this.testResults.push({
testName,
... | https://github.com/DaLongZhuaZi/manxia | 2ccf255098c9a5a3652a06fa4e8995892ff137b5 | github |
HarmonyOS_Samples/MusicHome | common/musicbasic/src/main/ets/db/MusicMemoryStore.ets | arkts | coverLabelForSongId | Picks a cover resource for a song id; id 1 uses a fixed VIP-style art.
@param id Song primary key.
@returns Cover {@link Resource} for UI. | private coverLabelForSongId(id: number): Resource {
if (id === 1) {
return $r('app.media.ic_dream');
}
return MusicMemoryStore.coverLabelCycle[(id - 2) % 10];
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left coverLabelForSongId 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#... | private coverLabelForSongId(id: number): Resource {
if (id === 1) {
return $r('app.media.ic_dream');
}
return MusicMemoryStore.coverLabelCycle[(id - 2) % 10];
} | https://gitcode.com/HarmonyOS_Samples/MusicHome | 8f2fce9eecc5fad1e490e2b459ebce2f21036708 | gitcode |
qiuhaotc/HarmonyOSPlayground | entry/src/main/ets/utils/RecurringBillService.ets | arkts | getNextDate | 计算下一个日期 | private getNextDate(date: Date, recurringType: RecurringType, interval: number): Date {
const nextDate = new Date(date);
switch (recurringType) {
case RecurringType.DAILY:
nextDate.setDate(nextDate.getDate() + interval);
break;
case RecurringType.WEEKLY:
nextDate.setDa... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getNextDate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left D... | private getNextDate(date: Date, recurringType: RecurringType, interval: number): Date {
const nextDate = new Date(date);
switch (recurringType) {
case RecurringType.DAILY:
nextDate.setDate(nextDate.getDate() + interval);
break;
case RecurringType.WEEKLY:
nextDate.setDa... | https://github.com/qiuhaotc/HarmonyOSPlayground | 9574902f3cd25328d5fec98c8d9162316e9c7e19 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelTxtTocRuleManager.ets | arkts | getDefaultTxtTocRules | 获取默认TXT目录规则
使用NovelSettingsManager中更完整的规则集 | function getDefaultTxtTocRules(): AddTxtTocRuleParams[] {
// 将NovelSettingsManager中的规则转换为本地格式
return SETTINGS_TXT_TOC_RULES.map((rule: SettingsTxtTocRule, index: number): AddTxtTocRuleParams => {
const params: AddTxtTocRuleParams = {
name: rule.name,
rule: rule.pattern,
example: rule.example,
... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getDefaultTxtTocRules 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#array... | function getDefaultTxtTocRules(): AddTxtTocRuleParams[] {
// 将NovelSettingsManager中的规则转换为本地格式
return SETTINGS_TXT_TOC_RULES.map((rule: SettingsTxtTocRule, index: number): AddTxtTocRuleParams => {
const params: AddTxtTocRuleParams = {
name: rule.name,
rule: rule.pattern,
example: rule.example,
... | https://github.com/DaLongZhuaZi/manxia | 405bc797eb6695bf0940f586f7ee56251c4e3d64 | github |
openharmony/applications_app_samples | code/BasicFeature/Media/VideoListAutoPlay/casesfeature/videolistautoplay/src/main/ets/model/NewsListDataSource.ets | arkts | getData | 获取索引对应的数据
@param index 数组索引
@returns | public getData(index: number): NewsItem {
return this.dataList[index];
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getData 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 number ... | public getData(index: number): NewsItem {
return this.dataList[index];
} | https://github.com/openharmony/applications_app_samples | f46f023576d699d476768d5015806704d65c3641 | github |
openharmony/codelabs | ETSUI/Foodbook/entry/src/main/ets/pages/set up.ets | arkts | performLogout | 执行退出登录 | performLogout() {
router.clear()
router.replaceUrl({
url: 'pages/login'
})
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left performLogout 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... | performLogout() {
router.clear()
router.replaceUrl({
url: 'pages/login'
})
} | https://gitcode.com/openharmony/codelabs | bee2174f88ff56ff9718b49137e5d8360d7993da | gitcode |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/BarLineChartBaseModel.ets | arkts | getDataSetByTouchPoint | returns the DataSet object displayed at the touched position of the chart
@param x
@param y
@return | public getDataSetByTouchPoint(x: number, y: number): IBarLineScatterCandleBubbleDataSet<EntryOhos> | null {
let h: Highlight | null = this.getHighlightByTouchPoint(x, y);
if (h != null && this.mData) {
return this.mData.getDataSetByIndex(h.getDataSetIndex()) as IBarLineScatterCandleBubbleDataSet<EntryOh... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDataSetByTouchPoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | public getDataSetByTouchPoint(x: number, y: number): IBarLineScatterCandleBubbleDataSet<EntryOhos> | null {
let h: Highlight | null = this.getHighlightByTouchPoint(x, y);
if (h != null && this.mData) {
return this.mData.getDataSetByIndex(h.getDataSetIndex()) as IBarLineScatterCandleBubbleDataSet<EntryOh... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 7157dda9bec588ab98dee830b7834b1cdd2585e3 | gitee |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/UserDAO.ets | arkts | getByUsername | 根据用户名查询用户(用于登录验证) | static async getByUsername(username: string): Promise<User | null> {
const store = DatabaseManager.getDatabase();
const sql = `SELECT * FROM users WHERE username = ? AND is_deleted = 0`;
let rs: relationalStore.ResultSet | null = null;
try {
rs = await store.querySql(sql, [username]);
if ... | 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 getByUsername AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left :... | static async getByUsername(username: string): Promise<User | null> {
const store = DatabaseManager.getDatabase();
const sql = `SELECT * FROM users WHERE username = ? AND is_deleted = 0`;
let rs: relationalStore.ResultSet | null = null;
try {
rs = await store.querySql(sql, [username]);
if ... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 42de552f05b6263795d3fec35c910b6ad0ec39cf | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/app/tabs/classes/meowTabsBunch.ets | arkts | currentTabSearchIdx | Gets the current search result index. | get currentTabSearchIdx() {
return this.currentTab?.currentSearchResultIdx;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left currentTabSearchIdx 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 { AS... | get currentTabSearchIdx() {
return this.currentTab?.currentSearchResultIdx;
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | f85224dcea4803afbbf5699c6f8a0854ef722b9c | github |
openharmony-tpc/XmlGraphicsBatik | library/src/main/ets/batik/svggen/SVGPath.ets | arkts | addPoints | 添加顶点
@param x 顶点的X坐标
@param y 顶点的Y坐标 | public addPoints(order: string, x?: number, y?: number): void{
let index = PathOrders.indexOf(order);
if (index === -1) {
return;
}
let point = '';
if (order === 'z' || order === 'Z') {
point = order = ' ';
} else if (x === undefined) {
x = 0;
} else if (y === undefined)... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addPoints AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left order AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left strin... | public addPoints(order: string, x?: number, y?: number): void{
let index = PathOrders.indexOf(order);
if (index === -1) {
return;
}
let point = '';
if (order === 'z' || order === 'Z') {
point = order = ' ';
} else if (x === undefined) {
x = 0;
} else if (y === undefined)... | https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git | 9d8ed71bcdfcb153dc4a0291aafe99c7b5ad6379 | gitee |
ibestservices/ibest-ui | library/src/main/ets/components/checkbox/index.ets | arkts | getIsDisabled | 获取是否禁用 | getIsDisabled() {
return this.groupDisabled || this.disabled || this.checkboxGroupMaxDisabled
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getIsDisabled 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... | getIsDisabled() {
return this.groupDisabled || this.disabled || this.checkboxGroupMaxDisabled
} | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/checkbox/index.ets#L239-L241 | 4b27b84343172e3f107ffbdd09b78ae18c358fcd | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/utils/SettingsUtil.ets | arkts | clearFamilyAuth | 清除家属认证信息 | async clearFamilyAuth(): Promise<void> {
if (this.dataPreferences === null) {
return;
}
try {
await this.dataPreferences.delete('family_token');
await this.dataPreferences.delete('family_info');
await this.dataPreferences.flush();
} catch (e) {
console.error('SettingsUtil... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left clearFamilyAuth AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left... | async clearFamilyAuth(): Promise<void> {
if (this.dataPreferences === null) {
return;
}
try {
await this.dataPreferences.delete('family_token');
await this.dataPreferences.delete('family_info');
await this.dataPreferences.flush();
} catch (e) {
console.error('SettingsUtil... | https://github.com/LJ666-ui/harmony-health-care | 50e4252d97e9766dc7e2c6d65df1eb65da96580f | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentSet.ets | arkts | add | Puts a value into the ConcurrentSet
@param { T } val the value to put into the ConcurrentSet
@returns { this } this | public add(val: T): this {
this.elements.set(val, val);
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 add AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left val AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identi... | public add(val: T): this {
this.elements.set(val, val);
return this;
} | https://gitcode.com/iop123123/arkts-static-skills | e40d73175d84645b29070b46708c1b714a8f1b82 | gitcode |
751496032/DSBridge-HarmonyOS | library/src/main/ets/core/WebViewControllerProxy.ets | arkts | runJavaScript | 运行JS脚本
@param script
@returns | runJavaScript(script: string): Promise<string> {
return this.controller.runJavaScript(script);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left runJavaScript AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left script A... | runJavaScript(script: string): Promise<string> {
return this.controller.runJavaScript(script);
} | https://github.com/751496032/DSBridge-HarmonyOS/blob/6e69923a816e400710e23c8bab549fe790545bc6/library/src/main/ets/core/WebViewControllerProxy.ets#L137-L139 | 852d37e6ec3102c65d704bd51b5cb16d1d15becd | github |
FinalScave/SweetLine | platform/OHOS/sweetline/src/main/ets/Index.ets | arkts | totalChars | Total character count of the document | public totalChars(): number {
return lib.Document_TotalChars(this.nativeHandle);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left totalChars 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#numb... | public totalChars(): number {
return lib.Document_TotalChars(this.nativeHandle);
} | https://github.com/FinalScave/SweetLine | d95a7360d9ec6f721835bbdd953841d70570d368 | github |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/dao/ContactDBConfig.ets | arkts | initDB | 初始化数据库(现在需要传递上下文) | public async initDB(context: common.Context): Promise<boolean> {
try {
console.info('[ContactDBConfig] 开始初始化联系人数据库...');
// 使用传入的上下文打开或创建数据库
this.rdbStore = await relationalStore.getRdbStore(
context,
ContactDBConfig.STORE_CONFIG
);
console.info('[ContactDBConfig] 数... | 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 initDB AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#R... | public async initDB(context: common.Context): Promise<boolean> {
try {
console.info('[ContactDBConfig] 开始初始化联系人数据库...');
// 使用传入的上下文打开或创建数据库
this.rdbStore = await relationalStore.getRdbStore(
context,
ContactDBConfig.STORE_CONFIG
);
console.info('[ContactDBConfig] 数... | https://gitcode.com/openharmony/codelabs | a0044bc9f3283f0fd0cc0ce8b16bb7bd7d79fcec | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/logging/Logger.ets | arkts | configure | 配置日志系统
@param enabled 是否启用日志
@param level 日志级别 | configure(enabled: boolean, level: LogLevel): void {
this.enabled = enabled
this.level = level
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left configure AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right AST#,#Left , A... | configure(enabled: boolean, level: LogLevel): void {
this.enabled = enabled
this.level = level
} | https://github.com/offlinecat-dev/OCNetORM | b37f7d368bc1381a617a6029fb566dc673762790 | github |
openharmony-tpc/XmlGraphicsBatik | library/src/main/ets/batik/svggen/SVGEllipse.ets | arkts | setRY | 获取椭圆y半径
@param newRY 椭圆y半径 | public setRY(newRY: number): void{
this._ry = newRY;
this._ellipseResultObj['ry'] = newRY;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left setRY AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newRY AST#identifier#Right AST#:#Left : AST#:#Right AST#ER... | public setRY(newRY: number): void{
this._ry = newRY;
this._ellipseResultObj['ry'] = newRY;
} | https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git | 7ea04f386eac754c8fee945d36f0f0a98566b5cc | gitee |
tdcare/tdwebrtc | src/main/ets/utils/LogUtil.ets | arkts | getLogLocation | 获取代码位置(性能开销比较大,当频繁创建带有调用栈信息的错误对象时,会对程序的性能产生明显影响)。 | public static getLogLocation(): string {
const errorStack = new Error().stack;
const stackArray = errorStack?.split('\n');
let errorLocation: string = stackArray?.filter(item => item !== null && item.length > 1)?.map(value => value.trim()
.concat('\t'))?.splice(3).join('') ?? '';
return `\n│ ${... | 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 getLogLocation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#... | public static getLogLocation(): string {
const errorStack = new Error().stack;
const stackArray = errorStack?.split('\n');
let errorLocation: string = stackArray?.filter(item => item !== null && item.length > 1)?.map(value => value.trim()
.concat('\t'))?.splice(3).join('') ?? '';
return `\n│ ${... | https://github.com/tdcare/tdwebrtc | fdcc1c234862e3dbed83130fb64fe8a468769c00 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/RdpSessionManager.ets | arkts | isScreenLocked | Check if screen is currently locked | static isScreenLocked(): boolean {
// Return cached state since screenLock.isScreenLocked is async
return sessionIsScreenLocked;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isScreenLocked 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 boolean AS... | static isScreenLocked(): boolean {
// Return cached state since screenLock.isScreenLocked is async
return sessionIsScreenLocked;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 62e50c39918d0e5bbb049a5fbd3931a0927385cc | github |
jjjjjjava/ffmpeg_tools | src/main/ets/ffmpeg/FFmpegCommandBuilder.ets | arkts | crf | 设置 CRF 质量 | public crf(value: number): FFmpegCommandBuilder {
this.crfValue = value;
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 crf 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#ERRO... | public crf(value: number): FFmpegCommandBuilder {
this.crfValue = value;
return this;
} | https://github.com/jjjjjjava/ffmpeg_tools | 2ca89bbf604f24d3e0546a24fd32463071ca3127 | github |
LongLiveY96/chatcube | entry/src/main/ets/viewmodels/ChatViewModel.ets | arkts | upsertHostedImageGenPart | 每个 hosted image_generation_call 占一个独立 TOOL part, key=hig_<itemId>。
- 首次出现: 插到当前活跃 reasoning/text 之前, status=RUNNING, 避免正文流式块把工具行夹在中间
- 后续 partial / completed: 仅更新 toolStatus 与 partial 序号; 不重建 part
关键作用: 把 aiMessage.parts 撑非空, 顶掉 MessageBubble 的 Bubble Dots 等待动画。
返回 true 表示有改动, 调用方据此决定是否触发 UI 刷新。 | private upsertHostedImageGenPart(
aiMessage: ChatMessage,
itemKey: string,
outputIndex: number,
status: string,
partialIndex: number
): boolean {
const partId = this.buildOpenAIResponsesHostedPartId(OPENAI_RESPONSES_IMAGE_GENERATION_PREFIX, itemKey)
let part: MessagePart | null = null
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left upsertHostedImageGenPart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left aiMessage AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST... | private upsertHostedImageGenPart(
aiMessage: ChatMessage,
itemKey: string,
outputIndex: number,
status: string,
partialIndex: number
): boolean {
const partId = this.buildOpenAIResponsesHostedPartId(OPENAI_RESPONSES_IMAGE_GENERATION_PREFIX, itemKey)
let part: MessagePart | null = null
... | https://github.com/LongLiveY96/chatcube | 5de586f25b77b665e34b243292f3813951cc2fc3 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceActionEngine.ets | arkts | checkElement | 检查元素是否存在 | private async checkElement(selector: string): Promise<boolean> {
const script = `document.querySelector('${selector}') !== null`;
return await this.executeJavaScript<boolean>(script);
} | 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 checkElement AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left selector AST#identifier#Right AST#ERROR#Left AST#:#Left... | private async checkElement(selector: string): Promise<boolean> {
const script = `document.querySelector('${selector}') !== null`;
return await this.executeJavaScript<boolean>(script);
} | https://github.com/DaLongZhuaZi/manxia | b7386b3ea04146fae8a19d2ed25921e7a8935779 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoJsExtensions.ets | arkts | ajaxAll | 并发访问网络 | async ajaxAll(urlList: string[]): Promise<JsResponse[]> {
const results: JsResponse[] = [];
const promises = urlList.map(async (url) => {
try {
const response = await this.connect(url);
return response;
} catch (error) {
return { body: '', url: url, code: 0 };
}
}... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left ajaxAll AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left urlList AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | async ajaxAll(urlList: string[]): Promise<JsResponse[]> {
const results: JsResponse[] = [];
const promises = urlList.map(async (url) => {
try {
const response = await this.connect(url);
return response;
} catch (error) {
return { body: '', url: url, code: 0 };
}
}... | https://github.com/DaLongZhuaZi/manxia | 4699b09d42747cb905fabeb516deedd468a09697 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/microphone/MicrophoneManager.ets | arkts | isMicrophoneActive | 麦克风是否活跃 | isMicrophoneActive(): boolean {
return this.microphoneStream?.isRunning() || false;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isMicrophoneActive 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 boolean AST#boolean#Right AST#ERROR#Right AST#... | isMicrophoneActive(): boolean {
return this.microphoneStream?.isRunning() || false;
} | https://github.com/AlkaidLab/moonlight-harmony | 743fd912e997276a12c075166877991524318c2a | github |
openharmony-tpc/httpclient | entry/src/main/ets/pages/requestCaching.ets | arkts | checkServerTrusted | 校验服务器证书 | checkServerTrusted(X509Certificate: certFramework.X509Cert): void {
Logger.info(TAG, 'Get Server Trusted X509Certificate');
// 时间校验成功的设置值
let currentDayTime: number = StringUtil.getCurrentDayTime();
let date = currentDayTime + 'Z';
try {
X509Certificate.checkValidityWithDate(date); // 检查X509... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left checkServerTrusted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left X509Certificate AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left certFramework A... | checkServerTrusted(X509Certificate: certFramework.X509Cert): void {
Logger.info(TAG, 'Get Server Trusted X509Certificate');
// 时间校验成功的设置值
let currentDayTime: number = StringUtil.getCurrentDayTime();
let date = currentDayTime + 'Z';
try {
X509Certificate.checkValidityWithDate(date); // 检查X509... | https://gitee.com/openharmony-tpc/httpclient.git | a114d65c3be205fe7b5a38ccce004932e7ae888b | gitee |
darcycui/DarcyHarmonyNext | static_library_common/src/main/ets/utils/RouterHelper.ets | arkts | startNamedPage | 命名路由
不替换当前页(默认)
多实例模式(默认) | static startNamedPage(context: UIContext, url: string, params?: Record<string, string>,
replace: boolean = false,
single: boolean = false) {
let mode: router.RouterMode;
if (single) {
mode = router.RouterMode.Single
} else {
mode = router.RouterMode.Standard
}
if (replace) {
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left startNamedPage 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#identifier#Lef... | static startNamedPage(context: UIContext, url: string, params?: Record<string, string>,
replace: boolean = false,
single: boolean = false) {
let mode: router.RouterMode;
if (single) {
mode = router.RouterMode.Single
} else {
mode = router.RouterMode.Standard
}
if (replace) {
... | https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/static_library_common/src/main/ets/utils/RouterHelper.ets#L37-L51 | 19a1217b45cdeafd70004bed4ff3d8f42a1c367c | github |
YANGZX22/Voot | entry/src/main/ets/pages/ConfigurationPage.ets | arkts | aboutToAppear | 用于追踪当前激活的选项 | aboutToAppear() {
this.itemScales = this.options.map(() => 0.85);
this.itemOpacities = this.options.map(() => 0);
// 标题动画
setTimeout(() => {
animateTo({
duration: 300,
curve: Curve.FastOutSlowIn
}, () => {
this.headerOpacity = 1;
this.headerOffsetY = 0;... | AST#program#Left AST#expression_statement#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#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
this.itemScales = this.options.map(() => 0.85);
this.itemOpacities = this.options.map(() => 0);
// 标题动画
setTimeout(() => {
animateTo({
duration: 300,
curve: Curve.FastOutSlowIn
}, () => {
this.headerOpacity = 1;
this.headerOffsetY = 0;... | https://github.com/YANGZX22/Voot | 4c8689d3e468bf0565c18c399da5ae387f8073cb | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/GlobalAnimationSystem.ets | arkts | clearAllAnimations | 清理所有动画状态 | public clearAllAnimations(): void {
this.activeAnimations.clear();
this.animationCallbacks.clear();
logger.info(TAG, '清理所有动画状态');
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearAllAnimations 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#exp... | public clearAllAnimations(): void {
this.activeAnimations.clear();
this.animationCallbacks.clear();
logger.info(TAG, '清理所有动画状态');
} | https://github.com/DaLongZhuaZi/manxia | 0d79802aa31b9abfe51469f8cd75bcb490f56174 | github |
cheinlu/HarmonyOS-groundhog-charging-system | TbsChargeHarmonyOs/common/src/main/ets/location/LocationManager.ets | arkts | checkLocationPermissions | 检查是否有定位权限,外部可直接调用,异常时返回false | async checkLocationPermissions(): Promise<boolean> {
try {
return await permissionManager.checkPermissions(PermissionConst.locationPermissions) &&
geoLocationManager.isLocationEnabled();
} catch (e) {
console.log(`lucy== hasLocationPermissions, ${JSON.stringify(e)}`)
return false;
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left checkLocationPermissions AST#identifier#Right AST#ERROR#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... | async checkLocationPermissions(): Promise<boolean> {
try {
return await permissionManager.checkPermissions(PermissionConst.locationPermissions) &&
geoLocationManager.isLocationEnabled();
} catch (e) {
console.log(`lucy== hasLocationPermissions, ${JSON.stringify(e)}`)
return false;
... | https://github.com/cheinlu/HarmonyOS-groundhog-charging-system | 02bed7d3f38b4afa95892a8da4338696bca38da2 | github |
aimilin6688/KeePassHO | entry/src/main/ets/storage/ftp/FTPHandler.ets | arkts | listDir | 列出目录内容 | public async listDir(path: string): Promise<Array<FileItemInfo>> {
if (!this.client) {
throw new Error('FTP client is not connected');
}
const files = await this.client.list(path);
const result: FileItemInfo[] = [];
for (let i = 0; i < files.length; i++) {
const file = files[i];
... | 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 listDir AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Rig... | public async listDir(path: string): Promise<Array<FileItemInfo>> {
if (!this.client) {
throw new Error('FTP client is not connected');
}
const files = await this.client.list(path);
const result: FileItemInfo[] = [];
for (let i = 0; i < files.length; i++) {
const file = files[i];
... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/ftp/FTPHandler.ets#L165-L186 | bd1788562d31ebead40cd01bb6c6fffcbea29ebf | github |
Delsin-Yu/JustPDF | entry/src/main/ets/components/PageInfo.ets | arkts | resolveOrStartCacheTask | 若已有缓存或正在加载则返回对应 Promise;否则启动任务并返回其 Promise。 | private resolveOrStartCacheTask(renderScale: number, priority: taskpool.Priority): Promise<PageCache> {
const cached = this.caches.get(renderScale);
if (cached !== undefined) {
return Promise.resolve(cached);
}
const pending = this.pendingTasks.get(renderScale);
if (pending !== undefined) {
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left resolveOrStartCacheTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left renderScale AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left nu... | private resolveOrStartCacheTask(renderScale: number, priority: taskpool.Priority): Promise<PageCache> {
const cached = this.caches.get(renderScale);
if (cached !== undefined) {
return Promise.resolve(cached);
}
const pending = this.pendingTasks.get(renderScale);
if (pending !== undefined) {
... | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/components/PageInfo.ets#L420-L430 | 7aeecb634feab55638b4fae94089e2d5d83eed55 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.variable_and_constant_declarations/04.type_inference_from_initializer/null_initializer.ets | arkts | main | inferred Object|null | function main(): void {
x = new Error();
assert x instanceof Error;
x = null;
assert x == null;
x = new Object();
assert x instanceof Object;
x = new string[1];
(x as string[])[0] = "abc";
assert (x as string[])[0] == "abc";
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main 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#Left A... | function main(): void {
x = new Error();
assert x instanceof Error;
x = null;
assert x == null;
x = new Object();
assert x instanceof Object;
x = new string[1];
(x as string[])[0] = "abc";
assert (x as string[])[0] == "abc";
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 0f2242460682339f93c7d265466d3e9bd274c80b | gitee |
openharmony/codelabs | ETSUI/ECommerce/entry/src/main/ets/utils/RdbUtil.ets | arkts | getOrderDetails | 查询订单列表(含明细):优先走内存缓存;若缓存为空再读数据库
这样能兼容预览器/无数据库场景,也减少频繁 IO | static async getOrderDetails(userId: number, status?: number): Promise<OrderWithItems[]> {
const memOrders = RdbUtil.memOrders
.filter(o => o.userId === userId)
.filter(o => status === undefined ? true : o.status === status)
.slice()
.sort((a, b) => b.createTime - a.createTime);
if (m... | 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 getOrderDetails AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left :... | static async getOrderDetails(userId: number, status?: number): Promise<OrderWithItems[]> {
const memOrders = RdbUtil.memOrders
.filter(o => o.userId === userId)
.filter(o => status === undefined ? true : o.status === status)
.slice()
.sort((a, b) => b.createTime - a.createTime);
if (m... | https://gitcode.com/openharmony/codelabs | 9f749892f69a78b07f1f59ecf739ef92cb56cb39 | gitcode |
HarmonyOS_Samples/guide-snippets | Ability/EnvConfig/entry/src/main/ets/pages/EnvAbilityPage6.ets | arkts | subscribeConfigurationUpdate | 注册订阅系统环境变化的ID | subscribeConfigurationUpdate(): void {
let systemLanguage: string | undefined = this.context.config.language; // 获取系统当前语言
// 1.获取ApplicationContext
let applicationContext = this.context.getApplicationContext();
// 2.通过applicationContext订阅环境变量变化
let environmentCallback: EnvironmentCallback = {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left subscribeConfigurationUpdate 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... | subscribeConfigurationUpdate(): void {
let systemLanguage: string | undefined = this.context.config.language; // 获取系统当前语言
// 1.获取ApplicationContext
let applicationContext = this.context.getApplicationContext();
// 2.通过applicationContext订阅环境变量变化
let environmentCallback: EnvironmentCallback = {
... | https://gitcode.com/HarmonyOS_Samples/guide-snippets | 6a42fb1abb1523ef55b7a8debbd81844ff2f25fb | gitcode |
richshaw2015/nds | ohos/entry/src/test/ThemeManager.test.ets | arkts | isValidHexColor | 验证十六进制颜色格式是否有效
支持 #RGB 和 #RRGGBB 格式
@param color 颜色字符串
@returns 是否为有效的十六进制颜色 | function isValidHexColor(color: string): boolean {
if (typeof color !== 'string') {
return false;
}
// 匹配 #RGB 或 #RRGGBB 格式
const hexColorRegex = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;
return hexColorRegex.test(color);
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left isValidHexColor AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left color AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | function isValidHexColor(color: string): boolean {
if (typeof color !== 'string') {
return false;
}
// 匹配 #RGB 或 #RRGGBB 格式
const hexColorRegex = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;
return hexColorRegex.test(color);
} | https://github.com/richshaw2015/nds | 8cbb77e534abc4b8005d860ba5000ddebe20dc70 | github |
HarmonyOS_Samples/BestPracticeSnippets | VideoProcessBaseWeb/entry/src/main/ets/pages/Index.ets | arkts | aboutToAppear | [EndExclude index] | aboutToAppear(): void {
window.getLastWindow(this.context).then((windowClass) => this.windowClass = windowClass);
// [StartExclude index]
this.manager.registerController(Constants.INDEX_WEB_CONTROLLER, this.webController);
AppStorage.setOrCreate<ComponentContent<Object>>('contentNode', this.contentNod... | 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 {
window.getLastWindow(this.context).then((windowClass) => this.windowClass = windowClass);
// [StartExclude index]
this.manager.registerController(Constants.INDEX_WEB_CONTROLLER, this.webController);
AppStorage.setOrCreate<ComponentContent<Object>>('contentNode', this.contentNod... | https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets | c8f1c741697a8506e5dfb1a37c30be60839db82e | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | clamp | Return a new Decimal whose value is `n` clamped to the range delineated by `min` and `max`.
@param { Value } n {double | string | Decimal}
@param { Value } min {double | string | Decimal}
@param { Value } max {double | string | Decimal}
@returns { Decimal } the Decimal type | static clamp(n: Value, min: Value, max: Value): Decimal {
return new Decimal(n).clamp(min, max);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left clamp AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left n AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | static clamp(n: Value, min: Value, max: Value): Decimal {
return new Decimal(n).clamp(min, max);
} | https://gitcode.com/iop123123/arkts-static-skills | c64c23f239376f396def080463a8154f05b2ff53 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/not_equal/not_equal_byte.ets | arkts | main | ---
desc: check not equal operation for two byte operands
--- | function main(): void {
const a: byte = {{v.left}}
const b: byte = {{v.right}}
assert (a != b) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main 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#Left A... | function main(): void {
const a: byte = {{v.left}}
const b: byte = {{v.right}}
assert (a != b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 48d060bded7ec4197b5e9e4d9f1485dbdd2c796e | gitee |
anhao0226/harmony-music-player | entry/src/main/ets/common/utils/AudioService.ets | arkts | start | @param seek | public start(seek?: number, flag?: Object) {
//
let listType: string = 'list';
if (flag && flag.hasOwnProperty('type')) {
listType = flag['type'];
}
//
if (listType === 'list') {
seek = seek || 0;
let data = this._shareData.getAudioByIndex(seek);
this._shareData.playInd... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left start AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left seek AST#identifier#Right AST#?#Left ? AST#... | public start(seek?: number, flag?: Object) {
//
let listType: string = 'list';
if (flag && flag.hasOwnProperty('type')) {
listType = flag['type'];
}
//
if (listType === 'list') {
seek = seek || 0;
let data = this._shareData.getAudioByIndex(seek);
this._shareData.playInd... | https://github.com/anhao0226/harmony-music-player | 9632d34a2efc70ea3d77b5393116991ee7ed35fe | github |
Nekofox-POT/LinMusic | entry/src/main/ets/建筑垃圾堆/class_files_manager_old.ets | arkts | notice | 外部歌曲缓存目录
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
函数库 //
////////
扫描进度上报 // | function notice(msg: string) {
emitter.emit({ eventId: 812 }, { data: {
msg: msg
} })
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left notice AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left msg AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#... | function notice(msg: string) {
emitter.emit({ eventId: 812 }, { data: {
msg: msg
} })
} | https://github.com/Nekofox-POT/LinMusic | 356fe941f8fe9b26196224ecfabb87570943c77c | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/StoragePaths.ets | arkts | writeVersionFile | 写入版本文件 | private static async writeVersionFile(appDir: string): Promise<void> {
try {
const versionFile = `${appDir}/${StoragePaths.VERSION_FILE}`
const file = await fs.open(versionFile, fs.OpenMode.CREATE | fs.OpenMode.WRITE_ONLY | fs.OpenMode.TRUNC)
const content = StoragePaths.STRUCTURE_VERSION
... | 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 writeVersionFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Lef... | private static async writeVersionFile(appDir: string): Promise<void> {
try {
const versionFile = `${appDir}/${StoragePaths.VERSION_FILE}`
const file = await fs.open(versionFile, fs.OpenMode.CREATE | fs.OpenMode.WRITE_ONLY | fs.OpenMode.TRUNC)
const content = StoragePaths.STRUCTURE_VERSION
... | https://github.com/AetheriumSimulator/qemu-hmos | 78c45b4fed6d09f4b042547863c323cc3043c426 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | from | Creates an Uint8Array from array-like argument
@param o array-like object to initialize Uint8Array
@param mapFn function to apply for each
@returns new Uint8Array | public from(o: Object, mapFn: (e: Object) => number): Uint8Array {
let newF: (e: Object, index: int) => number =
(e: Object, index: int): number => { return mapFn(e) }
return this.from(o, newF)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left from AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left o AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#R... | public from(o: Object, mapFn: (e: Object) => number): Uint8Array {
let newF: (e: Object, index: int) => number =
(e: Object, index: int): number => { return mapFn(e) }
return this.from(o, newF)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 7f516690db30dc669bf06de310ee686f882936ba | gitee |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.uri.ets | arkts | port | Gets the port portion of the URI.
@returns { string } | get port(): string {
return Number.toString(this.uriEntry.getPort());
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left port 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#ER... | get port(): string {
return Number.toString(this.uriEntry.getPort());
} | https://gitcode.com/iop123123/arkts-static-skills | 63d83b85a05aae3995c7b8db94b574b117a7c6b3 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/PaginationHandler.ets | arkts | getPaginationState | 获取分页状态 | getPaginationState(sourceId: string): PaginationState | null {
return this.paginationStates.get(sourceId) || null;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getPaginationState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sourceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#... | getPaginationState(sourceId: string): PaginationState | null {
return this.paginationStates.get(sourceId) || null;
} | https://github.com/DaLongZhuaZi/manxia | c4088c9cbb7fc52f48476a85914bc307b333bee7 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/ChartData.ets | arkts | constructor | 是否是当月最高的一天 (用于高亮显示) | constructor(day: string, amount: number) {
this.day = day;
this.amount = amount;
} | 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#ERROR#Left AST#identifier#Left day AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AS... | constructor(day: string, amount: number) {
this.day = day;
this.amount = amount;
} | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 070a2e07d586727e6cd555b6ed1d3518682e0941 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets | arkts | $_invoke | Constructs a new TypeError instance with provided message and error specific information
@param { String } [message] - Error text
@param { ErrorOptions } [options] - Error options
@returns { TypeError } - Newly created TypeError instance
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | static $_invoke(message?: String, options?: ErrorOptions): TypeError {
return new TypeError(message, options)
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left $_invoke AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#... | static $_invoke(message?: String, options?: ErrorOptions): TypeError {
return new TypeError(message, options)
} | https://gitcode.com/iop123123/arkts-static-skills | c9859589406291fe9a73b1f4fe0c7e7e5ad3ad1c | gitcode |
openharmony-sig/knowledge_demo_entainment | FA/notebook/entry/src/main/ets/common/database/LocalStorage.ets | arkts | clearNoteBookName | 清空记事本名称 | public async clearNoteBookName() {
let preferences = await this.getPreferences()
let result = preferences.put(CommonConstants.KEY_NOTEBOOK_NAME, "")
preferences.flush((err) => {
if (err) {
Logger.error(TAG, 'clearNoteBookName flush fail')
return
}
Logger.info(TAG, 'clearN... | 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 clearNoteBookName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS... | public async clearNoteBookName() {
let preferences = await this.getPreferences()
let result = preferences.put(CommonConstants.KEY_NOTEBOOK_NAME, "")
preferences.flush((err) => {
if (err) {
Logger.error(TAG, 'clearNoteBookName flush fail')
return
}
Logger.info(TAG, 'clearN... | https://gitee.com/openharmony-sig/knowledge_demo_entainment.git | cbb72306a5924dad8033942a0d442af635a8c01c | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | forEach | Applies a function over all elements of Uint16Array
@param fn function to apply
@returns undefined | public forEach(fn: (val: number, index: int, array: Uint16Array) => number): void {
for (let i = 0; i < this.length; ++i) {
this.set(i, fn(this.at(i), i, this))
}
throw new Error("Uint16Array.forEach: has to return undefined, but returns void for now")
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left forEach AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#... | public forEach(fn: (val: number, index: int, array: Uint16Array) => number): void {
for (let i = 0; i < this.length; ++i) {
this.set(i, fn(this.at(i), i, this))
}
throw new Error("Uint16Array.forEach: has to return undefined, but returns void for now")
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | ff2410bc08f9a7c273fdec7714a3be6a5236e87a | gitee |
openharmony/codelabs | ETSUI/PassNote/entry/src/main/ets/pages/FaceRecPage.ets | arkts | isButtonEnabled | 按钮是否可用 | isButtonEnabled(): boolean {
return this.canStartScan;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isButtonEnabled 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 boolean AST#boolean#Right AST#ERROR#Right AST#sta... | isButtonEnabled(): boolean {
return this.canStartScan;
} | https://gitcode.com/openharmony/codelabs | 701fd6f57aa77bf655622b8a66f6b8ea032bddba | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.url.ets | arkts | host | Gets the host portion of the URL.
@return {string} Returns the host portion of the URL. | get host(): string {
return this.cHost;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left host 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#ER... | get host(): string {
return this.cHost;
} | https://gitcode.com/iop123123/arkts-static-skills | 8b17860353ab288f73d46f96bcdfd690a30f1188 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/libs/htmlparser/Parser.ets | arkts | parse | 解析 HTML 字符串 | parse(html: string): HTMLElement {
const startTime = Date.now();
HtmlParserLogger.parseStart(html.length);
this.html = html;
this.pos = 0;
const rootRange: [number, number] = [0, html.length];
const root = new HTMLElement('root', null, '', null, rootRange);
this.parseContent... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left parse AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left html AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)#Rig... | parse(html: string): HTMLElement {
const startTime = Date.now();
HtmlParserLogger.parseStart(html.length);
this.html = html;
this.pos = 0;
const rootRange: [number, number] = [0, html.length];
const root = new HTMLElement('root', null, '', null, rootRange);
this.parseContent... | https://github.com/DaLongZhuaZi/manxia | ae2dffdf7d610f8a9e212d29cf78354fb7adcc42 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ThemeManager.ets | arkts | resetToDefault | 重置为默认主题 | public async resetToDefault(): Promise<void> {
await this.setTheme(ThemeType.AUTO);
} | 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 resetToDefault AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:... | public async resetToDefault(): Promise<void> {
await this.setTheme(ThemeType.AUTO);
} | https://github.com/DaLongZhuaZi/manxia | a535a22342f4d0a614a1129e352170b076bb1270 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | from | Creates a new `Array` instance from `Object[]` primitive array.
@param arr primitive 'Object' array, converted to `Array` instance.
@param fn map function to call on every element of the array.
Every value to be added to the array is first passed through this function, and `fn`'s return value
is added to the array inst... | public static from<T, U>(arr: T[], fn: (v: T, k: number) => U): Array<U> {
let d = new Array<T>(arr);
return d.map<U>(fn);
} | AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#ident... | public static from<T, U>(arr: T[], fn: (v: T, k: number) => U): Array<U> {
let d = new Array<T>(arr);
return d.map<U>(fn);
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 61dd776d686e988da97b937a2e38263f184d5999 | gitee |
aimilin6688/KeePassHO | entry/src/main/ets/services/DataService.ets | arkts | toPasswordPage | 跳转到数据库打开页面
@param router
@param param | public static toPasswordPage(router: Router, locationInfo: LocationInfo): void {
// 添加到最近打开的文件列表
RecentFilesService.addRecentFile({
filePath: locationInfo.filePath,
fileName: locationInfo.fileName,
storageType: locationInfo.storageType,
storageConfig: locationInfo.storageConfig
}).... | 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 toPasswordPage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left router AST#identifier#Right AST#:#Left :... | public static toPasswordPage(router: Router, locationInfo: LocationInfo): void {
// 添加到最近打开的文件列表
RecentFilesService.addRecentFile({
filePath: locationInfo.filePath,
fileName: locationInfo.fileName,
storageType: locationInfo.storageType,
storageConfig: locationInfo.storageConfig
}).... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/DataService.ets#L79-L105 | 405f8651e62add4ab90bbd7e8f3b9ff97ba23ab5 | github |
Nekofox-POT/LinMusic | entry/src/main/ets/pages/Index.ets | arkts | onBackPress | 返回信号播控 // | onBackPress(): boolean {
// 末尾广播发送
try {
log(`当前占用表[${this.back_gesture}]`)
emitter.emit({ eventId: this.back_gesture[this.back_gesture.length - 1] })
return true
} catch {
return false
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onBackPress 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 boolean AST#boolean#Right AST#ERROR#Right AST#stateme... | onBackPress(): boolean {
// 末尾广播发送
try {
log(`当前占用表[${this.back_gesture}]`)
emitter.emit({ eventId: this.back_gesture[this.back_gesture.length - 1] })
return true
} catch {
return false
}
} | https://github.com/Nekofox-POT/LinMusic | 4935351fe7f1b4ec779fd2fda19d297ecc3aafd4 | github |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/pages/ContactManager.ets | arkts | clearAllContacts | 清空所有联系人(用于测试) | public async clearAllContacts(): Promise<OperationResult> {
try {
return await this.contactDao.clearAllContacts();
} catch (error) {
console.error('[ContactManager] 清空联系人失败:', error);
return { success: false, message: `清空失败: ${error.message || '未知错误'}` };
}
} | 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 clearAllContacts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST... | public async clearAllContacts(): Promise<OperationResult> {
try {
return await this.contactDao.clearAllContacts();
} catch (error) {
console.error('[ContactManager] 清空联系人失败:', error);
return { success: false, message: `清空失败: ${error.message || '未知错误'}` };
}
} | https://gitcode.com/openharmony/codelabs | 8e7c725608620741cba17753ca676db492691693 | gitcode |
silence17/harmonydemo | entry/src/main/ets/view/refresh/DialogUtils.ets | arkts | alertDialog | Alert dialog dialog | alertDialog(context: Context.UIAbilityContext) {
AlertDialog.show({
message: $r('app.string.alert_dialog_message'),
alignment: DialogAlignment.Bottom,
offset: {
dx: 0,
dy: -20
},
primaryButton: {
value: $r('app.string.cancel_button'),
action: () => {
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left alertDialog 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#Left AST#identifier#Left... | alertDialog(context: Context.UIAbilityContext) {
AlertDialog.show({
message: $r('app.string.alert_dialog_message'),
alignment: DialogAlignment.Bottom,
offset: {
dx: 0,
dy: -20
},
primaryButton: {
value: $r('app.string.cancel_button'),
action: () => {
... | https://github.com/silence17/harmonydemo | 9886768fc1c914535e73c63acd04bf15c0687a15 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/RDPPerformanceManager.ets | arkts | evictOldFrames | 清除过期帧 | private evictOldFrames(): void {
const now = Date.now()
const maxAge = 30 * 1000 // 30秒
for (const [id, frame] of this.cache.entries()) {
if (now - frame.timestamp > maxAge) {
this.cache.delete(id)
this.currentCacheSize -= frame.data.byteLength
}
}
// 如果还是太大,删... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left evictOldFrames 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#v... | private evictOldFrames(): void {
const now = Date.now()
const maxAge = 30 * 1000 // 30秒
for (const [id, frame] of this.cache.entries()) {
if (now - frame.timestamp > maxAge) {
this.cache.delete(id)
this.currentCacheSize -= frame.data.byteLength
}
}
// 如果还是太大,删... | https://github.com/AetheriumSimulator/qemu-hmos | 7abd35e577838f2f05bb3d83597660d120abc267 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | clearComicSourceCookies | @deprecated 请使用 clearComicSourceCookiesByPkg | async clearComicSourceCookies(sourceId: number): Promise<void> {
try {
const sql: string = `UPDATE comic_source SET cookies = '' WHERE id = ?`;
await this.databaseManager.executeSql(sql, [String(sourceId)]);
logger.info(TAG, `已清空图源Cookie(comic_source): sourceId=${sourceId}`);
} catch (error)... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left clearComicSourceCookies AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left ... | async clearComicSourceCookies(sourceId: number): Promise<void> {
try {
const sql: string = `UPDATE comic_source SET cookies = '' WHERE id = ?`;
await this.databaseManager.executeSql(sql, [String(sourceId)]);
logger.info(TAG, `已清空图源Cookie(comic_source): sourceId=${sourceId}`);
} catch (error)... | https://github.com/DaLongZhuaZi/manxia | 2f7c999814ed54061213bfbac52447427f38bd20 | github |
openharmony/applications_call | entry/src/main/ets/model/CallServiceProxy.ets | arkts | registerCallEventCallback | register call event callback | public registerCallEventCallback() {
call.on('callEventChange', (data) => {
if (!data) {
LogUtils.i(TAG, prefixLog + 'call.on callEventChange')
} else {
LogUtils.i(TAG, prefixLog + 'call.on callEventChange')
}
});
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left registerCallEventCallback 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 ... | public registerCallEventCallback() {
call.on('callEventChange', (data) => {
if (!data) {
LogUtils.i(TAG, prefixLog + 'call.on callEventChange')
} else {
LogUtils.i(TAG, prefixLog + 'call.on callEventChange')
}
});
} | https://gitee.com/openharmony/applications_call.git | 703347569ec764782d70f576f6edef227f04090b | gitee |
the-wwyang/kids-learning-app | src/main/ets/services/StatisticsService.ets | arkts | analyzeQuestionTypeStats | 分析题型统计数据
@param records 答题记录(需要包含题型和答案信息)
@returns 题型统计列表 | static analyzeQuestionTypeStats(records: Array<{
type: QuestionType;
isCorrect: boolean;
duration?: number;
}>): QuestionTypeStats[] {
const stats = new Map<QuestionType, {
total: number;
correct: number;
totalTime: number;
count: number;
}>();
// 统计各题型数据
for (co... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left analyzeQuestionTypeStats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left records AST#identifier#Right AST#ERROR#Left AST#:#Left : AS... | static analyzeQuestionTypeStats(records: Array<{
type: QuestionType;
isCorrect: boolean;
duration?: number;
}>): QuestionTypeStats[] {
const stats = new Map<QuestionType, {
total: number;
correct: number;
totalTime: number;
count: number;
}>();
// 统计各题型数据
for (co... | https://github.com/the-wwyang/kids-learning-app | 07d71e4820bc1fc68e60eebadb5017e02ac0c3f3 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.