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/Task/BackgroundTaskHelper.ets | arkts | startDataTransferTask | 申请 DATA_TRANSFER 后台长时任务
@param context UIAbility 上下文
@param owner 业务持有者标识,必须成对调用 start/stop | static async startDataTransferTask(
context: common.UIAbilityContext,
owner: string = DEFAULT_OWNER
): Promise<void> {
const normalizedOwner = BackgroundTaskHelper.normalizeOwner(owner);
if (BackgroundTaskHelper.activeOwners.has(normalizedOwner)) {
BackgroundTaskHelper.currentContext = context... | 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 startDataTransferTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:... | static async startDataTransferTask(
context: common.UIAbilityContext,
owner: string = DEFAULT_OWNER
): Promise<void> {
const normalizedOwner = BackgroundTaskHelper.normalizeOwner(owner);
if (BackgroundTaskHelper.activeOwners.has(normalizedOwner)) {
BackgroundTaskHelper.currentContext = context... | https://github.com/DaLongZhuaZi/manxia | 881204448525e17afe03b9d65cde8a612e5c1ec7 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/RegExp.ets | arkts | match | Searches the string for matches and returns all matches as an array.
@param { String } str The string to match.
@returns { RegExpMatchArray | null } If matches are found, returns an array containing all matches,
otherwise returns null.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public match(str: String): RegExpMatchArray | null {
if (!this.global) {
return this.matchInternal(str)
}
this.lastIndex = 0;
let matches = new containers.UndefinableStringArray();
let indices = new Array<Array<int>>();
let isUndefined = new Array<boolean>... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left match AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left str AST#identifi... | public match(str: String): RegExpMatchArray | null {
if (!this.global) {
return this.matchInternal(str)
}
this.lastIndex = 0;
let matches = new containers.UndefinableStringArray();
let indices = new Array<Array<int>>();
let isUndefined = new Array<boolean>... | https://gitcode.com/iop123123/arkts-static-skills | cd7623c98d5b7e0af92b4711b8aeef9421af2d74 | gitcode |
openharmony-sig/online_event | solution_student_challenge/基于OpenHarmony的OpenGit_潘骏翔/OpenGit/entry/src/main/ets/MainAbility/pages/main/component/RepoHistory.ets | arkts | build | 所在页面的viewModel对象 | build() {
Column() {
Row() {
//标题
Text($r("app.string.history"))
.align(Alignment.Start)
.fontColor($r("app.color.text_strong"))
//间隔
Blank()
//跳转查看全部历史记录的按钮
Image($r("app.media.icon_arrow_right"))
.height('100%')
.asp... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
Row() {
//标题
Text($r("app.string.history"))
.align(Alignment.Start)
.fontColor($r("app.color.text_strong"))
//间隔
Blank()
//跳转查看全部历史记录的按钮
Image($r("app.media.icon_arrow_right"))
.height('100%')
.asp... | https://gitee.com/openharmony-sig/online_event.git | 33f12892332a49b1eaa1173b0aea82f37b06bd23 | gitee |
Joker-x-dev/HarmonyKit | feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets | arkts | delete | 删除指定记录
@param {number} id - 记录主键
@returns {Promise<void>} Promise<void> | async delete(id: number): Promise<void> {
if (!id) {
return;
}
await this.runWithLoading(async (): Promise<void> => {
await this.demoRepository.deleteDemo(id);
if (this.editingId === id) {
this.resetInputs();
}
await this.fetchList();
});
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left delete AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left id AST#identifier#Right AST#type_annot... | async delete(id: number): Promise<void> {
if (!id) {
return;
}
await this.runWithLoading(async (): Promise<void> => {
await this.demoRepository.deleteDemo(id);
if (this.editingId === id) {
this.resetInputs();
}
await this.fetchList();
});
} | https://github.com/Joker-x-dev/HarmonyKit | d8405dbdc48d3d430d4946da56b72705d3e5e3a6 | github |
Explore-In-HMOS-Wearable/stack-game-with-unity-tuanjie | StackGameWithUnityDevEcoExport/tuanjieLib/src/main/ets/utils/WebviewUtils.ets | arkts | webviewInfos | Backing field for the static property | public static get webviewInfos(): WebviewInfo[] {
return AppStorage.get("webviewInfos") as WebviewInfo[]
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left webviewInfos AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right A... | public static get webviewInfos(): WebviewInfo[] {
return AppStorage.get("webviewInfos") as WebviewInfo[]
} | https://github.com/Explore-In-HMOS-Wearable/stack-game-with-unity-tuanjie | fcc9c64560f33ed3c4a3660cd8af55d9dbce0ae6 | github |
openharmony/applications_app_samples | code/BasicFeature/Native/NdkTsDrawing/entry/src/main/ets/pages/Index.ets | arkts | draw | 在RenderNode的draw中使用drawing自定义绘制 | async draw(context: DrawContext) {
const canvas = context.canvas;
let height_ = 600;
let width_ = 600;
let len = height_ / 4;
let aX = width_ / 3;
let aY = height_ / 6;
let dX = aX - len * Math.sin(18.0);
let dY = aY + len * Math.cos(18.0);
let cX = aX + len * Math.sin(18.0);
l... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left draw AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R... | async draw(context: DrawContext) {
const canvas = context.canvas;
let height_ = 600;
let width_ = 600;
let len = height_ / 4;
let aX = width_ / 3;
let aY = height_ / 6;
let dX = aX - len * Math.sin(18.0);
let dY = aY + len * Math.cos(18.0);
let cX = aX + len * Math.sin(18.0);
l... | https://github.com/openharmony/applications_app_samples | 4b0fee2aa13bd18718d1cd98a0ff2ff354323ead | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/PieChartModel.ets | arkts | setMinAngleForSlices | Set the angle to set minimum size for slices, you must call {@link #notifyDataSetChanged()}
and {@link #invalidate()} when changing this, only works if there is enough room for all
slices to have the minimum angle.
@param minAngle minimum 0, maximum is half of {@link #setMaxAngle(float)} | public setMinAngleForSlices(minAngle: number): void {
if (minAngle > (this.mMaxAngle / 2))
minAngle = this.mMaxAngle / 2;
else if (minAngle < 0)
minAngle = 0;
this.mMinAngleForSlices = minAngle;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setMinAngleForSlices AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left minAngle AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#... | public setMinAngleForSlices(minAngle: number): void {
if (minAngle > (this.mMaxAngle / 2))
minAngle = this.mMaxAngle / 2;
else if (minAngle < 0)
minAngle = 0;
this.mMinAngleForSlices = minAngle;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 1938cdf5916a68a17b4032513280099429df505b | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectInstanceMethod.ets | arkts | constructor | Private constructor, direct calls are prohibited.
@throws { Error } Throws when attempting to call this constructor. | private constructor() { throw new Error("InstanceMethod constructor called") } | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left constructor 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 ... | private constructor() { throw new Error("InstanceMethod constructor called") } | https://gitcode.com/iop123123/arkts-static-skills | 7bbb5dfdd27d8ca966ac0813d2e7f4e36cfe000f | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Components/PrivacyAuthDialogComponent.ets | arkts | onLoadSignalChanged | ==================== 生命周期 ==================== | onLoadSignalChanged(): void {
if (this.loadSignal > 0) {
this.openPrivacyAuthDialog(this.initialMode);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onLoadSignalChanged 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#statemen... | onLoadSignalChanged(): void {
if (this.loadSignal > 0) {
this.openPrivacyAuthDialog(this.initialMode);
}
} | https://github.com/DaLongZhuaZi/manxia | 20917d8e98d005e00571059a21617e663a44a894 | github |
751496032/ZRouter | RouterApi/src/main/ets/api/RouterMgr.ets | arkts | popToName | 关闭到指定名称页面
@param name
@param animated
@returns 页面在栈中的索引index | public popToName(name: string, animated: boolean = true): number {
if (this.configOptions?.isGlobalPopCallbackEnabled === true) {
return this.popToNameWithResult(name, undefined, animated)
}
return this.popToNameInternal(name, undefined, animated)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left popToName 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#Left string... | public popToName(name: string, animated: boolean = true): number {
if (this.configOptions?.isGlobalPopCallbackEnabled === true) {
return this.popToNameWithResult(name, undefined, animated)
}
return this.popToNameInternal(name, undefined, animated)
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/RouterMgr.ets#L420-L425 | 75044153f50e9d6c3a72c3194fe7da1527822a05 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/ARNavigationService.ets | arkts | updateCurrentWaypointIndex | 更新当前途经点索引 | private updateCurrentWaypointIndex(currentPosition: Position3D): void {
if (!this.navigationState.currentPath) return;
const waypoints = this.navigationState.currentPath.waypoints;
let minDistance = Infinity;
let nearestIndex = this.navigationState.currentWaypointIndex;
// 查找最近的途经点
for (let ... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateCurrentWaypointIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left currentPosition AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identif... | private updateCurrentWaypointIndex(currentPosition: Position3D): void {
if (!this.navigationState.currentPath) return;
const waypoints = this.navigationState.currentPath.waypoints;
let minDistance = Infinity;
let nearestIndex = this.navigationState.currentWaypointIndex;
// 查找最近的途经点
for (let ... | https://github.com/LJ666-ui/harmony-health-care | e63a93e50a7b8f781b8122c7736776becfd0453b | github |
openharmony/codelabs | ETSUI/PassNote/entry/src/main/ets/pages/PasswordEntry.ets | arkts | navigateToAuth | 跳转到对应认证页面 | navigateToAuth(type: PassType) {
// ====== 指纹入口统一拦截 =====
if (type === PassType.FINGERPRINT) {
const enabled = PasswordManager.isFingerprintEnabled()
if (!enabled) {
// 被禁用:不给进
promptAction.showToast({
message: '指纹识别已禁用,请使用其他认证方式'
})
return
}
}... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left navigateToAuth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left PassType AST#identifier#Ri... | navigateToAuth(type: PassType) {
// ====== 指纹入口统一拦截 =====
if (type === PassType.FINGERPRINT) {
const enabled = PasswordManager.isFingerprintEnabled()
if (!enabled) {
// 被禁用:不给进
promptAction.showToast({
message: '指纹识别已禁用,请使用其他认证方式'
})
return
}
}... | https://gitcode.com/openharmony/codelabs | 799613164c2d4e8698fb8009e2d97900e2ee3f58 | gitcode |
Countly/countly-sdk-hos | library/src/main/ets/internal/Storage.ets | arkts | clear | Wipe every persisted SDK entry, device ID, request queue, server config,
health-check counters, user-profile cache, remote-config cache, etc.
Invoked by `CountlyInstance.halt()` (the data-wiping variant) and by
`Countly.haltAll()`. The non-wiping `stop()` path does NOT call this.
Returns true on a successful flush; fal... | public async clear(): Promise<boolean> {
if (!this.prefs) return false;
try {
await this.prefs.clear();
await this.prefs.flush();
return true;
} catch (err) {
this.logger.e(`[Storage] clear, failed: ${err}`);
return false;
}
} | 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 clear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : A... | public async clear(): Promise<boolean> {
if (!this.prefs) return false;
try {
await this.prefs.clear();
await this.prefs.flush();
return true;
} catch (err) {
this.logger.e(`[Storage] clear, failed: ${err}`);
return false;
}
} | https://github.com/Countly/countly-sdk-hos | b8a04d27b985a9769eab5dab486dbe1cd9567c67 | github |
openharmony-sig/ohos_subsampling_scale_image_view | library/src/main/ets/components/MainPage/SubsamplingScaleImageView.ets | arkts | setPanLimit | Set the pan limiting style. See static fields. Normally {@link #PAN_LIMIT_INSIDE} is best, for image galleries.
@param panLimit a pan limit constant. See static fields. | public setPanLimit(panLimit: number): Model {
if (panLimit != this.PAN_LIMIT_INSIDE || panLimit != this.PAN_LIMIT_OUTSIDE || panLimit != this.PAN_LIMIT_CENTER) {
console.error("Invalid pan limit: " + panLimit)
}
this.panLimit = panLimit;
return this;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setPanLimit AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left panLimit AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Ri... | public setPanLimit(panLimit: number): Model {
if (panLimit != this.PAN_LIMIT_INSIDE || panLimit != this.PAN_LIMIT_OUTSIDE || panLimit != this.PAN_LIMIT_CENTER) {
console.error("Invalid pan limit: " + panLimit)
}
this.panLimit = panLimit;
return this;
} | https://gitee.com/openharmony-sig/ohos_subsampling_scale_image_view.git | 55e21b558351f8e973a0cbf509104ced6b41c46f | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/DynamicUrlResolver.ets | arkts | resolveUrls | 批量解析URL | resolveUrls(templates: string[], config: UrlResolverConfig): string[] {
return templates.map(template => this.resolveUrl(template, config));
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left resolveUrls AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left templates AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#stri... | resolveUrls(templates: string[], config: UrlResolverConfig): string[] {
return templates.map(template => this.resolveUrl(template, config));
} | https://github.com/DaLongZhuaZi/manxia | 2c0e7205b98d28d34bd12b44ee31ff02174d42a5 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test19_original_index.ets | arkts | testNumberFormatting | --- Number toFixed chaining --- | function testNumberFormatting(): string {
let n: number = 3.14159;
let fixed2: string = n.toFixed(2);
let fixed4: string = n.toFixed(4);
return fixed2 + '|' + fixed4;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testNumberFormatting 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#predef... | function testNumberFormatting(): string {
let n: number = 3.14159;
let fixed2: string = n.toFixed(2);
let fixed4: string = n.toFixed(4);
return fixed2 + '|' + fixed4;
} | https://github.com/miaochiahao/ark-ghidra | 86a77a2a5dfb11792597bcbf1ffbcf9d3f71a4b0 | github |
CLMC2025/Vignette | entry/src/main/ets/vocabulary/SnowballSystem.ets | arkts | selectSupportWords | 选择支持词汇 | private async selectSupportWords(
targetWord: string,
associationStrength: number,
maxCount: number
): Promise<string[]> {
// 获取已掌握的词汇 (Review/Relearning)
const reviewWords = this.vocabularyTracker.getReviewWords();
const learningWords = this.vocabularyTracker.getLearningWords();
// 合并所... | 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 selectSupportWords AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left targetWord AST#identifier#Right AST#ERROR#Left AS... | private async selectSupportWords(
targetWord: string,
associationStrength: number,
maxCount: number
): Promise<string[]> {
// 获取已掌握的词汇 (Review/Relearning)
const reviewWords = this.vocabularyTracker.getReviewWords();
const learningWords = this.vocabularyTracker.getLearningWords();
// 合并所... | https://github.com/CLMC2025/Vignette | 6ec7bc91190e8d03a265dfe835f1d66a046cc520 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/libs/htmlparser/HTMLElement.ets | arkts | text | 获取纯文本内容 | get text(): string {
return this.textContent.trim();
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left text 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 text(): string {
return this.textContent.trim();
} | https://github.com/DaLongZhuaZi/manxia | b548fba18189319940994527cf9394476b745698 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoJsEngine.ets | arkts | simpleEval | 简单表达式求值 | private simpleEval(expr: string): string {
// 只处理字符串拼接
const parts = expr.split('+').map(p => p.trim());
let result = '';
for (const part of parts) {
if (part.startsWith('"') && part.endsWith('"')) {
result += part.slice(1, -1);
} else if (part.startsWith("'") && part.endsWith... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left simpleEval AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left expr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left st... | private simpleEval(expr: string): string {
// 只处理字符串拼接
const parts = expr.split('+').map(p => p.trim());
let result = '';
for (const part of parts) {
if (part.startsWith('"') && part.endsWith('"')) {
result += part.slice(1, -1);
} else if (part.startsWith("'") && part.endsWith... | https://github.com/DaLongZhuaZi/manxia | 0a687747fc0a09288d8494b1df4db501fa768779 | github |
openharmony-sig/online_event | solution_student_challenge/基于OpenHarmony的OpenGit_潘骏翔/OpenGit/entry/src/main/ets/MainAbility/pages/common/component/RepoItem.ets | arkts | build | 该仓库的model对象 | build() {
Column() {
Row() {
//仓库类型图标
Image(this.getImg())
.height(24)
.width(24)
//仓库名
Text(this.repo.repoName)
.fontSize(24)
.fontColor($r("app.color.text_ultrastrong"))
.margin({ left: 8 })
.layoutWeight(1)
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
Row() {
//仓库类型图标
Image(this.getImg())
.height(24)
.width(24)
//仓库名
Text(this.repo.repoName)
.fontSize(24)
.fontColor($r("app.color.text_ultrastrong"))
.margin({ left: 8 })
.layoutWeight(1)
... | https://gitee.com/openharmony-sig/online_event.git | 33a6b6219b46ef6ca95a9c27e715f30d7e9183d1 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/UnifiedOperationInterface.ets | arkts | executeConfigurationOperation | 执行配置操作 | private async executeConfigurationOperation(action: string, data?: OperationBusinessData): Promise<ExecuteOperationResult> {
if (action === 'parse') {
if (data && Object.keys(data).includes('type') && Object.keys(data).includes('content')) {
const configData = data as ConfigurationOperationData;
... | 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 executeConfigurationOperation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#R... | private async executeConfigurationOperation(action: string, data?: OperationBusinessData): Promise<ExecuteOperationResult> {
if (action === 'parse') {
if (data && Object.keys(data).includes('type') && Object.keys(data).includes('content')) {
const configData = data as ConfigurationOperationData;
... | https://github.com/DaLongZhuaZi/manxia | dae220a1f135d495aa894ae86ce060606a84e099 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/FavoriteModelsService.ets | arkts | load | 加载收藏列表 | async load(): Promise<void> {
if (this.isLoaded) {
return
}
try {
const jsonStr = await this.preferencesService.getString(FAVORITE_MODELS_KEY, '[]')
const parsed = JSON.parse(jsonStr) as FavoriteModel[]
this.favoriteModels = parsed
this.isLoaded = true
} catch (error) {
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left load 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... | async load(): Promise<void> {
if (this.isLoaded) {
return
}
try {
const jsonStr = await this.preferencesService.getString(FAVORITE_MODELS_KEY, '[]')
const parsed = JSON.parse(jsonStr) as FavoriteModel[]
this.favoriteModels = parsed
this.isLoaded = true
} catch (error) {
... | https://github.com/LongLiveY96/chatcube | 59c9c233661703ddfbf9921729aacdaa70c35bbd | github |
apap6628114/nga_oh | entry/src/main/ets/service/api/AuthApi.ets | arkts | generateLoginToken | 生成 32 位十六进制登录令牌 | function generateLoginToken(): string {
const chars = '0123456789abcdef';
let result = '';
for (let i = 0; i < 32; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
return result;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left generateLoginToken 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#predefin... | function generateLoginToken(): string {
const chars = '0123456789abcdef';
let result = '';
for (let i = 0; i < 32; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
return result;
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/service/api/AuthApi.ets#L182-L189 | 398addd9f518f3ef7bcaaf007be1ffaf3bc3e685 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Short.ets | arkts | div | Performs shortegral division of this instance with provided one, returns the result as new instance
@param { Short } other Right hand side of the division
@returns { Short } Result of the division
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public div(other: Short): Short {
return new Short((this.value / other.toShort()).toShort())
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left div AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO... | public div(other: Short): Short {
return new Short((this.value / other.toShort()).toShort())
} | https://gitcode.com/iop123123/arkts-static-skills | 33c499fcebcff0bd3c5bd68a6f95a98b7c78b4de | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ets | arkts | isWeakMap | Check whether the entered value is of type weakmap.
@param { Object } value - A WeakMap value
@returns { boolean } Returns true if the value is a built-in WeakMap instance. | isWeakMap(value: Object): boolean {
return value instanceof WeakMap;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isWeakMap 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 Object AST#identifier#Right AST#)#Left ) AST#... | isWeakMap(value: Object): boolean {
return value instanceof WeakMap;
} | https://gitcode.com/iop123123/arkts-static-skills | 2ee4d76e3649bc429f638058e0e1ebdbdb649514 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Source/SuwayomiSource.ets | arkts | resolveSuwayomiUrl | 将 Suwayomi 返回的图片/页面 URL 转为可请求的绝对地址 | private resolveSuwayomiUrl(rawUrl: string): string {
const url = (rawUrl || '').trim();
if (!url) {
return '';
}
// 已是完整 URL(http/https 或其他 scheme)
if (url.includes('://') || url.startsWith('data:') || url.startsWith('file:')) {
return url;
}
const serverUrl = this.getNormali... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left resolveSuwayomiUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rawUrl AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi... | private resolveSuwayomiUrl(rawUrl: string): string {
const url = (rawUrl || '').trim();
if (!url) {
return '';
}
// 已是完整 URL(http/https 或其他 scheme)
if (url.includes('://') || url.startsWith('data:') || url.startsWith('file:')) {
return url;
}
const serverUrl = this.getNormali... | https://github.com/DaLongZhuaZi/manxia | 6e650d09825643417ff25076e93a46e7c0b43fab | github |
ibestservices/ibest-ui | library/src/main/ets/components/dateTimePicker/index.ets | arkts | getHoursList | 获取小时列表 | getHoursList(): IBestPickerOption[] {
let hoursList: IBestPickerOption[] = []
let year = this.getValue("year")
let month = this.getValue("month")
let day = this.getValue("day")
let min = this.isMinYear(year) && this.isMinMonth(month) && this.isMinDay(day) ? this.minDate.getHours() : 0
let max = this.isMaxY... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getHoursList 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 IBestPickerOption AST#identifier#Right AST#[#Left... | getHoursList(): IBestPickerOption[] {
let hoursList: IBestPickerOption[] = []
let year = this.getValue("year")
let month = this.getValue("month")
let day = this.getValue("day")
let min = this.isMinYear(year) && this.isMinMonth(month) && this.isMinDay(day) ? this.minDate.getHours() : 0
let max = this.isMaxY... | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/dateTimePicker/index.ets#L246-L260 | 4995e40b2eb4af347e64ad4044bb654319119db5 | github |
YDYm233/EasyRandom_HarmonyNextApp | common/SystemUtils/src/main/ets/utils/VibratorManager.ets | arkts | vibrateSuccess | ═══════════════════════════════════════════════════════════════
场景语义快捷法
═══════════════════════════════════════════════════════════════
成功反馈 — 两次短振 | static vibrateSuccess(): void {
VibratorManager.logExecution('vibrateSuccess');
VibratorManager.vibratePreset(HapticEffect.SOFT, 2, 100, VibrationUsage.TOUCH);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left vibrateSuccess 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#express... | static vibrateSuccess(): void {
VibratorManager.logExecution('vibrateSuccess');
VibratorManager.vibratePreset(HapticEffect.SOFT, 2, 100, VibrationUsage.TOUCH);
} | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | 1e2b66ca3bccc88c13b75a33386133d74c87e8da | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/ComponentBase.ets | arkts | isEnabled | Returns true if this component is enabled (should be drawn), false if not.
@return | public isEnabled(): boolean {
return this.mEnabled;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isEnabled 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#boo... | public isEnabled(): boolean {
return this.mEnabled;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | f61c49140471e99aae7eeb7bbb005bea512c17e2 | gitee |
openharmony-tpc/ImageKnife | library/src/main/ets/ImageKnife.ets | arkts | setCustomGetImage | 全局设置自定义下载
@param customGetImage 自定义请求函数 | setCustomGetImage(customGetImage?: (context: Context, src: string | PixelMap | Resource,headers?: Record<string,Object>) => Promise<ArrayBuffer | undefined>) {
this.customGetImage = customGetImage
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setCustomGetImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left customGetImage AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Rig... | setCustomGetImage(customGetImage?: (context: Context, src: string | PixelMap | Resource,headers?: Record<string,Object>) => Promise<ArrayBuffer | undefined>) {
this.customGetImage = customGetImage
} | https://gitee.com/openharmony-tpc/ImageKnife.git | fc37843b3d2d5cb194d0ba03f2220c624dc7a2b0 | gitee |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/TemplateBuilder.ets | arkts | withUsername | 设置用户名 | withUsername(username: string): TemplateBuilder {
this.entry.fields.set('UserName', username);
return this;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left withUsername AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#)#... | withUsername(username: string): TemplateBuilder {
this.entry.fields.set('UserName', username);
return this;
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateBuilder.ets#L56-L59 | 1c3f43a8b124b5caa58fa1d21cfe15c4828d76dd | github |
openharmony/app_samples | ETSUI/Game2048/entry/src/main/ets/MainAbility/pages/Game2048.ets | arkts | dataView | dataView | dataView() {
this.dataNumbers = this.gameRule.dataNumbers
this.gameStatus = this.gameRule.status
this.curScore = this.gameRule.score
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left dataView AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AS... | dataView() {
this.dataNumbers = this.gameRule.dataNumbers
this.gameStatus = this.gameRule.status
this.curScore = this.gameRule.score
} | https://gitee.com/openharmony/app_samples.git | ea2b4505dc8ff0c913550e74cf73d9da8f8918e7 | gitee |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/TemplateFactory.ets | arkts | createEntry | 根据模板创建新条目
@param template 模板对象
@param parentGroup 目标分组
@param options 应用选项
@returns 创建的条目 | createEntry(template: ITemplate, parentGroup: KdbxGroup, options?: TemplateApplyOptions): KdbxEntry {
const opts: TemplateApplyOptions = {
overwriteExisting: options?.overwriteExisting ?? DEFAULT_APPLY_OPTIONS.overwriteExisting,
copyTags: options?.copyTags ?? DEFAULT_APPLY_OPTIONS.copyTags,
copy... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left createEntry AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left template AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ITemplate AST#identifier#Right AST#,#Lef... | createEntry(template: ITemplate, parentGroup: KdbxGroup, options?: TemplateApplyOptions): KdbxEntry {
const opts: TemplateApplyOptions = {
overwriteExisting: options?.overwriteExisting ?? DEFAULT_APPLY_OPTIONS.overwriteExisting,
copyTags: options?.copyTags ?? DEFAULT_APPLY_OPTIONS.copyTags,
copy... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateFactory.ets#L71-L100 | b0ac339491f8a0b68e4966aaa7915be80136de15 | github |
openharmony-tpc/VCard | library/src/main/ets/components/utils/PhoneNumberUtils.ets | arkts | isStartsPostDial | This any anything to the right of this char is part of the
post-dial string (eg this is PAUSE or WAIT) | public static isStartsPostDial (c:string):boolean {
return c == PhoneNumberUtils.PAUSE || c == PhoneNumberUtils.WAIT;
} | 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 isStartsPostDial AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left c AST#identifier#Right AST#:#Left : AS... | public static isStartsPostDial (c:string):boolean {
return c == PhoneNumberUtils.PAUSE || c == PhoneNumberUtils.WAIT;
} | https://gitee.com/openharmony-tpc/VCard.git | 7763f23776ef4a8dccaa83ee2f6978f2fe21f085 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | constructor | Creates an BigInt64Array with respect to length.
@param length data initializer | public constructor(length: int) {
this.length = length
this.byteLength = length * BigInt64Array.BYTES_PER_ELEMENT
this.byteOffset = 0
this.buffer = new ArrayBuffer(this.byteLength)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left length AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier... | public constructor(length: int) {
this.length = length
this.byteLength = length * BigInt64Array.BYTES_PER_ELEMENT
this.byteOffset = 0
this.buffer = new ArrayBuffer(this.byteLength)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | bd8349a0fa5ccbec23e0b0d54ba16398a5b5b6a8 | gitee |
Octo-o-o-o/harmonyos-ai-workspace | tools/hooks/test-fixtures/BadSecurityKit.ets | arkts | buildGcmOptions | CSPRNG-002: HUKS AES-GCM nonce 用硬编码数组而非 cryptoFramework(反模式) | buildGcmOptions(): huks.HuksOptions {
const nonce = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); // 非 CSPRNG
return {
properties: [
{ tag: huks.HuksTag.HUKS_TAG_NONCE, value: nonce },
],
inData: new Uint8Array(0),
};
} | AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left buildGcmOptions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ident... | buildGcmOptions(): huks.HuksOptions {
const nonce = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); // 非 CSPRNG
return {
properties: [
{ tag: huks.HuksTag.HUKS_TAG_NONCE, value: nonce },
],
inData: new Uint8Array(0),
};
} | https://github.com/Octo-o-o-o/harmonyos-ai-workspace | 5566664541dcb347354c6d6850e8fe1ede26ddb6 | github |
openharmony/arkui_ace_engine | advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.TreeView.ets | arkts | getClickChildId | get child node ids by node id
@param nodeId node id
@returns child node ids | public getClickChildId(nodeId: number): number[] {
let parent: NodeItem = new NodeItem(emptyNodeInfo);
if (this.nodeIdNodeItemMap.has(nodeId)) {
parent = this.nodeIdNodeItemMap.get(nodeId) as NodeItem;
}
if (parent) {
if (parent.children.length === 0) {
return [];
} else if (... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getClickChildId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left nodeId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | public getClickChildId(nodeId: number): number[] {
let parent: NodeItem = new NodeItem(emptyNodeInfo);
if (this.nodeIdNodeItemMap.has(nodeId)) {
parent = this.nodeIdNodeItemMap.get(nodeId) as NodeItem;
}
if (parent) {
if (parent.children.length === 0) {
return [];
} else if (... | https://gitcode.com/openharmony/arkui_ace_engine | 4bfc84bb6749aed7bbfee8826273321217177840 | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.PlainArray.ets | arkts | getIndexOfValue | Gets the first occurrence of the index for the value element
@param value the value of the element to get the index of
@returns the index of the value, or -1 if the value is not found | public getIndexOfValue(value: T): int {
return this.buckets.getIndexOfValue(value).toInt();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getIndexOfValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifie... | public getIndexOfValue(value: T): int {
return this.buckets.getIndexOfValue(value).toInt();
} | https://gitcode.com/iop123123/arkts-static-skills | 0a8e65de6df2ce2e6e2e62e7fa869754371a7afc | gitcode |
yanglfree/CopoHub-Multi | flutter/ohos/entry/src/main/ets/plugins/IapPlugin.ets | arkts | finishPurchase | ── finishPurchase ─────────────────────────────────────────────────────────── | private async finishPurchase(call: MethodCall, result: MethodResult): Promise<void> {
const context = this.context;
if (!context) {
result.success(null);
return;
}
try {
const productTypeStr = call.argument('productType') as string;
const purchaseToken = (call.argument('purcha... | 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 finishPurchase AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left call AST#identifier#Right AST#:#Left :... | private async finishPurchase(call: MethodCall, result: MethodResult): Promise<void> {
const context = this.context;
if (!context) {
result.success(null);
return;
}
try {
const productTypeStr = call.argument('productType') as string;
const purchaseToken = (call.argument('purcha... | https://github.com/yanglfree/CopoHub-Multi | 07a48f122f5a9b21da13b48735aa2e51d5d73c8b | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/oauth2/BaseOAuth2Provider.ets | arkts | extractOptionalStringFromObject | 从对象中提取可选字符串值
@param obj 对象
@param key 键
@return string | undefined 字符串值 | protected extractOptionalStringFromObject(obj: Record<string, Object>, key: string): string | undefined {
const value = obj[key];
if (value === undefined || value === null) {
return undefined;
}
return String(value);
} | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left extractOptionalStringFromObject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Ri... | protected extractOptionalStringFromObject(obj: Record<string, Object>, key: string): string | undefined {
const value = obj[key];
if (value === undefined || value === null) {
return undefined;
}
return String(value);
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/oauth2/BaseOAuth2Provider.ets#L328-L334 | 8946edb4c3a2c1222ab7c496fca6c07654dc8439 | github |
openharmony/codelabs | Media/SimpleVideo/entry/src/main/ets/view/VideoPlaySlider.ets | arkts | sliderOnchange | video slider component onchange callback | sliderOnchange(value: number, mode: SliderChangeMode) {
this.currentTime = Number.parseInt(value.toString());
this.controller.setCurrentTime(Number.parseInt(value.toString()), SeekMode.Accurate);
if (mode === SliderChangeMode.Begin || mode === SliderChangeMode.Moving) {
this.isOpacity = false;
}... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left sliderOnchange 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 number AST#identifier#Rig... | sliderOnchange(value: number, mode: SliderChangeMode) {
this.currentTime = Number.parseInt(value.toString());
this.controller.setCurrentTime(Number.parseInt(value.toString()), SeekMode.Accurate);
if (mode === SliderChangeMode.Begin || mode === SliderChangeMode.Moving) {
this.isOpacity = false;
}... | https://gitee.com/openharmony/codelabs.git | 63057c0a85e33f8a1870837a138d40a33b7764cb | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Source/SuwayomiCacheManager.ets | arkts | cacheCover | 缓存封面图片
@param mangaId 漫画ID
@param coverUrl 封面URL
@param headers 请求头(用于认证)
@returns 缓存后的本地路径,失败返回null | public async cacheCover(
mangaId: string,
coverUrl: string,
headers?: Record<string, string>
): Promise<string | null> {
try {
// 检查是否已缓存
const existingPath = this.getCachedCoverPath(mangaId, coverUrl);
if (existingPath) {
logger.debug(TAG, `封面已缓存: ${mangaId}`);
ret... | 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 cacheCover AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left mangaId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST... | public async cacheCover(
mangaId: string,
coverUrl: string,
headers?: Record<string, string>
): Promise<string | null> {
try {
// 检查是否已缓存
const existingPath = this.getCachedCoverPath(mangaId, coverUrl);
if (existingPath) {
logger.debug(TAG, `封面已缓存: ${mangaId}`);
ret... | https://github.com/DaLongZhuaZi/manxia | 5e6cad4dad93423dad3b02be56558fdb9ef30b8f | github |
qiuhaotc/HarmonyOSPlayground | entry/src/main/ets/utils/BillStatisticsUtil.ets | arkts | groupByYearMonth | 按年月分组统计 | static groupByYearMonth(bills: BillModel[]): Map<string, BillModel[]> {
const grouped = new Map<string, BillModel[]>();
bills.forEach((bill) => {
const yearMonth = bill.getYearMonth();
if (!grouped.has(yearMonth)) {
grouped.set(yearMonth, []);
}
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left groupByYearMonth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bills AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expr... | static groupByYearMonth(bills: BillModel[]): Map<string, BillModel[]> {
const grouped = new Map<string, BillModel[]>();
bills.forEach((bill) => {
const yearMonth = bill.getYearMonth();
if (!grouped.has(yearMonth)) {
grouped.set(yearMonth, []);
}
... | https://github.com/qiuhaotc/HarmonyOSPlayground | a96ea1176c48512f242852c41a60f49bf6b577c6 | github |
Xiwei753/xiezuoruanjian | apps/harmony/entry/src/main/ets/bridge/MockWriterCoreBridge.ets | arkts | listStarMaps | StarMap methods | async listStarMaps(): Promise<ResultEnvelope<StarMapMeta[]>> {
await this.delay(100)
return this.success(this.mockStarMaps)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left listStarMaps 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 AST#generic... | async listStarMaps(): Promise<ResultEnvelope<StarMapMeta[]>> {
await this.delay(100)
return this.success(this.mockStarMaps)
} | https://github.com/Xiwei753/xiezuoruanjian | 05f67cd95f9b7a8f7b67731ce17e78478e403ef8 | github |
HarmonyOS_Samples/BestPracticeSnippets | TaskPoolPractice/entry/src/main/ets/pages/sample1/Sample1.ets | arkts | correctConcurrentFunc | [End wrong]
[Start sample_fun]
Sample1.ets | @Concurrent
function correctConcurrentFunc() {
let foo: Foo = new Foo;
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Concurrent AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left correctConcurrentFunc AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Ri... | @Concurrent
function correctConcurrentFunc() {
let foo: Foo = new Foo;
} | https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets | 46c4ef727d4035b6bff9d989b8c1f39589c1273a | gitcode |
apap6628114/nga_oh | entry/src/main/ets/parser/bbcode/parser.ets | arkts | parseBBCode | 编排层:parseBBCode 公共入口、parseBlockNodes 块级循环、tryMatchBlock 标签族分发,
以及表格/列表的结构化辅助解析。按原 tryMatchBlock 的 if 顺序依次调用各块级 handler。
公共入口:预处理后从顶层解析块级节点。 | function parseBBCode(content: string): BBNode[] {
if (!content) return []
const state = new ParseState()
state.content = preprocessContent(content)
state.pos = 0
state.len = state.content.length
return parseBlockNodes(state, null)
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left parseBBCode AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left content AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R... | function parseBBCode(content: string): BBNode[] {
if (!content) return []
const state = new ParseState()
state.content = preprocessContent(content)
state.pos = 0
state.len = state.content.length
return parseBlockNodes(state, null)
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/parser/bbcode/parser.ets#L31-L38 | 4f421794324441ee64f8f27cd0f3f89e2920637b | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Error.ets | arkts | constructor | Constructs a new empty error instance | constructor () {
this.message = "";
this.cause = this;
this.name = "Error";
this.fileName = "";
this.lineNumber = 0;
this.columnNumber = 0;
this.provisionStackTrace();
} | 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#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A... | constructor () {
this.message = "";
this.cause = this;
this.name = "Error";
this.fileName = "";
this.lineNumber = 0;
this.columnNumber = 0;
this.provisionStackTrace();
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 55a0c3d8b771a759aeda8f75e880a7654c9cd11e | gitee |
CPF-ApplicationTPC/imageknifepro | library/src/main/ets/ImageKnife.ets | arkts | setJpegOptimizeDecoding | 设置默认解码是否使用优化jpeg图片解码
没有调用时,默认不启用
设置为true后,图片会优化Jpeg解码,以减小解码后的图片内存占用
如果Jpeg图片设置了图形变换,则不会应用该解码优化,仍然使用默认的解码方式
启用后,GetCacheImage接口可能获取到非RGBA像素的格式的pixelmap
@param enable 是否开启jpeg解码优化 | setJpegOptimizeDecoding(enable: boolean) {
nativeNode.setJpegOptimizeDecoding(enable);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setJpegOptimizeDecoding AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enable AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#ide... | setJpegOptimizeDecoding(enable: boolean) {
nativeNode.setJpegOptimizeDecoding(enable);
} | https://gitcode.com/CPF-ApplicationTPC/imageknifepro/blob/5b2c39b2925d2e6c4a267ce62edc340b3150dcb9/library/src/main/ets/ImageKnife.ets#L346-L348 | e11a51d5baaa7b990daa6a90b7b446a6ae41122b | gitcode |
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | getSplitWriteNum | Get operate split Write Num
@return | public getSplitWriteNum(): number {
return this.splitWriteNum;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getSplitWriteNum 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 AS... | public getSplitWriteNum(): number {
return this.splitWriteNum;
} | https://gitee.com/openharmony-sig/FastBle.git | 68735d2bd4d39e326f66eb144675dc1830afa849 | gitee |
richshaw2015/nds | ohos/entry/src/main/ets/types/MelonDSNative.ets | arkts | bootFirmware | ============================================================================
固件启动
============================================================================ | static bootFirmware(): boolean {
return MelonDSNative.native.bootFirmware();
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left bootFirmware 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#... | static bootFirmware(): boolean {
return MelonDSNative.native.bootFirmware();
} | https://github.com/richshaw2015/nds | d66785359ab00b59ceb37f773d720669c7734b43 | github |
arkui-x/samples | CodeLab/Cases/feature/calendarswitch/src/main/ets/customcalendar/utils/TimeUtils.ets | arkts | byMonthDayForYear | 获取某年某月的所有日期
@param year
@param month
@returns | static byMonthDayForYear(year: number, month: number): Day[][] {
const FIRST_DAY_OF_WEEK = TimeUtils.getWeekDay(year, month, 1);
const PREVIOUS_MONTH_DAYS = TimeUtils.getPreviousMonthLastDays(year, month, FIRST_DAY_OF_WEEK);
const CURRENT_MONTH_DAYS = TimeUtils.getCurrentMonthDays(year, month);
const ... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left byMonthDayForYear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left year AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | static byMonthDayForYear(year: number, month: number): Day[][] {
const FIRST_DAY_OF_WEEK = TimeUtils.getWeekDay(year, month, 1);
const PREVIOUS_MONTH_DAYS = TimeUtils.getPreviousMonthLastDays(year, month, FIRST_DAY_OF_WEEK);
const CURRENT_MONTH_DAYS = TimeUtils.getCurrentMonthDays(year, month);
const ... | https://gitcode.com/arkui-x/samples | 23850a192417d8a4b169e681ac8c3cd079f291ab | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Source/SourceManager.ets | arkts | getEnabledSources | 获取启用的图源(包含置顶状态) | async getEnabledSources(): Promise<SourceInfo[]> {
try {
const sources = await this.dataManager.getEnabledComicSources();
const pinnedIds = await this.dataManager.getSourcePinnedList();
return sources.map((source: ESObject) => {
const info = this.mapToSourceInfo(source);
i... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getEnabledSources 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 AST#ge... | async getEnabledSources(): Promise<SourceInfo[]> {
try {
const sources = await this.dataManager.getEnabledComicSources();
const pinnedIds = await this.dataManager.getSourcePinnedList();
return sources.map((source: ESObject) => {
const info = this.mapToSourceInfo(source);
i... | https://github.com/DaLongZhuaZi/manxia | 14c7b5303e6c63f2407a7075f775a8218b1f4402 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/AxisBase.ets | arkts | resetAxisMinimum | By calling this method, any custom minimum value that has been previously set is reset,
and the calculation is
done automatically. | public resetAxisMinimum(): void {
this.mCustomAxisMin = false;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left resetAxisMinimum 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#expre... | public resetAxisMinimum(): void {
this.mCustomAxisMin = false;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 5c6a70c126867dcf2cb591e0eaed9f43affb583e | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/TypeShelfManager.ets | arkts | moveItemsToShelf | 批量移动内容到书架 | async moveItemsToShelf(items: MoveToShelfItemInfo[], shelfId: string): Promise<void> {
const shelf = this.getShelf(shelfId);
if (!shelf) {
logger.warn(TAG, `书架不存在: ${shelfId}`);
return;
}
for (const item of items) {
const shelfContentType = this.contentTypeToShelfContentType(ite... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left moveItemsToShelf AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left items AST#identifier#Right AST#type_annotation#Left AST#:#Left... | async moveItemsToShelf(items: MoveToShelfItemInfo[], shelfId: string): Promise<void> {
const shelf = this.getShelf(shelfId);
if (!shelf) {
logger.warn(TAG, `书架不存在: ${shelfId}`);
return;
}
for (const item of items) {
const shelfContentType = this.contentTypeToShelfContentType(ite... | https://github.com/DaLongZhuaZi/manxia | 0c0027a0de7ca2e968f012cadb1cab53be0d64b2 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Utils/CompressionUtils.ets | arkts | countImagesInDirectory | 统计目录中的图片数量 | private async countImagesInDirectory(directory: string): Promise<number> {
try {
const files = await this.sandboxManager.listDirectory(directory);
let count = 0;
for (const fileName of files) {
const extension = this.getFileExtension(fileName).toLowerCase();
if (['.jpg', '.jpeg'... | 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 countImagesInDirectory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left directory AST#identifier#Right AST#ERROR#Left... | private async countImagesInDirectory(directory: string): Promise<number> {
try {
const files = await this.sandboxManager.listDirectory(directory);
let count = 0;
for (const fileName of files) {
const extension = this.getFileExtension(fileName).toLowerCase();
if (['.jpg', '.jpeg'... | https://github.com/DaLongZhuaZi/manxia | 3fce41e22067f42b9cb0a4957d4a10185d34790a | github |
openharmony/codelabs | ETSUI/ECommerce/entry/src/main/ets/utils/RdbUtil.ets | arkts | getAllProducts | 获取所有商品 | static async getAllProducts(): Promise<Product[]> {
let products: Product[] = [];
const store = await RdbUtil.getStore();
if (store) {
try {
let predicates = new relationalStore.RdbPredicates(Constants.TABLE_PRODUCT);
let resultSet = await store.query(predicates);
while (res... | 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 getAllProducts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:... | static async getAllProducts(): Promise<Product[]> {
let products: Product[] = [];
const store = await RdbUtil.getStore();
if (store) {
try {
let predicates = new relationalStore.RdbPredicates(Constants.TABLE_PRODUCT);
let resultSet = await store.query(predicates);
while (res... | https://gitcode.com/openharmony/codelabs | d300988e484c60899679608a3da84eab9fcdd745 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryExecutor.ets | arkts | aggregate | 执行分组聚合查询
使用 selectRaw() 和 groupBy() 构建的查询
@returns Promise<AggregateResult> | async aggregate(): Promise<AggregateResult> {
return await this.withStoreLease(async () => {
return await this.aggregateExecutor.aggregate()
})
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left aggregate 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 AST#generic_ty... | async aggregate(): Promise<AggregateResult> {
return await this.withStoreLease(async () => {
return await this.aggregateExecutor.aggregate()
})
} | https://github.com/offlinecat-dev/OCNetORM | 39bad173c0046fdbd4ae75beda85b2d93775f992 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Loaders/MangaDetailLoader.ets | arkts | convertOnlineChaptersToMangaChapters | 转换在线章节为MangaChapter格式 | private async convertOnlineChaptersToMangaChapters(chapters: OnlineChapterInfo[]): Promise<MangaChapter[]> {
const mangaChapters: MangaChapter[] = [];
for (let i = 0; i < chapters.length; i++) {
const ch = chapters[i];
// 获取页面信息
const pageInfos = await this.dataManager.getOnlineC... | 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 convertOnlineChaptersToMangaChapters AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left chapters AST#ide... | private async convertOnlineChaptersToMangaChapters(chapters: OnlineChapterInfo[]): Promise<MangaChapter[]> {
const mangaChapters: MangaChapter[] = [];
for (let i = 0; i < chapters.length; i++) {
const ch = chapters[i];
// 获取页面信息
const pageInfos = await this.dataManager.getOnlineC... | https://github.com/DaLongZhuaZi/manxia | a9fbe434af05664b97c4baab1f19c4bd4e05283e | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentSet.ets | arkts | $_iterator | Iterable interface implementation
@returns { IterableIterator<T> } iterator over all elements | public override $_iterator(): IterableIterator<T> {
return this.values();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left $_iterator AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#... | public override $_iterator(): IterableIterator<T> {
return this.values();
} | https://gitcode.com/iop123123/arkts-static-skills | 26a2561098acc2f69f407e476c8ea51af95a85a6 | gitcode |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/pages/Index.ets | arkts | openSettings | Open settings | openSettings(): void {
router.pushUrl({
url: 'pages/SettingsPage'
});
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left openSettings 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... | openSettings(): void {
router.pushUrl({
url: 'pages/SettingsPage'
});
} | https://github.com/tangwengang-del/freerdp-harmonyos | f3cd12d7b1cfd28a78aa1994ca440f8c3b51bde6 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Source/SuwayomiCacheManager.ets | arkts | cachePage | 缓存单个页面 | public async cachePage(
mangaTitle: string,
chapterTitle: string,
pageIndex: number,
imageUrl: string,
headers?: Record<string, string>
): Promise<boolean> {
try {
const pagePath = this.getPageCachePath(mangaTitle, chapterTitle, pageIndex);
// 检查是否已缓存
if (this.isPage... | 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 cachePage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left mangaTitle AST#identifier#Right AST#ERROR#Left AST#:#Left : A... | public async cachePage(
mangaTitle: string,
chapterTitle: string,
pageIndex: number,
imageUrl: string,
headers?: Record<string, string>
): Promise<boolean> {
try {
const pagePath = this.getPageCachePath(mangaTitle, chapterTitle, pageIndex);
// 检查是否已缓存
if (this.isPage... | https://github.com/DaLongZhuaZi/manxia | 9da46f6c2d4c20d6c9f91939a81f2ea277d6d183 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/CandleDataSet.ets | arkts | setNeutralColor | It is necessary to implement ColorsList class that will encapsulate
colors list functionality, because It's wrong to copy paste setColor,
addColor, ... resetColors for each time when we want to add a coloring
options for one of objects
@author Mesrop
BELOW THIS COLOR HANDLING
Sets the one and ONLY color that should be ... | public setNeutralColor(color: number): void {
this.mNeutralColor = color;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setNeutralColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | public setNeutralColor(color: number): void {
this.mNeutralColor = color;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | dbab99799c9014f6077d534fbbf4481c80aaece4 | gitee |
openharmony-sig/ohos_easyui | easyui/src/main/ets/common/components/NoticeBar.ets | arkts | build | 滚动文本长度 | build(){
Stack(){
//开头间隙
Row(){
}
.backgroundColor("#FFFBE8")
.height("100%")
.width("6%")
.margin(5)
.zIndex(10)
.position({x: "0%"})
//滚动文本
Row(){
Text(this.notice_text)
.fontColor("#F06A0C")
.fontSize(15)
.... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build(){
Stack(){
//开头间隙
Row(){
}
.backgroundColor("#FFFBE8")
.height("100%")
.width("6%")
.margin(5)
.zIndex(10)
.position({x: "0%"})
//滚动文本
Row(){
Text(this.notice_text)
.fontColor("#F06A0C")
.fontSize(15)
.... | https://gitee.com/openharmony-sig/ohos_easyui.git | eeba475426988998e657bb330c8a91873ab26dd4 | gitee |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryBuilder.ets | arkts | hasGroupBy | 检查是否有 GROUP BY
@returns 是否有 GROUP BY | hasGroupBy(): boolean {
return this.groupByColumns.length > 0
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasGroupBy 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#statemen... | hasGroupBy(): boolean {
return this.groupByColumns.length > 0
} | https://github.com/offlinecat-dev/OCNetORM | 6a40b469fa636f86fbe7f157cb7bd8a369cafb0e | github |
OHPG/FinSdk | jellyfin/src/main/ets/api/PlayStateApi.ets | arkts | onPlaybackStopped | onPlaybackStopped
@summary Reports that a session has stopped playing an item.
@param {PlayStateApiOnPlaybackStoppedRequest} requestParameters Request parameters.
@throws {RequiredError}
@memberof PlayStateApi | public async onPlaybackStopped(requestParameters: PlayStateApiOnPlaybackStoppedRequest): Promise<void> {
this.assertParam(requestParameters.itemId)
return this.apiClient.delete({path: `/PlayingItems/${requestParameters.itemId}`, parameters: requestParameters})
} | 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 onPlaybackStopped AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right... | public async onPlaybackStopped(requestParameters: PlayStateApiOnPlaybackStoppedRequest): Promise<void> {
this.assertParam(requestParameters.itemId)
return this.apiClient.delete({path: `/PlayingItems/${requestParameters.itemId}`, parameters: requestParameters})
} | https://github.com/OHPG/FinSdk | f8e8887b690a57a31a9d9233223d950a13d750dc | github |
Joker-x-dev/CoolMallArkTS | feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets | arkts | initCreateMode | 初始化新增模式数据
@returns {void} 无返回值 | private initCreateMode(): void {
this.updateFormData(new Address());
this.setSuccessState();
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initCreateMode 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#expr... | private initCreateMode(): void {
this.updateFormData(new Address());
this.setSuccessState();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 8dab412cae075680e5238c695841742c0d16ffdc | github |
fuhhhhhhhh/openharmony | entry/src/main/ets/data/DatabaseHelper.ets | arkts | close | 关闭数据库连接
应在应用退出时调用 | public static async close(): Promise<void> {
if (DatabaseHelper.dbManager) {
await DatabaseHelper.dbManager.closeDB();
DatabaseHelper.dbManager = null;
DatabaseHelper.categoryDao = null;
DatabaseHelper.transactionDao = null;
DatabaseHelper.isInitialized = false;
console.log('数据... | 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 close AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AS... | public static async close(): Promise<void> {
if (DatabaseHelper.dbManager) {
await DatabaseHelper.dbManager.closeDB();
DatabaseHelper.dbManager = null;
DatabaseHelper.categoryDao = null;
DatabaseHelper.transactionDao = null;
DatabaseHelper.isInitialized = false;
console.log('数据... | https://github.com/fuhhhhhhhh/openharmony | 0ae6db3e73ddd2bdc8db461e0a5ac1b35efa94a6 | github |
openharmony/codelabs | Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets | arkts | fixBottomInFreeMode | In free mode fix bottom edge.
@param left
@param crop
@param imageLines
@returns fixedBottom. | private fixBottomInFreeMode(bottom: number, crop: RectF, imageLines: Array<LineSegment>): number {
let bottomLine = new LineSegment(new Point(crop.left, bottom), new Point(crop.right, bottom));
let adjacentLines: LineSegment[] = [];
adjacentLines.push(new LineSegment(new Point(crop.left, crop.top), new Po... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left fixBottomInFreeMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bottom AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif... | private fixBottomInFreeMode(bottom: number, crop: RectF, imageLines: Array<LineSegment>): number {
let bottomLine = new LineSegment(new Point(crop.left, bottom), new Point(crop.right, bottom));
let adjacentLines: LineSegment[] = [];
adjacentLines.push(new LineSegment(new Point(crop.left, crop.top), new Po... | https://gitee.com/openharmony/codelabs.git | 79653a99df5fad556665ca0e99d6ebb23c99e13a | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | sort | Sorts in-place
@param fn comparator
@returns sorted Uint8Array | public sort(fn: (a: number, b: number) => number): Uint8Array {
let arr: number[] = new number[this.length]
for (let i = 0; i < this.length; ++i) {
arr[i] = this.at(i)
}
// TODO(ivan-tyulyandin): unresolved reference i in for loop, blocked by internal issue 12961
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sort AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ... | public sort(fn: (a: number, b: number) => number): Uint8Array {
let arr: number[] = new number[this.length]
for (let i = 0; i < this.length; ++i) {
arr[i] = this.at(i)
}
// TODO(ivan-tyulyandin): unresolved reference i in for loop, blocked by internal issue 12961
... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 8cbfeaeb187fe0e8024c0af17c40c391ea39add6 | gitee |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/components/popup/TnPopup.ets | arkts | popupSleep | 异步等待指定毫秒数
@param ms 等待时间
@returns Promise | function popupSleep(ms: number): Promise<void> {
return new Promise<void>((resolve: Function) => {
setTimeout(() => {
resolve();
}, ms);
});
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left popupSleep AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left ms AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right A... | function popupSleep(ms: number): Promise<void> {
return new Promise<void>((resolve: Function) => {
setTimeout(() => {
resolve();
}, ms);
});
} | https://github.com/codelably/tuniao-ui | 4b17010f44b89f182ba364ea6493879a06f0fa1b | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets | arkts | exportAllSettings | 导出整个设置表 | private async exportAllSettings(): Promise<SettingItemBackup[]> {
try {
const dataManager = (await import('../Data/DataManager')).DataManager.getInstance();
const allSettings = await dataManager.getAllSettings();
const result: SettingItemBackup[] = [];
for (const setting of allSetti... | 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 exportAllSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right... | private async exportAllSettings(): Promise<SettingItemBackup[]> {
try {
const dataManager = (await import('../Data/DataManager')).DataManager.getInstance();
const allSettings = await dataManager.getAllSettings();
const result: SettingItemBackup[] = [];
for (const setting of allSetti... | https://github.com/DaLongZhuaZi/manxia | 88312aed0436b57082a4bbe5c177cc27b3ad3273 | github |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/services/auth/AuthService.ets | arkts | saveLoginInfo | 保存登录信息 | async saveLoginInfo(cookies: string, csrfToken: string, username: string, password: string = ''): Promise<void> {
await this.init();
const normalizedUsername: string = username.trim().toLowerCase();
if (this.currentUser !== null) {
const currentUsername: string = this.currentUser.username.trim().toL... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveLoginInfo AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left cookies AST#identifier#Right AST#type_annotation#Left AST#:#Left ... | async saveLoginInfo(cookies: string, csrfToken: string, username: string, password: string = ''): Promise<void> {
await this.init();
const normalizedUsername: string = username.trim().toLowerCase();
if (this.currentUser !== null) {
const currentUsername: string = this.currentUser.username.trim().toL... | https://github.com/Amaz1ny/HarmonyDO-public | a3eb93d303b04fc0ba56638b8323884551e0e1ab | github |
openharmony-tpc/openharmony_tpc_samples | GSYVideoPlayer-filters/library/src/main/ets/components/mainpage/BaseVideoPlayer.ets | arkts | onInitStatus | 视频切换为错误状态 | public onInitStatus() {
this.playStatus = PlayStatus.INIT;
this.onErrorListener();
let eventData: emitter.EventData = {
data: {
"xid": this.xComponentId
}
}
emitter.emit(this.videoInitEvent, eventData);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onInitStatus 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 { ... | public onInitStatus() {
this.playStatus = PlayStatus.INIT;
this.onErrorListener();
let eventData: emitter.EventData = {
data: {
"xid": this.xComponentId
}
}
emitter.emit(this.videoInitEvent, eventData);
} | https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git | df844d5d99a39dd66101767684bab0c21b9b1150 | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/utils/NavigationManager.ets | arkts | goBack | 返回上一页
@returns Promise<void> | public async goBack(): Promise<void> {
try {
this.logNavigation('GO_BACK', 'previous page');
await router.back();
// 从历史记录中移除当前页面
if (this.navigationHistory.length > 0) {
this.navigationHistory.pop();
}
} catch (error) {
console.error('[NavigationManager] 返回失败:',... | 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 goBack AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : ... | public async goBack(): Promise<void> {
try {
this.logNavigation('GO_BACK', 'previous page');
await router.back();
// 从历史记录中移除当前页面
if (this.navigationHistory.length > 0) {
this.navigationHistory.pop();
}
} catch (error) {
console.error('[NavigationManager] 返回失败:',... | https://github.com/LJ666-ui/harmony-health-care | 57de6e8912b2822f95f8da3ebd881431bc782a92 | github |
richshaw2015/nds | ohos/entry/src/test/AxisDeadZoneProperty.test.ets | arkts | negativeKeyForAxis | Get the expected negative-direction NDS key for a given axis.
axisId 0 (horizontal): negative -> LEFT
axisId 1 (vertical): negative -> UP | function negativeKeyForAxis(axisId: number): number {
return axisId === 0 ? NDSKEY_LEFT : NDSKEY_UP;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left negativeKeyForAxis AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left axisId AST#identifier#Right AST#type_annotation#Left AST#:#Left : A... | function negativeKeyForAxis(axisId: number): number {
return axisId === 0 ? NDSKEY_LEFT : NDSKEY_UP;
} | https://github.com/richshaw2015/nds | 382322d5f3344dc91643f4972bdf6d7ab8783b66 | github |
zcg741/chengyu-game | entry/src/main/ets/viewmodel/TimerViewModel.ets | arkts | setCallbacks | 设置计时器回调
@param onTick 每秒回调
@param onFinish 结束回调 | setCallbacks(onTick?: TimerCallback, onFinish?: TimerFinishCallback): void {
this.onTickCallback = onTick;
this.onFinishCallback = onFinish;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setCallbacks AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left onTick AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TimerCallback AS... | setCallbacks(onTick?: TimerCallback, onFinish?: TimerFinishCallback): void {
this.onTickCallback = onTick;
this.onFinishCallback = onFinish;
} | https://github.com/zcg741/chengyu-game | 672c8aae56b2e92523f175ea50b33718d382faa2 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/EntryAbility.ets | arkts | onContinue | 鸿蒙跨端流转 (App Continuation) 状态保存 | onContinue(wantParam: Record<string, Object>): AbilityConstant.OnContinueResult {
logger.info('EntryAbility', 'onContinue: 开始保存接续状态');
// 生成分布式状态机 sessionId
const sessionId = `continuation_${Date.now()}`;
// 将会话ID写入 wantParam 传给目标端
wantParam['distributedSessionId'] = sessionId;
... | AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left onContinue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left wantParam AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right ... | onContinue(wantParam: Record<string, Object>): AbilityConstant.OnContinueResult {
logger.info('EntryAbility', 'onContinue: 开始保存接续状态');
// 生成分布式状态机 sessionId
const sessionId = `continuation_${Date.now()}`;
// 将会话ID写入 wantParam 传给目标端
wantParam['distributedSessionId'] = sessionId;
... | https://github.com/DaLongZhuaZi/manxia | cdde8fdf7b0f5f6e41fe82c60dd9593b8804e2d6 | github |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundMethodChannel.ets | arkts | invokeMethod | Invokes a method on this channel, optionally expecting a result.
<p>Any uncaught exception thrown by the result callback will be caught and logged.
@param method the name String of the method.
@param arguments the arguments for the invocation, possibly null.
@param callback a {@link Result} callback for the invocation ... | invokeMethod(method: string, args: Any, callback?: MethodResult): void {
this.messenger.send(this.name,
this.codec.encodeMethodCall(new MethodCall(method, args)),
callback == null ? null : new IncomingSendableResultHandler(callback, this.codec));
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left invokeMethod AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left method AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , ... | invokeMethod(method: string, args: Any, callback?: MethodResult): void {
this.messenger.send(this.name,
this.codec.encodeMethodCall(new MethodCall(method, args)),
callback == null ? null : new IncomingSendableResultHandler(callback, this.codec));
} | https://gitee.com/openharmony-sig/flutter_engine.git | b46e27a585bb8ead9864a4b0f6567d7f87ce6803 | gitee |
HarmonyOS_Samples/accountkit-samplecode-clientdemo-arkts | entry/src/main/ets/pages/QuickLoginPage.ets | arkts | getQuickLoginAnonymousPhoneTimer | Implement timeout handling for obtaining an anonymous mobile number. | getQuickLoginAnonymousPhoneTimer(): number {
// Set the wait time based on actual requirements, with 5 seconds recommended.
const waitTime: number = 5000;
// Handle the timeout to avoid prolonged waiting.
return setTimeout(() => {
hilog.error(domainId, logTag, `getQuickLoginAnonymousPhone failed... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getQuickLoginAnonymousPhoneTimer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR... | getQuickLoginAnonymousPhoneTimer(): number {
// Set the wait time based on actual requirements, with 5 seconds recommended.
const waitTime: number = 5000;
// Handle the timeout to avoid prolonged waiting.
return setTimeout(() => {
hilog.error(domainId, logTag, `getQuickLoginAnonymousPhone failed... | https://gitcode.com/HarmonyOS_Samples/accountkit-samplecode-clientdemo-arkts | bc95572519c3f5bafb01e545f3f408528d1d4e67 | gitcode |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnDateTimePickerViewModel.ets | arkts | toggleDatePicker | 切换日期选择器弹出层显示状态 | toggleDatePicker(): void {
this.datePickerOpen = !this.datePickerOpen;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toggleDatePicker AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | toggleDatePicker(): void {
this.datePickerOpen = !this.datePickerOpen;
} | https://github.com/codelably/tuniao-ui | 06b7398cafbb29ab63ca68ae7dc14485014963ab | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets | arkts | ecmaMakeFullYear | @see ECMA-262, 21.4.1.30
@param year
@returns returns the full year associated with the integer part of year | function ecmaMakeFullYear(year: long): long {
if (0 <= year && year <= 99) {
year = year + 1900;
}
return year;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left ecmaMakeFullYear AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left year AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | function ecmaMakeFullYear(year: long): long {
if (0 <= year && year <= 99) {
year = year + 1900;
}
return year;
} | https://gitcode.com/iop123123/arkts-static-skills | 725f689fac874ca647e4192c1270c23179a31d23 | gitcode |
PollenWang6/HiXD | entry/src/main/ets/services/ExperimentService.ets | arkts | parseSysjHtml | ===== HTML 解析 ===== | private parseSysjHtml(html: string, weekDates: string[]): ExperimentData[] {
const experiments: ExperimentData[] = [];
const cellRegex = /do-labReservation=['"](\d+),(\d+)['\"][^>]*>([\s\S]*?)<\/td>/g;
let match: RegExpExecArray | null = null;
const extractField = (cellHtml: string, marker: string):... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseSysjHtml 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... | private parseSysjHtml(html: string, weekDates: string[]): ExperimentData[] {
const experiments: ExperimentData[] = [];
const cellRegex = /do-labReservation=['"](\d+),(\d+)['\"][^>]*>([\s\S]*?)<\/td>/g;
let match: RegExpExecArray | null = null;
const extractField = (cellHtml: string, marker: string):... | https://github.com/PollenWang6/HiXD | 1c8ea875b6a9948d35295e58617e9858666a109e | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/kdbx/KdbxCsvService.ets | arkts | export | 导出数据库到csv文件格式
@param database
@returns | public static async export(database: Kdbx): Promise<ArrayBuffer> {
// CSV内容头部
let csvContent = '';
// 添加标题行
const titles = Object.values(CsvTitle).join(',');
csvContent += titles + '\n';
// 遍历所有条目
for (const entry of database.getDefaultGroup().allEntries()) {
const groupPath = Kdbx... | 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 export AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left database AST#identifier#Ri... | public static async export(database: Kdbx): Promise<ArrayBuffer> {
// CSV内容头部
let csvContent = '';
// 添加标题行
const titles = Object.values(CsvTitle).join(',');
csvContent += titles + '\n';
// 遍历所有条目
for (const entry of database.getDefaultGroup().allEntries()) {
const groupPath = Kdbx... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxCsvService.ets#L188-L229 | b537dcb6a22fb41bb25fb542221a6129d000631c | github |
FinalScave/SweetLine | platform/OHOS/sweetline/src/main/ets/Index.ets | arkts | getHighlightSlice | Get highlight slice from the current cached result (requires prior call to analyze or analyzeIncremental)
@param visibleRange Visible line range
@returns Highlight slice for the specified line range | public getHighlightSlice(visibleRange: LineRange): DocumentHighlightSlice {
if (this.nativeHandle == 0) {
return new DocumentHighlightSlice();
}
let buffer: Int32Array = lib.DocumentAnalyzer_GetHighlightSlice(
this.nativeHandle,
visibleRange.startLine, visibleRange.lineCoun... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getHighlightSlice AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left visibleRange AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left LineRa... | public getHighlightSlice(visibleRange: LineRange): DocumentHighlightSlice {
if (this.nativeHandle == 0) {
return new DocumentHighlightSlice();
}
let buffer: Int32Array = lib.DocumentAnalyzer_GetHighlightSlice(
this.nativeHandle,
visibleRange.startLine, visibleRange.lineCoun... | https://github.com/FinalScave/SweetLine | 4e80a177383016ddbb73bd4e25d04d830c040d9e | github |
killetom/ktretrofit | ktretrofit/src/main/ets/retrofit/interceptor/InterceptorHttpClient.ets | arkts | execute | Execute an HTTP request synchronously with interceptors applied.
This method will block the calling thread until the request completes.
@param config The request configuration.
@returns The response directly. | execute<T>(config: HttpRequestConfig): Response<T> {
try {
// Use semaphore to block until the async call completes
const semaphore = new Semaphore(0);
let response: Response<T> | undefined;
let error: Error | undefined;
// Create the interceptor chain
const chain = new RealIn... | AST#program#Left AST#ERROR#Left AST#binary_expression#Left AST#identifier#Left execute AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identif... | execute<T>(config: HttpRequestConfig): Response<T> {
try {
// Use semaphore to block until the async call completes
const semaphore = new Semaphore(0);
let response: Response<T> | undefined;
let error: Error | undefined;
// Create the interceptor chain
const chain = new RealIn... | https://github.com/killetom/ktretrofit | a37459a842a43a71819fd270e597fa618c8e76e3 | github |
OSpark-Team/Free-PCM | library/src/main/ets/utils/AudioRendererPlayer.ets | arkts | setEqGainsLR | 设置左右声道独立均衡器增益(仅对双声道生效)
@param leftGainsDb - 左声道 10 段增益(dB)
@param rightGainsDb - 右声道 10 段增益(dB) | public setEqGainsLR(leftGainsDb: number[], rightGainsDb: number[]): void {
if (!this.decoder) {
throw new Error('Decoder not initialized');
}
if (this.decoder.setEqGainsLR) {
this.decoder.setEqGainsLR(leftGainsDb, rightGainsDb);
return;
}
// Fallback: apply left gains to all ch... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setEqGainsLR AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left leftGainsDb AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#numbe... | public setEqGainsLR(leftGainsDb: number[], rightGainsDb: number[]): void {
if (!this.decoder) {
throw new Error('Decoder not initialized');
}
if (this.decoder.setEqGainsLR) {
this.decoder.setEqGainsLR(leftGainsDb, rightGainsDb);
return;
}
// Fallback: apply left gains to all ch... | https://github.com/OSpark-Team/Free-PCM/blob/3440e7220d07d28815d172b4b3237145434075ee/library/src/main/ets/utils/AudioRendererPlayer.ets#L718-L730 | f35b843dc231e1cdd75c5eaa7fb8a8344ef59363 | github |
huangyuanlove/HelloArkUI | entry/src/main/ets/pages/playground/take_photo/TakePhotoPage.ets | arkts | onCameraStatusChange | 监听相机状态 | onCameraStatusChange(): void {
this.cameraManager.on('cameraStatus', (err: BusinessError, cameraStatusInfo: camera.CameraStatusInfo) => {
if (err !== undefined && err.code !== 0) {
hilog.error(0x01, TAG, `Callback Error, errorCode: ${err.code}`);
return;
}
// 如果当通过USB连接相机设备时,回调函数... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onCameraStatusChange 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#stateme... | onCameraStatusChange(): void {
this.cameraManager.on('cameraStatus', (err: BusinessError, cameraStatusInfo: camera.CameraStatusInfo) => {
if (err !== undefined && err.code !== 0) {
hilog.error(0x01, TAG, `Callback Error, errorCode: ${err.code}`);
return;
}
// 如果当通过USB连接相机设备时,回调函数... | https://github.com/huangyuanlove/HelloArkUI | 8aeada0305a45e081b09fbf7f2398d4b17af0871 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Compress/ComicArchiveManager.ets | arkts | createZipArchive | 创建ZIP归档文件 | private async createZipArchive(
chapterInfo: ComicChapterInfo,
sourceDir: string,
options: ArchiveOptions
): Promise<string> {
try {
// 生成CBZ文件路径
const cbzFileName = this.generateCbzFileName(chapterInfo);
const cbzPath = `${this.sandboxManager.getDirectory('chapters')}/${cbzFileNam... | 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 createZipArchive AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left chapterInfo AST#identifier#Right AST... | private async createZipArchive(
chapterInfo: ComicChapterInfo,
sourceDir: string,
options: ArchiveOptions
): Promise<string> {
try {
// 生成CBZ文件路径
const cbzFileName = this.generateCbzFileName(chapterInfo);
const cbzPath = `${this.sandboxManager.getDirectory('chapters')}/${cbzFileNam... | https://github.com/DaLongZhuaZi/manxia | db5be1488b9aeedbf4665c253e1ad9d127fea599 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/AxisBase.ets | arkts | disableGridDashedLine | Disables the grid line to be drawn in dashed mode. | public disableGridDashedLine(): void {
this.mGridDashPathEffect = null;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left disableGridDashedLine 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#... | public disableGridDashedLine(): void {
this.mGridDashPathEffect = null;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | f5bae192b0bc5acea7a66008aa874b6af55058ec | gitee |
hiyuey3/Hixy_MyMemories | entry/src/main/ets/store/MemoryStore.ets | arkts | updateEvent | 更新事件
@param item MemoryItem 对象
@returns Promise<void> | async function updateEvent(item: MemoryItem): Promise<void> {
// 更新逻辑...
} | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left updateEvent AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left item AST#identifier#Right AST#type_an... | async function updateEvent(item: MemoryItem): Promise<void> {
// 更新逻辑...
} | https://github.com/hiyuey3/Hixy_MyMemories/blob/9769d82c97a877be3d464456e79f66c5c84a9590/entry/src/main/ets/store/MemoryStore.ets#L48-L50 | 6fcf601a37add1c46ea446bf521e2510babb6867 | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/kdbx/KdbxSaveService.ets | arkts | saveDatabaseAsync | 异步方式 - 保存数据库
@param req
@param callback | static async saveDatabaseAsync(req: SaveDatabaseMessage, callback?: SaveDatabaseCallback) {
// 释放之前的异步线程
if (KdbxSaveService.databaseWorker) {
try {
KdbxSaveService.databaseWorker.terminate();
} catch (error) {
hilog.warn(DOMAIN, TAG, 'Save database worker terminate error: %{public... | 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 saveDatabaseAsync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left req AST#identifier#Right AST#:#Left : ... | static async saveDatabaseAsync(req: SaveDatabaseMessage, callback?: SaveDatabaseCallback) {
// 释放之前的异步线程
if (KdbxSaveService.databaseWorker) {
try {
KdbxSaveService.databaseWorker.terminate();
} catch (error) {
hilog.warn(DOMAIN, TAG, 'Save database worker terminate error: %{public... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxSaveService.ets#L50-L64 | 9f13e40b638d884bd0ec31e60119527ab9c049db | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Data/UserManualData.ets | arkts | createUserManualMetadata | 创建使用手册元数据 | function createUserManualMetadata(): EBookMetadata {
return {
title: '漫匣使用手册',
author: '漫匣项目组',
publisher: '漫匣项目组',
publishDate: '2026-03-25',
isbn: '',
language: 'zh-CN',
description: '面向当前版本漫匣的内置使用说明,覆盖本地导入、书库整理、统一详情页、阅读器、缓存同步与常见问题。',
coverImagePath: 'app.media.mangabook',
tags: ... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left createUserManualMetadata 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#ty... | function createUserManualMetadata(): EBookMetadata {
return {
title: '漫匣使用手册',
author: '漫匣项目组',
publisher: '漫匣项目组',
publishDate: '2026-03-25',
isbn: '',
language: 'zh-CN',
description: '面向当前版本漫匣的内置使用说明,覆盖本地导入、书库整理、统一详情页、阅读器、缓存同步与常见问题。',
coverImagePath: 'app.media.mangabook',
tags: ... | https://github.com/DaLongZhuaZi/manxia | 48bbe4aaa648755e23cfab8c51516084e8ee7b11 | github |
FinalScave/SweetEditor | platform/OHOS/sweeteditor/src/main/ets/core/EditorCore.ets | arkts | undo | ==================== Undo/Redo ==================== | undo(): EditorActionResult {
return CoreProtocol.decodeEditorActionResult(native.editorUndo(this.handle));
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left undo 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 EditorActionResult AST#identifier#Right AST#ERROR#Right A... | undo(): EditorActionResult {
return CoreProtocol.decodeEditorActionResult(native.editorUndo(this.handle));
} | https://github.com/FinalScave/SweetEditor | fbcf39a47b866a13bcb8b000466c6e8ac2e1ce85 | github |
erosTeam/NextE | shared/src/main/ets/network/EhApiService.ets | arkts | getMyTags | Fetch the user's My Tags (watched/hidden/flagged tags + apiuid/apikey). Requires login.
`tagset` ('' = the default set) selects one of the user's tag sets via `?tagset=N`. | async getMyTags(isEx: boolean, tagset: string = ''): Promise<EhMytags> {
const suffix: string = tagset.length > 0 ? `?tagset=${tagset}` : ''
const url: string = `${EhConstants.baseUrl(isEx)}/mytags${suffix}`
const resp = await this.fetch(url, isEx, 'generic')
return EhMytagsParser.parse(resp.body)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getMyTags AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left isEx AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | async getMyTags(isEx: boolean, tagset: string = ''): Promise<EhMytags> {
const suffix: string = tagset.length > 0 ? `?tagset=${tagset}` : ''
const url: string = `${EhConstants.baseUrl(isEx)}/mytags${suffix}`
const resp = await this.fetch(url, isEx, 'generic')
return EhMytagsParser.parse(resp.body)
} | https://github.com/erosTeam/NextE | bd8d415e43c9ffac4e80b27eaf6f526bdcd6e96d | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/PieChartModel.ets | arkts | setTransparentCircleRadius | sets the radius of the transparent circle that is drawn next to the hole
in the piechart in percent of the maximum radius (max = the radius of the
whole chart), default 55% -> means 5% larger than the center-hole by
default
@param percent | public setTransparentCircleRadius(percent: number): void {
this.mTransparentCircleRadiusPercent = percent;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setTransparentCircleRadius AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left percent AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number... | public setTransparentCircleRadius(percent: number): void {
this.mTransparentCircleRadiusPercent = percent;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 9d65d8ee530c8afb174ac183752ee266e6a38fb2 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | sort | Sorts in-place according to the numeric ordering
@returns sorted Uint8ClampedArray | public sort(): Uint8ClampedArray {
let newF: (a: number, b: number) => number = (a: number, b: number): number => { throw new Error("not implemented") }
return this.sort(newF)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sort AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Righ... | public sort(): Uint8ClampedArray {
let newF: (a: number, b: number) => number = (a: number, b: number): number => { throw new Error("not implemented") }
return this.sort(newF)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | c0bd347b0978d36b10089682900d5add984951fc | gitee |
Vincent-Leon/zotero-harmony | entry/src/main/ets/components/ItemDetailView.ets | arkts | replaceAll | Hand-rolled to dodge ArkTS's regex-literal quirks; called rarely so the
quadratic cost from the running concat doesn't matter. | function replaceAll(s: string, find: string, replacement: string): string {
if (find.length === 0) {
return s;
}
let out: string = '';
let i: number = 0;
while (i < s.length) {
if (i + find.length <= s.length && s.substring(i, i + find.length) === find) {
out += replacement;
i += find.leng... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left replaceAll AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left s AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AS... | function replaceAll(s: string, find: string, replacement: string): string {
if (find.length === 0) {
return s;
}
let out: string = '';
let i: number = 0;
while (i < s.length) {
if (i + find.length <= s.length && s.substring(i, i + find.length) === find) {
out += replacement;
i += find.leng... | https://github.com/Vincent-Leon/zotero-harmony | 1a3b61647bd9bd587fb889fbca4ba861d58e1c70 | github |
LJ666-ui/harmony-health-care | 5-skill离线包/星云智联–分布式AI全周期智慧健康管理平台_skills/skills/HealthQuerySkill.ets | arkts | execute | 执行健康数据查询 | static async execute(query: string): Promise<HealthQueryResult> {
const dataType = this.extractDataType(query);
const latestRecord = await healthDataStore.getLatest(dataType);
if (!latestRecord) {
return {
dataType,
value: '暂无数据',
unit: '',
timestamp: new Date(),... | 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 execute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left query AST#identifier#Right AST#:#Left : AST#:#Ri... | static async execute(query: string): Promise<HealthQueryResult> {
const dataType = this.extractDataType(query);
const latestRecord = await healthDataStore.getLatest(dataType);
if (!latestRecord) {
return {
dataType,
value: '暂无数据',
unit: '',
timestamp: new Date(),... | https://github.com/LJ666-ui/harmony-health-care | 4acb5f500f5f08ca155951c88837f2559dffdd6b | github |
751496032/ZRouter | RouterApi/src/main/ets/api/Router.ets | arkts | replacePathByName | @deprecated
@see {ZRouter.getInstance().replacePathByName}
@param name
@param param
@param animated | public static replacePathByName(name: string, param?: ObjectOrNull, animated: boolean = true) {
ZRouter.getRouterMgr().replacePathByName<ObjectOrNull>(name, param, animated)
} | 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 replacePathByName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left ... | public static replacePathByName(name: string, param?: ObjectOrNull, animated: boolean = true) {
ZRouter.getRouterMgr().replacePathByName<ObjectOrNull>(name, param, animated)
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/Router.ets#L571-L573 | 89389e352b08d3dd872d45ad71f9a86548bafcce | github |
openharmony/applications_app_samples | code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example4/ReusePage.ets | arkts | initCalenderData | 二级列表Scroller对象
初始化日历中一年的数据 | initCalenderData() {
for (let k = this.currentYear; k < 2035; ++k) {
for (let i = 1; i <= 12; i++) {
// 获取每个月的日数据
const monthDays: number[] = getMonthDate(i, k);
const month: Month = {
month: i + MONTH,
num: i,
days: monthDays,
year: k
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initCalenderData 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... | initCalenderData() {
for (let k = this.currentYear; k < 2035; ++k) {
for (let i = 1; i <= 12; i++) {
// 获取每个月的日数据
const monthDays: number[] = getMonthDate(i, k);
const month: Month = {
month: i + MONTH,
num: i,
days: monthDays,
year: k
... | https://github.com/openharmony/applications_app_samples | 518476580c5fee86a3062065922fc2f6c9abc1a2 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.