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 |
|---|---|---|---|---|---|---|---|---|---|---|
openharmony/security_privacy_center | entry/src/main/ets/common/utils/HiSysEventUtil.ets | arkts | reportAccessClick | Access framework access application click event management
@params { clickedBundleName } Click on the application package name | static async reportAccessClick(clickedBundleName: string): Promise<void> {
Logger.info(TAG, 'reportAccessClick start.')
let versionName: string = await GetSelfBundleInfoUtils.getVersionName();
let eventParams: Record<string, string | number> = {
'PNAMEID': HiSysEventConstant.BUNDLE_NAME,
'PVER... | 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 reportAccessClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left clickedBundleName AST#identifier#Right AST#ERROR#Left... | static async reportAccessClick(clickedBundleName: string): Promise<void> {
Logger.info(TAG, 'reportAccessClick start.')
let versionName: string = await GetSelfBundleInfoUtils.getVersionName();
let eventParams: Record<string, string | number> = {
'PNAMEID': HiSysEventConstant.BUNDLE_NAME,
'PVER... | https://gitee.com/openharmony/security_privacy_center.git | a5b846d3620ccd550bcaf21cde9a4437809bad38 | gitee |
Your-USTC/DailyNic_HMOS | entry/src/main/ets/utils/CheckIn.ets | arkts | getTodayDate | 用于没有签到记录时的Unix时间戳 | static getTodayDate(): number { // 保留年、月、日,忽略时、分、秒
const date = new Date();
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getTodayDate 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#nu... | static getTodayDate(): number { // 保留年、月、日,忽略时、分、秒
const date = new Date();
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
} | https://github.com/Your-USTC/DailyNic_HMOS | c885258a8dee7f219a0618df13d332597d898c79 | github |
arkui-x/samples | CodeLab/Cases/feature/foldablescreencases/src/main/ets/model/AVPlayerModel.ets | arkts | pause | 暂停播放
@returns {void} | pause(): void {
if (!this.avPlayer) {
logger.error('avPlayer no create.');
return;
}
this.avPlayer.pause();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left pause 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#Left A... | pause(): void {
if (!this.avPlayer) {
logger.error('avPlayer no create.');
return;
}
this.avPlayer.pause();
} | https://gitcode.com/arkui-x/samples | b0ea4fec050a76d991dd5034a3b530b329e56e67 | gitcode |
751496032/DSBridge-HarmonyOS | library/src/main/ets/core/WebViewControllerProxy.ets | arkts | registerJavaScriptProxy | 注册JavaScript代理,不建议使用
@param object
@param name
@param methodList | registerJavaScriptProxy(object: object, name: string, methodList: string[]) {
this.controller.registerJavaScriptProxy(object, name, methodList);
this.refresh()
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left registerJavaScriptProxy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left object AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left object AST#iden... | registerJavaScriptProxy(object: object, name: string, methodList: string[]) {
this.controller.registerJavaScriptProxy(object, name, methodList);
this.refresh()
} | https://github.com/751496032/DSBridge-HarmonyOS/blob/6e69923a816e400710e23c8bab549fe790545bc6/library/src/main/ets/core/WebViewControllerProxy.ets#L147-L150 | b36e8535245db85a6db44961791e187af44a644c | github |
harmonyos/codelabs | HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/service/ReminderAgent.ets | arkts | fetchData | fetchData | function fetchData(params: PublishReminderInfo): reminderAgent.ReminderRequestAlarm {
return {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: params.hour || 0,
minute: params.minute || 0,
daysOfWeek: params.daysOfWeek || [],
wantAgent: {
pkgName: Const.PACKAGE_NAME,
... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left fetchData AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Righ... | function fetchData(params: PublishReminderInfo): reminderAgent.ReminderRequestAlarm {
return {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: params.hour || 0,
minute: params.minute || 0,
daysOfWeek: params.daysOfWeek || [],
wantAgent: {
pkgName: Const.PACKAGE_NAME,
... | https://gitee.com/harmonyos/codelabs.git | 2b91a98f79e6db78536e1e330bc2a285d748e30d | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets | arkts | assignableFrom | Checks if a type is assignable to this array type
@param {Type} other Type to check
@returns {boolean} True if type is assignable
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public override assignableFrom(other: Type): boolean {
if (super.assignableFrom(other)) {
return true
}
return other instanceof ArrayType && (other as ArrayType).getElementType().subTypeOf(this.getElementType())
} | 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 assignableFrom AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left other AST#identifier#Right AST#ERROR#Left AST#:#Left ... | public override assignableFrom(other: Type): boolean {
if (super.assignableFrom(other)) {
return true
}
return other instanceof ArrayType && (other as ArrayType).getElementType().subTypeOf(this.getElementType())
} | https://gitcode.com/iop123123/arkts-static-skills | 8012cc4ddee6ad8a96975dc0d7b12158670b5c67 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets | arkts | constructor | Constructs a new NegativeArraySizeError instance with provided message and error specific information
@param { String | undefined } message - Error text
@param { ErrorOptions | undefined } options - Error options
@syscap SystemCapability.Utils.Lang | constructor(message?: String, options?: ErrorOptions) {
super(message, options)
this.name = "NegativeArraySizeError"
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#Left String AST#identi... | constructor(message?: String, options?: ErrorOptions) {
super(message, options)
this.name = "NegativeArraySizeError"
} | https://gitcode.com/iop123123/arkts-static-skills | 8309ae0f6a349b8a74e8a3886d3b44173b63366d | gitcode |
wodekouwei/qlog | qloglib/src/main/ets/qlog/upload/UploadManager.ets | arkts | deletePushDir | 每次启动,以及上传成功都清空上传目录 | private deletePushDir(): void {
if (!LogSdk.getDependency().isDebug()) {
LogFileUtil.getPushFiles()?.forEach((value: string, index: number) => {
CommonUtils.deleteFile(value);
})
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left deletePushDir 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... | private deletePushDir(): void {
if (!LogSdk.getDependency().isDebug()) {
LogFileUtil.getPushFiles()?.forEach((value: string, index: number) => {
CommonUtils.deleteFile(value);
})
}
} | https://gitcode.com/wodekouwei/qlog | a4c317a947c8342bcf14c1cdfc549345fda30845 | gitcode |
LongLiveY96/chatcube | entry/src/main/ets/viewmodels/ChatViewModel.ets | arkts | harvestResponsesReasoningSignature | 流式完成时把 AIApiService 本轮累积的 OpenAI Responses reasoning items 持久化到消息上
仅官方 Responses API + include=reasoning.encrypted_content 时 AIApiService 里才会有累积,
普通 Chat Completions 拿到的始终是空串,不影响其他路径。 | private harvestResponsesReasoningSignature(aiMessage: ChatMessage): void {
const blob = this.aiApiService.consumeLastStreamResponsesReasoningBlob()
if (blob !== '') {
aiMessage.reasoningSignatureBlob = blob
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left harvestResponsesReasoningSignature AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left aiMessage AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR... | private harvestResponsesReasoningSignature(aiMessage: ChatMessage): void {
const blob = this.aiApiService.consumeLastStreamResponsesReasoningBlob()
if (blob !== '') {
aiMessage.reasoningSignatureBlob = blob
}
} | https://github.com/LongLiveY96/chatcube | 3b1a21ba812932e7792e07ae79e63b8bc47b5f2d | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/ChartData.ets | arkts | getDataSetLabels | Returns the labels of all DataSets as a string array.
@return | public getDataSetLabels(): string[] {
let size: number = 0;
if (this.mDataSets) {
size = this.mDataSets.listSize;
}
let types: string[] = new Array(size);
if (this.mDataSets) {
for (let i: number = 0; i < this.mDataSets.listSize; i++) {
types[i] = this.mDataSets.get(i).getLabel... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDataSetLabels 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 strin... | public getDataSetLabels(): string[] {
let size: number = 0;
if (this.mDataSets) {
size = this.mDataSets.listSize;
}
let types: string[] = new Array(size);
if (this.mDataSets) {
for (let i: number = 0; i < this.mDataSets.listSize; i++) {
types[i] = this.mDataSets.get(i).getLabel... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 1bc84c8e47dc0ed70d8cfcff763d9060572b42b8 | gitee |
popsiclelmlm/Hey | entry/src/main/ets/core/HevTunConfig.ets | arkts | parseTimeoutsMs | 把设置里的 hevTunRwTimeout('tcp,udp' 两个秒数,如 '300,60')解析成毫秒。
解析失败的分量回退到默认值;hev 的 yaml 用毫秒。 | function parseTimeoutsMs(rwTimeout: string): [number, number] {
const parts = rwTimeout.split(',');
const tcpSec = parts.length > 0 ? Number(parts[0].trim()) : NaN;
const udpSec = parts.length > 1 ? Number(parts[1].trim()) : NaN;
const tcpMs = Number.isInteger(tcpSec) && tcpSec > 0 ? tcpSec * 1000 : DEFAULT_TCP... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left parseTimeoutsMs AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left rwTimeout AST#identifier#Right AST#type_annotation#Left AST#:#Left : A... | function parseTimeoutsMs(rwTimeout: string): [number, number] {
const parts = rwTimeout.split(',');
const tcpSec = parts.length > 0 ? Number(parts[0].trim()) : NaN;
const udpSec = parts.length > 1 ? Number(parts[1].trim()) : NaN;
const tcpMs = Number.isInteger(tcpSec) && tcpSec > 0 ? tcpSec * 1000 : DEFAULT_TCP... | https://github.com/popsiclelmlm/Hey | 3ddc19dffc6b9b02e29d67ffe31457af8a365091 | github |
Joker-x-dev/CoolMallArkTS | core/network/src/main/ets/interceptors/LogInterceptor.ets | arkts | logInfoLines | 输出 info 日志(支持多行与分段)
@param {string[]} lines - 日志行
@returns {void} 无返回值 | function logInfoLines(lines: string[]): void {
logLines("info", lines);
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left logInfoLines AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left lines AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri... | function logInfoLines(lines: string[]): void {
logLines("info", lines);
} | https://github.com/Joker-x-dev/CoolMallArkTS | 9ea64da338a8289ce8bf7f07db07cd2d6ffc329f | github |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/historyrecord/HistoryRecordController.ets | arkts | deleteAllRecords | delete all history records | deleteAllRecords(): void {
LogUtil.info(TAG, 'deleteRecords start');
this.expressionsModel.deleteAllRecords((rows: number) => {
if (rows >= 1) {
this.isEmptyView = true;
this.expDataSource.refresh();
}
});
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left deleteAllRecords 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... | deleteAllRecords(): void {
LogUtil.info(TAG, 'deleteRecords start');
this.expressionsModel.deleteAllRecords((rows: number) => {
if (rows >= 1) {
this.isEmptyView = true;
this.expDataSource.refresh();
}
});
} | https://gitee.com/openharmony-sig/applications_calculator.git | de97e7e69ba05dbb316977e8943f6040a669dea3 | gitee |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/strategies/PresetTemplateStrategy.ets | arkts | applyStandardFields | 应用标准字段 | private applyStandardFields(entry: KdbxEntry, preset: IPresetTemplate, opts: TemplateApplyOptions): void {
const fields = preset.standardFields;
if (fields.title !== undefined && fields.title !== '') {
const existingValue = entry.fields.get('Title');
if (!existingValue || opts.overwriteExisti... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left applyStandardFields AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entry AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi... | private applyStandardFields(entry: KdbxEntry, preset: IPresetTemplate, opts: TemplateApplyOptions): void {
const fields = preset.standardFields;
if (fields.title !== undefined && fields.title !== '') {
const existingValue = entry.fields.get('Title');
if (!existingValue || opts.overwriteExisti... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/strategies/PresetTemplateStrategy.ets#L61-L98 | c1e39806a3287974f919ed515d20dcf4ff404df7 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Float.ets | arkts | toFloat | Returns the primitive as double value
@param value value to cast
@returns casted value | public static toFloat(value: float): float {
return value;
} | 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 toFloat AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#R... | public static toFloat(value: float): float {
return value;
} | https://gitcode.com/iop123123/arkts-static-skills | 7fe1417d6122e4cc24257dea9097d4cd96020f40 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets | arkts | constructor | Constructs a new NonIntegralIndexError instance with provided message and error specific information
@param { String } [message] - Error text
@param { ErrorOptions } [options] - Error options
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | constructor(message?: String, options?: ErrorOptions) {
super("NonIntegralIndexError", message, options)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#Left String AST#identi... | constructor(message?: String, options?: ErrorOptions) {
super("NonIntegralIndexError", message, options)
} | https://gitcode.com/iop123123/arkts-static-skills | 51d16ba77994a637c2e753aeb4e7298c8c09fe5d | gitcode |
openharmony-tpc/openharmony_tpc_samples | SmartRefreshLayout/library/src/main/ets/components/topRefresh/StackSmartRefresh.ets | arkts | refreshEnd | true 内容跟随偏移, false: 内容不偏移 | refreshEnd(location: number) { //重置Scroller
this.needScroller = true
this.model.refreshState = StackSmartRefresh.REFRESHSTATE.NONE
// let that = this
// if (location == StackSmartRefresh.LOCATION.HEAD) {
// that.model.scroller.scrollTo({
// xOffset: 0,
// yOffset: ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left refreshEnd AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left location AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#... | refreshEnd(location: number) { //重置Scroller
this.needScroller = true
this.model.refreshState = StackSmartRefresh.REFRESHSTATE.NONE
// let that = this
// if (location == StackSmartRefresh.LOCATION.HEAD) {
// that.model.scroller.scrollTo({
// xOffset: 0,
// yOffset: ... | https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git | f3549ad73ac385243563675e6cd627c256e021a2 | gitee |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/model/SessionState.ets | arkts | getUpdateCount | Get update count | getUpdateCount(): number {
return this.updateCount;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getUpdateCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#stateme... | getUpdateCount(): number {
return this.updateCount;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 38b886861ce8b70309776278f5f88a422ecde403 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets | arkts | exportNovelContentCache | 导出小说正文缓存 | private async exportNovelContentCache(): Promise<NovelContentCacheBackup[]> {
try {
const sql = 'SELECT * FROM novel_content_cache ORDER BY createTime DESC';
const results = await this.dbManager.querySql(sql);
const items: NovelContentCacheBackup[] = [];
for (const record of results) {
... | 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 exportNovelContentCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression... | private async exportNovelContentCache(): Promise<NovelContentCacheBackup[]> {
try {
const sql = 'SELECT * FROM novel_content_cache ORDER BY createTime DESC';
const results = await this.dbManager.querySql(sql);
const items: NovelContentCacheBackup[] = [];
for (const record of results) {
... | https://github.com/DaLongZhuaZi/manxia | c0f1376e76ad96368f14d96dc2f88cbae8824cb0 | github |
Joker-x-dev/CoolMallArkTS | core/util/src/main/ets/validation/ValidationUtil.ets | arkts | isValidImageCode | 验证图形验证码是否有效(4位数字或字母)
@param {string} code - 验证码
@returns {boolean} 是否有效 | static isValidImageCode(code: string): boolean {
if (code.length !== 4) {
return false;
}
for (let i = 0; i < code.length; i += 1) {
const current: string = code[i];
const isNumber: boolean = current >= "0" && current <= "9";
const isUpper: boolean = current >= "A" && current <= "Z... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isValidImageCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left code AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | static isValidImageCode(code: string): boolean {
if (code.length !== 4) {
return false;
}
for (let i = 0; i < code.length; i += 1) {
const current: string = code[i];
const isNumber: boolean = current >= "0" && current <= "9";
const isUpper: boolean = current >= "A" && current <= "Z... | https://github.com/Joker-x-dev/CoolMallArkTS | d5a4b800b85bdf58afdae65bcf9b7d43fed13143 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/json.ets | arkts | parseUpdate | Parses a JSON string and populates the fields of an existing instance,
with an optional reviver and parse options.
Unlike parse<T>(json, type), this does NOT require a default constructor.
Fields whose keys are absent from the JSON retain their current values
on the instance (merge semantics).
@param { string } json - ... | public static parseUpdate<T>(
json: string,
reviver: ((key: string, value: Any) => Any) | undefined,
instance: T,
options?: jsonx.ParseOptions
): T {
let bigIntOpt: int = options ? options.bigIntMode : 0
const jsonValue = UnifiedJsonParser.parseToJSONValue(json)
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#ERROR#Right AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left parseUpdate AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T ... | public static parseUpdate<T>(
json: string,
reviver: ((key: string, value: Any) => Any) | undefined,
instance: T,
options?: jsonx.ParseOptions
): T {
let bigIntOpt: int = options ? options.bigIntMode : 0
const jsonValue = UnifiedJsonParser.parseToJSONValue(json)
... | https://gitcode.com/iop123123/arkts-static-skills | 2232d4a23ceaee574339b5f4f728a7363534e41b | gitcode |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/AdaptiveBitrateService.ets | arkts | tryEnableServer | 尝试在服务端启用 ABR,返回是否成功 | private async tryEnableServer(): Promise<boolean> {
const config: AbrConfig = {
enabled: true,
minBitrate: this.minBitrate,
maxBitrate: this.maxBitrate,
mode: this.mode,
};
const ok = await this.nvHttp.setAbrMode(config);
console.info(`${TAG} 服务端 ABR 启用: ${ok ? '成功' : '失败'}`);
... | 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 tryEnableServer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A... | private async tryEnableServer(): Promise<boolean> {
const config: AbrConfig = {
enabled: true,
minBitrate: this.minBitrate,
maxBitrate: this.maxBitrate,
mode: this.mode,
};
const ok = await this.nvHttp.setAbrMode(config);
console.info(`${TAG} 服务端 ABR 启用: ${ok ? '成功' : '失败'}`);
... | https://github.com/AlkaidLab/moonlight-harmony | a4d36577d48fc02b2bec1749103838e161fadc29 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceValidator.ets | arkts | isRunning | 是否正在校验 | isRunning(): boolean {
return this.isValidating;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isRunning 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#statement... | isRunning(): boolean {
return this.isValidating;
} | https://github.com/DaLongZhuaZi/manxia | 3cc1eacce46144d55fddb268d53fd9364c768bff | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/app/tabs/classes/meowTabsBunch.ets | arkts | currentTabSearchResultCount | Gets the current tab search total result count. | get currentTabSearchResultCount() {
return this.currentTab?.searchResultCount;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left currentTabSearchResultCount 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#{#L... | get currentTabSearchResultCount() {
return this.currentTab?.searchResultCount;
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | d86db2c278bcc113a6b9ffa7ac4754950dbd500c | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | constructor | Creates an Uint8Array with respect to length.
@param { number } length - Number of elements
@throws { RangeError } - If the length is outside the bounds of the buffer, throw an exception
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public constructor(length: number) {
if (length < 0 || length > (Int.MAX_VALUE / Uint8Array.BYTES_PER_ELEMENT)) {
throw new RangeError("Range Error: length " + length + " is outside the bounds of the buffer")
}
this.lengthInt = length.toInt()
this.byteLengthInt = this.len... | 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#ERROR#Left AST#identifier#Left length AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu... | public constructor(length: number) {
if (length < 0 || length > (Int.MAX_VALUE / Uint8Array.BYTES_PER_ELEMENT)) {
throw new RangeError("Range Error: length " + length + " is outside the bounds of the buffer")
}
this.lengthInt = length.toInt()
this.byteLengthInt = this.len... | https://gitcode.com/iop123123/arkts-static-skills | ccf919b914e22e5c57df5b5390c73f87cb6e68e5 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/ItemTransitionAnimator.ets | arkts | isRunning | 获取动画状态 | public isRunning(): boolean {
return this.isAnimating;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isRunning 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 isRunning(): boolean {
return this.isAnimating;
} | https://github.com/DaLongZhuaZi/manxia | 5de9dfa675b9ea999002d852fea44d21cdd36756 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets | arkts | make | todo(kprokopenko): make varargs
Creates a new instance of this class using constructor matching provided arguments.
@param {FixedArray<Any>} args Constructor arguments.
@returns {Object} New instance of this class.
@throws {Error} If no matching constructor found or ambiguous.
@syscap SystemCapability.Utils.Lang
@FaAnd... | public make(args: FixedArray<Any>): Object {
const argTypes = new Array<Type>(args.length, (i) => {
return Type.of(args[i])
})
// collect all applicable constructors
const ctors = new Array<Method>()
const ctorNum = this.getConstructorsNum()
for (let i = 0... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left make AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left args AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO... | public make(args: FixedArray<Any>): Object {
const argTypes = new Array<Type>(args.length, (i) => {
return Type.of(args[i])
})
// collect all applicable constructors
const ctors = new Array<Method>()
const ctorNum = this.getConstructorsNum()
for (let i = 0... | https://gitcode.com/iop123123/arkts-static-skills | 5592aadeb21a2eb5bb3e0c523285e95e2b3efb20 | gitcode |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | generateCacheKey | ==================== 缓存管理 ====================
生成缓存键 | private generateCacheKey(
start: Position3D,
end: Position3D,
options: PathPlanningOptions
): string {
const startKey = `${Math.round(start.x)}_${Math.round(start.y)}_${Math.round(start.z)}`;
const endKey = `${Math.round(end.x)}_${Math.round(end.y)}_${Math.round(end.z)}`;
const optsKey = opt... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateCacheKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left start AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | private generateCacheKey(
start: Position3D,
end: Position3D,
options: PathPlanningOptions
): string {
const startKey = `${Math.round(start.x)}_${Math.round(start.y)}_${Math.round(start.z)}`;
const endKey = `${Math.round(end.x)}_${Math.round(end.y)}_${Math.round(end.z)}`;
const optsKey = opt... | https://github.com/LJ666-ui/harmony-health-care | e58ae846e46b4a0d5a2c51c23495daa258ce9bb7 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/microphone/MicrophoneManager.ets | arkts | toggleMicrophone | 切换麦克风状态 | async toggleMicrophone(): Promise<boolean> {
if (!this.microphoneStream) {
// 尝试初始化
if (!await this.initializeMicrophoneStream()) {
return false;
}
}
if (this.microphoneStream) {
return this.microphoneStream.toggle();
}
return false;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left toggleMicrophone AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Lef... | async toggleMicrophone(): Promise<boolean> {
if (!this.microphoneStream) {
// 尝试初始化
if (!await this.initializeMicrophoneStream()) {
return false;
}
}
if (this.microphoneStream) {
return this.microphoneStream.toggle();
}
return false;
} | https://github.com/AlkaidLab/moonlight-harmony | fed0ec094d5fe7c3f4b1ef03cb40b227b682385a | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | of | Creates a new Uint32Array using initializer
@param data initializer
@returns a new Uint32Array from data | public of(data: Object[]): Uint32Array {
throw new Error("Uint32Array.of: not implemented")
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left of AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | public of(data: Object[]): Uint32Array {
throw new Error("Uint32Array.of: not implemented")
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | e73e38a2d6eff81f9b2688b3c26a002f8b1ace67 | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/ComponentBase.ets | arkts | getYOffset | Returns the used offset on the x-axis for drawing the axis labels. This
offset is applied before and after the label.
@return | public getYOffset(): number {
return this.mYOffset;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getYOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#numb... | public getYOffset(): number {
return this.mYOffset;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | fae877f3db05f96e6aa722effac4d6e584ef7ba2 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ArrayBlockingQueue.ets | arkts | push | Inserts element at the end. If the queue is full, blocking.
@param { T } el the element to insert | override push(el: T): void {
ConcurrencyHelpers.mutexLock(this.mutex);
this.waitUntilQueueIsNotFull();
this.array[this.curTailIdx] = el;
this.increaseTailIdx();
ConcurrencyHelpers.condVarNotifyOne(this.condVar, this.mutex);
ConcurrencyHelpe... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left push AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left el AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#iden... | override push(el: T): void {
ConcurrencyHelpers.mutexLock(this.mutex);
this.waitUntilQueueIsNotFull();
this.array[this.curTailIdx] = el;
this.increaseTailIdx();
ConcurrencyHelpers.condVarNotifyOne(this.condVar, this.mutex);
ConcurrencyHelpe... | https://gitcode.com/iop123123/arkts-static-skills | 605c15f796a707f08b447856dde20e7e20c3a381 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/MainMenuPage.ets | arkts | getCustomShelfSortName | 获取排序方式名称 | private getCustomShelfSortName(): string {
switch (this.customShelfSortType) {
case 'name_asc': return 'A-Z';
case 'name_desc': return 'Z-A';
case 'recent': return '最近阅读';
case 'add_asc': return '添加时间↑';
case 'add_desc': return '添加时间↓';
default: return '排序';
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getCustomShelfSortName 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 ... | private getCustomShelfSortName(): string {
switch (this.customShelfSortType) {
case 'name_asc': return 'A-Z';
case 'name_desc': return 'Z-A';
case 'recent': return '最近阅读';
case 'add_asc': return '添加时间↑';
case 'add_desc': return '添加时间↓';
default: return '排序';
}
} | https://github.com/DaLongZhuaZi/manxia | 30dcec03e3bf416270250d2caab705a39335f497 | github |
openharmony-sig/amountinputtext | libamountinput/src/main/ets/widget/AmountInputKeyboardView.ets | arkts | getAmountTextParam | 获取每个键View的参数
@param index | getAmountTextParam(index: number) {
return { data: this.inputData[index],
callback: this.callback,
isBorderRadius: this.keyboardViewAttribute.isBorderRadius,
//中间的
isHorizontalPadding: (index < 8 && index % 3 == 1) ? true : false };
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getAmountTextParam AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier... | getAmountTextParam(index: number) {
return { data: this.inputData[index],
callback: this.callback,
isBorderRadius: this.keyboardViewAttribute.isBorderRadius,
//中间的
isHorizontalPadding: (index < 8 && index % 3 == 1) ? true : false };
} | https://gitee.com/openharmony-sig/amountinputtext.git | 5dd3234466036377bd13600db0c5090dbd142171 | gitee |
TDCQCX/ShiHuaMusic-Harmony | entry/src/main/ets/utils/PreferencesUtil.ets | arkts | putString | 存储字符串值
@param key 键
@param value 值 | static async putString(key: string, value: string): Promise<void> {
try {
const prefs = await PreferencesUtil.getPreferences();
await prefs.put(key, value);
await prefs.flush();
} catch (error) {
console.error(`存储字符串失败: ${key}`, error);
throw error;
}
} | 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 putString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Ri... | static async putString(key: string, value: string): Promise<void> {
try {
const prefs = await PreferencesUtil.getPreferences();
await prefs.put(key, value);
await prefs.flush();
} catch (error) {
console.error(`存储字符串失败: ${key}`, error);
throw error;
}
} | https://github.com/TDCQCX/ShiHuaMusic-Harmony | 452d0c899114e9502483e0b7f5ec4b1f7eb9b3aa | github |
751496032/ZRouter | RouterApi/src/main/ets/animation/NavAnimationMgr.ets | arkts | getNavigationIndicatorHeightPx | 获取导航栏高度
@returns | public getNavigationIndicatorHeightPx(): number {
return WindowUtils.navigationIndicatorHeight_px
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getNavigationIndicatorHeightPx 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#... | public getNavigationIndicatorHeightPx(): number {
return WindowUtils.navigationIndicatorHeight_px
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/animation/NavAnimationMgr.ets#L211-L213 | 2382448de16fbf65946c8a098de74784b8cec8df | github |
ibestservices/ibest-ui | library/src/main/ets/components/sectorProgress/index.ets | arkts | startDrawAnimation | 开始绘制扇形 | startDrawAnimation() {
if (this.timer !== -1) {
clearTimeout(this.timer)
}
let targetAngle = this.value * 360 / this.target
if(this.curAngle == targetAngle){
return
}
const step = targetAngle > this.curAngle ? 5 : -5
const animate = () ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startDrawAnimation 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... | startDrawAnimation() {
if (this.timer !== -1) {
clearTimeout(this.timer)
}
let targetAngle = this.value * 360 / this.target
if(this.curAngle == targetAngle){
return
}
const step = targetAngle > this.curAngle ? 5 : -5
const animate = () ... | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/sectorProgress/index.ets#L106-L128 | 5fd0991d6972d63c372cd347bcaf14b15b8cff7d | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/ImageCacheManager.ets | arkts | loadImage | 加载图片(三级缓存) | public async loadImage(url: string, options?: LoadOptions): Promise<image.PixelMap | null> {
try {
const cacheKey = this.generateCacheKey(url, options);
// 检查是否正在加载
if (this.loadingTasks.has(cacheKey)) {
return await this.loadingTasks.get(cacheKey)!;
}
// 创建加载任务... | 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 loadImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Ri... | public async loadImage(url: string, options?: LoadOptions): Promise<image.PixelMap | null> {
try {
const cacheKey = this.generateCacheKey(url, options);
// 检查是否正在加载
if (this.loadingTasks.has(cacheKey)) {
return await this.loadingTasks.get(cacheKey)!;
}
// 创建加载任务... | https://github.com/DaLongZhuaZi/manxia | b527587c222721d79d7d2b11bead8b02045389fa | github |
openharmony-sig/flutter_packages | packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/CameraUtils.ets | arkts | getMinExposureBias | 查询最小曝光补偿值 | public static getMinExposureBias(captureSession: camera.PhotoSession | camera.VideoSession): number {
let minExposure: number = -10;
try {
let biasRangeArray = captureSession.getExposureBiasRange();
if (biasRangeArray.length > 1) {
minExposure = biasRangeArray[0];
}
} catch (erro... | 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 getMinExposureBias AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#member_expression#Left AST#identifier#Le... | public static getMinExposureBias(captureSession: camera.PhotoSession | camera.VideoSession): number {
let minExposure: number = -10;
try {
let biasRangeArray = captureSession.getExposureBiasRange();
if (biasRangeArray.length > 1) {
minExposure = biasRangeArray[0];
}
} catch (erro... | https://gitee.com/openharmony-sig/flutter_packages.git | d3a9157fdad54ce013fc457b8ea43b3de308970e | gitee |
LZZLHY/hlib | entry/src/main/ets/storage/ReadingPositionStore.ets | arkts | save | 写单本进度。低于 0 视为 0;高于 100 视为 100。 | static async save(bookId: string, percent: number): Promise<void> {
if (bookId.length === 0) {
return;
}
const map = await ReadingPositionStore.loadAll();
let p: number = percent;
if (!Number.isFinite(p)) {
p = 0;
}
if (p < 0) {
p = 0;
} else if (p > 100) {
p = ... | 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 save AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bookId AST#identifier#Right AST#:#Left : AST#:#Righ... | static async save(bookId: string, percent: number): Promise<void> {
if (bookId.length === 0) {
return;
}
const map = await ReadingPositionStore.loadAll();
let p: number = percent;
if (!Number.isFinite(p)) {
p = 0;
}
if (p < 0) {
p = 0;
} else if (p > 100) {
p = ... | https://github.com/LZZLHY/hlib | f0bf3557f3133860ade61e384e4e63ce84d8222f | github |
HarmonyOS_Samples/MusicHome | features/player/src/main/ets/util/PlayerDataUtil.ets | arkts | getPlayMode | Current repeat / order / shuffle policy from MediaService. | public static getPlayMode(): MusicPlayMode {
return MediaService.getInstance().getPlayMode();
} | 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 getPlayMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L... | public static getPlayMode(): MusicPlayMode {
return MediaService.getInstance().getPlayMode();
} | https://gitcode.com/HarmonyOS_Samples/MusicHome | d694ca0181995f89027c16acf9fab8293321f5e5 | gitcode |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/service/SharedLedgerService.ets | arkts | createLedger | ==================== 账本管理 ====================
创建共享账本 | static async createLedger(params: CreateLedgerParams): Promise<number> {
try {
const ledger = new SharedLedger();
ledger.name = params.name;
ledger.description = params.description || '';
ledger.type = params.type;
ledger.ownerId = params.ownerId;
ledger.ownerName = params.owne... | 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 createLedger AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left params AST#identifier#Right AST#:#Left : AS... | static async createLedger(params: CreateLedgerParams): Promise<number> {
try {
const ledger = new SharedLedger();
ledger.name = params.name;
ledger.description = params.description || '';
ledger.type = params.type;
ledger.ownerId = params.ownerId;
ledger.ownerName = params.owne... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 28db12549874304c10f2f1389187abbb05e6b126 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/MainMenuPage.ets | arkts | getCustomShelfMixedItems | 获取自定义书架混合内容列表(应用排序和筛选,动态书架使用实时过滤) | private getCustomShelfMixedItems(): ShelfMixedItem[] {
if (this.selectedShelf === null) return [];
// 动态书架:使用实时匹配结果,并应用用户的标签/作者筛选
if (this.selectedShelf.shelfType === ShelfType.DYNAMIC) {
let items = this.dynamicShelfMatchedItems.length > 0
? this.dynamicShelfMatchedItems.slice()
: ... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getCustomShelfMixedItems 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... | private getCustomShelfMixedItems(): ShelfMixedItem[] {
if (this.selectedShelf === null) return [];
// 动态书架:使用实时匹配结果,并应用用户的标签/作者筛选
if (this.selectedShelf.shelfType === ShelfType.DYNAMIC) {
let items = this.dynamicShelfMatchedItems.length > 0
? this.dynamicShelfMatchedItems.slice()
: ... | https://github.com/DaLongZhuaZi/manxia | 4bdf9601b3ede03de87d6f7aa5a72b29ca34da97 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Lifecycle/GlobalTaskCoordinator.ets | arkts | getAllPageIds | 获取所有页面 ID | getAllPageIds(): string[] {
return Array.from(this.pageManagers.keys());
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getAllPageIds 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 ... | getAllPageIds(): string[] {
return Array.from(this.pageManagers.keys());
} | https://github.com/DaLongZhuaZi/manxia | 30ac9cd3eb23c9cdff4df1d649436bdc6f931e19 | github |
iHongRen/harmony-study-demo | entry/src/main/ets/pages/selectabletext/SelectableDemo.ets | arkts | getMenus | 覆盖父类方法,消息的弹出菜单项
@returns 菜单数组 | public getMenus(): SelectableMenuItem[] {
const menus: SelectableMenuItem[] = []
if (this.canCopy()) {
menus.push({
title: '复制',
icon: $r("app.media.copy"),
action: () => {
// 复制文本到剪贴板
const text = this.copyText()
// TODO: 调用系统复制API
// ...... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getMenus 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 SelectableMen... | public getMenus(): SelectableMenuItem[] {
const menus: SelectableMenuItem[] = []
if (this.canCopy()) {
menus.push({
title: '复制',
icon: $r("app.media.copy"),
action: () => {
// 复制文本到剪贴板
const text = this.copyText()
// TODO: 调用系统复制API
// ...... | https://github.com/iHongRen/harmony-study-demo | 2d6e67ee24b5f4a3fb8beea21a69653ff6cad789 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Services/DataService.ets | arkts | isFavorited | 检查是否已收藏 | public async isFavorited(comicId: string): Promise<boolean> {
try {
const favorites = await this.dataManager.getUserFavorites(this.currentUserId);
return favorites.some(fav => fav.comicId === comicId);
} catch (error) {
logger.error(TAG, '检查收藏状态失败' + String(error));
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 isFavorited AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left comicId AST#identifier#Right AST#ERROR#Left AST#:#Left : AS... | public async isFavorited(comicId: string): Promise<boolean> {
try {
const favorites = await this.dataManager.getUserFavorites(this.currentUserId);
return favorites.some(fav => fav.comicId === comicId);
} catch (error) {
logger.error(TAG, '检查收藏状态失败' + String(error));
return false;
}... | https://github.com/DaLongZhuaZi/manxia | 7e789811a4810b04e8761d12bb6a901c09a12ced | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | forEach | Performs the specified action for each element in Int16Array
@param { function } callbackfn - A function that accepts up to three arguments. forEach calls the
callbackfn function one time for each element in the array.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public forEach(callbackfn: (value: number, index: int, array: Int16Array) => void): void {
for (let i = 0; i < this.lengthInt; ++i) {
callbackfn((this.getUnsafe(i)).toDouble(), i, this)
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#expression_statement#Left AST#identifier#Left forEach AST#identifier#Right AST#ERROR#Left AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Ri... | public forEach(callbackfn: (value: number, index: int, array: Int16Array) => void): void {
for (let i = 0; i < this.lengthInt; ++i) {
callbackfn((this.getUnsafe(i)).toDouble(), i, this)
}
} | https://gitcode.com/iop123123/arkts-static-skills | c95e00b117fc3511e0897e4175205a068bb52f8e | gitcode |
Countly/countly-sdk-hos | library/src/main/ets/internal/Utils.ets | arkts | sanitizeSegmentation | Validates and sanitizes a segmentation map by dropping unsupported types
and enforcing key/value length limits. Returns a fresh copy. | public static sanitizeSegmentation(
input: SegmentationMap | null | undefined,
maxKeyLen: number,
maxValueLen: number,
maxEntries: number,
onDrop?: (reason: string) => void
): SegmentationMap {
const out: SegmentationMap = {};
if (!input) return out;
// First pass: filter/normalize e... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#identifier#Left sanitizeSegmentation AST#identifier#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary... | public static sanitizeSegmentation(
input: SegmentationMap | null | undefined,
maxKeyLen: number,
maxValueLen: number,
maxEntries: number,
onDrop?: (reason: string) => void
): SegmentationMap {
const out: SegmentationMap = {};
if (!input) return out;
// First pass: filter/normalize e... | https://github.com/Countly/countly-sdk-hos | 522457560c0688699d02248943f18ec35fd51c78 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/PreferencesService.ets | arkts | getNotifyEnabled | 获取通知总开关 | async getNotifyEnabled(): Promise<boolean> {
return await this.getBoolean(PreferenceKeys.NOTIFY_ENABLED, true)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getNotifyEnabled 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#gen... | async getNotifyEnabled(): Promise<boolean> {
return await this.getBoolean(PreferenceKeys.NOTIFY_ENABLED, true)
} | https://github.com/LongLiveY96/chatcube | 62531421fe7d608f12be24fdfe40b22a974b4f92 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/rag/VectorRetriever.ets | arkts | cosineSimilarity | 余弦相似度 | private cosineSimilarity(vec1: number[], vec2: number[]): number {
if (vec1.length !== vec2.length) {
return 0;
}
let dotProduct = 0;
let norm1 = 0;
let norm2 = 0;
for (let i = 0; i < vec1.length; i++) {
dotProduct += vec1[i] * vec2[i];
norm1 += vec1[i] * vec1[i];
nor... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left cosineSimilarity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left vec1 AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_ex... | private cosineSimilarity(vec1: number[], vec2: number[]): number {
if (vec1.length !== vec2.length) {
return 0;
}
let dotProduct = 0;
let norm1 = 0;
let norm2 = 0;
for (let i = 0; i < vec1.length; i++) {
dotProduct += vec1[i] * vec2[i];
norm1 += vec1[i] * vec1[i];
nor... | https://github.com/LJ666-ui/harmony-health-care | 4210ced2fbf7fa22dfff32151b7cf05a37c690ec | github |
openharmony/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ChartData.ets | arkts | getYMax | Returns the maximum y-value for the specified axis.
@param axis
@return | public getYMax(axis?: AxisDependency): number {
if (axis == null) {
return this.mYMax;
}
if (axis == AxisDependency.LEFT) {
if (this.mLeftAxisMax == -Number.MAX_VALUE) {
return this.mRightAxisMax;
} else {
return this.mLeftA... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getYMax AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left axis AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST... | public getYMax(axis?: AxisDependency): number {
if (axis == null) {
return this.mYMax;
}
if (axis == AxisDependency.LEFT) {
if (this.mLeftAxisMax == -Number.MAX_VALUE) {
return this.mRightAxisMax;
} else {
return this.mLeftA... | https://gitee.com/openharmony/developtools_profiler.git | dfb3ac66cc81a94e76e3c2314b88ece9a0b4a7b1 | gitee |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/service/SharedLedgerService.ets | arkts | getLedgerDetail | 获取账本详情 | static async getLedgerDetail(ledgerId: number): Promise<SharedLedger | null> {
try {
return await SharedLedgerDAO.getById(ledgerId);
} catch (error) {
console.error('[SharedLedgerService] 获取账本详情失败:', error);
return null;
}
} | 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 getLedgerDetail AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ledgerId AST#identifier#Right AST#ERROR#Left AST#:#Left... | static async getLedgerDetail(ledgerId: number): Promise<SharedLedger | null> {
try {
return await SharedLedgerDAO.getById(ledgerId);
} catch (error) {
console.error('[SharedLedgerService] 获取账本详情失败:', error);
return null;
}
} | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | fad5df6da66dd3638780d902d8a40c089fb26131 | github |
CPF-ApplicationTPC/openharmony_tpc_samples | SwipeMenuListView/library/src/main/ets/utils/AnimationInterpolator.ets | arkts | accelerateDecelerate | 加速减速插值器
动画开始和结束慢,中间快 | static accelerateDecelerate(): curves.ICurve {
return curves.cubicBezierCurve(0.4, 0, 0.6, 1);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left accelerateDecelerate 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#member_expression... | static accelerateDecelerate(): curves.ICurve {
return curves.cubicBezierCurve(0.4, 0, 0.6, 1);
} | https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples | b374a73d85503f0d3f091084ea2364ae6256f008 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/ImageCacheManager.ets | arkts | preloadImage | 预加载图片(仅下载到缓存,不返回PixelMap)
用于后台预加载,减少首次显示时的加载时间 | public async preloadImage(url: string, options?: LoadOptions): Promise<void> {
try {
// [修复] 本地文件不需要预加载,直接跳过
if (this.isLocalFilePath(url)) {
logger.debug(TAG, `跳过本地文件预加载: ${url.substring(0, 80)}`);
return;
}
if (this.hasRemoteProviderCacheContext(options)) {
const... | 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 preloadImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:... | public async preloadImage(url: string, options?: LoadOptions): Promise<void> {
try {
// [修复] 本地文件不需要预加载,直接跳过
if (this.isLocalFilePath(url)) {
logger.debug(TAG, `跳过本地文件预加载: ${url.substring(0, 80)}`);
return;
}
if (this.hasRemoteProviderCacheContext(options)) {
const... | https://github.com/DaLongZhuaZi/manxia | 93d9434fa448e6dc6ecbf44f5560d08b69036ef2 | github |
LambdaYH/ScrcpyForHarmonyOS | app/src/main/ets/client/tools/ControlPacket.ets | arkts | createInjectTouchEvent | ============ TYPE_INJECT_TOUCH_EVENT (2) ============
格式: type(1) + action(1) + pointerId(8) + x(4) + y(4) + screenWidth(2) + screenHeight(2) + pressure(2) + actionButton(4) + buttons(4) = 32 bytes | static createInjectTouchEvent(
action: number,
pointerId: bigint,
x: number,
y: number,
screenWidth: number,
screenHeight: number,
pressure: number = 1.0,
actionButton: number = 0,
buttons: number = 0
): ArrayBuffer {
const buf = new ArrayBuffer(32);
const view = new... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createInjectTouchEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif... | static createInjectTouchEvent(
action: number,
pointerId: bigint,
x: number,
y: number,
screenWidth: number,
screenHeight: number,
pressure: number = 1.0,
actionButton: number = 0,
buttons: number = 0
): ArrayBuffer {
const buf = new ArrayBuffer(32);
const view = new... | https://github.com/LambdaYH/ScrcpyForHarmonyOS | 274eb1ae5298a09843fe605ac876043178baff6b | github |
OHPG/FinMusic | entry/src/main/ets/player/LyricCache.ets | arkts | fetchAndWrite | 拉取歌词并写入指定路径 | private async fetchAndWrite(filePath: string, fetcher: () => Promise<LyricDto | undefined>): Promise<string | undefined> {
let lyricDto = await fetcher()
if (!lyricDto) {
return undefined
}
let lrcContent = LrcParser.toLrc(lyricDto)
if (!lrcContent) {
return undefined
}
FileT... | 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 fetchAndWrite AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Lef... | private async fetchAndWrite(filePath: string, fetcher: () => Promise<LyricDto | undefined>): Promise<string | undefined> {
let lyricDto = await fetcher()
if (!lyricDto) {
return undefined
}
let lrcContent = LrcParser.toLrc(lyricDto)
if (!lrcContent) {
return undefined
}
FileT... | https://github.com/OHPG/FinMusic | 895e415eba32841517e9fd76d294826f2e3d8baa | github |
SMAT-Lab/ArkAnalyzer-HapRay | test_hap/entry/src/main/ets/common/TestRunner.ets | arkts | getAvailableTestSuites | 获取所有可用测试模块信息 | async getAvailableTestSuites(): Promise<Array<TestSuite>> {
await this.initialize();
return Array.from(this.testSuites.values());
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getAvailableTestSuites AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_paramet... | async getAvailableTestSuites(): Promise<Array<TestSuite>> {
await this.initialize();
return Array.from(this.testSuites.values());
} | https://github.com/SMAT-Lab/ArkAnalyzer-HapRay | e1c4779d51726ec41f6a4d4bfb9cc390f5568056 | github |
Dabing-0x19d/berverage_HarmonyOS6.0 | entry/src/main/ets/model/linechart.ets | arkts | calculateConcentration | 45分钟
计算指定时间点的咖啡因浓度 | function calculateConcentration(intakeTime: number, caffeineAmount: number, currentTime: number): number {
if (currentTime < intakeTime) {
return 0
}
const elapsedTime = currentTime - intakeTime
const k = Math.log(2) / CAFFEINE_HALF_LIFE
const bloodVolume: number = 5
const peakConcentration = (caffeine... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left calculateConcentration AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left intakeTime AST#identifier#Right AST#type_annotation#Left AST#:#... | function calculateConcentration(intakeTime: number, caffeineAmount: number, currentTime: number): number {
if (currentTime < intakeTime) {
return 0
}
const elapsedTime = currentTime - intakeTime
const k = Math.log(2) / CAFFEINE_HALF_LIFE
const bloodVolume: number = 5
const peakConcentration = (caffeine... | https://github.com/Dabing-0x19d/berverage_HarmonyOS6.0 | b8d3a3763d30208a54b33339a2918a9c52bd694f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoUrlAnalyzer.ets | arkts | executeJsAsync | 异步JS执行(强制使用LegadoJsEngine的Native JSVM) | private async executeJsAsync(jsCode: string, result?: string): Promise<JsExecutionOutcome> {
// 直接使用JS引擎执行,不再使用简单执行绕过JSVM
try {
const jsEngine = getLegadoJsEngine();
const activeJsLib = this.shouldLoadJsLibForUrlRule(jsCode) ? this.jsLib : '';
const context: JsContext = this.buildJsContext(r... | 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 executeJsAsync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left jsCode AST#identifier#Right AST#:#Left... | private async executeJsAsync(jsCode: string, result?: string): Promise<JsExecutionOutcome> {
// 直接使用JS引擎执行,不再使用简单执行绕过JSVM
try {
const jsEngine = getLegadoJsEngine();
const activeJsLib = this.shouldLoadJsLibForUrlRule(jsCode) ? this.jsLib : '';
const context: JsContext = this.buildJsContext(r... | https://github.com/DaLongZhuaZi/manxia | 8e923541ea11b20c0dd2d77534859946cc8194b5 | github |
harmonyos/codelabs | HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/service/ReminderAgent.ets | arkts | cancelReminder | cancelReminder | function cancelReminder(reminderId: number, context: Context) {
if (!reminderId) {
Logger.error(Const.REMINDER_AGENT_TAG, 'cancelReminder reminderId is empty');
return;
}
let reminder: string = reminderId.toString();
hasPreferencesValue(context, reminder, (preferences: preferences.Preferences, hasValue:... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left cancelReminder AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left reminderId AST#identifier#Right AST#type_annotation#Left AST#:#Left : A... | function cancelReminder(reminderId: number, context: Context) {
if (!reminderId) {
Logger.error(Const.REMINDER_AGENT_TAG, 'cancelReminder reminderId is empty');
return;
}
let reminder: string = reminderId.toString();
hasPreferencesValue(context, reminder, (preferences: preferences.Preferences, hasValue:... | https://gitee.com/harmonyos/codelabs.git | 3ff03e3bbe0a7d7824f15b68760a2b7d597ae184 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets | arkts | exportMangaReadProgress | 导出漫画阅读进度
[修复] 使用正确的数据库字段名:pageNumber而非pageIndex | private async exportMangaReadProgress(): Promise<MangaReadProgressBackup[]> {
try {
const sql = 'SELECT * FROM read_history';
const results = await this.dbManager.querySql(sql);
const progress: MangaReadProgressBackup[] = [];
for (const record of results) {
const rec = recor... | 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 exportMangaReadProgress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression... | private async exportMangaReadProgress(): Promise<MangaReadProgressBackup[]> {
try {
const sql = 'SELECT * FROM read_history';
const results = await this.dbManager.querySql(sql);
const progress: MangaReadProgressBackup[] = [];
for (const record of results) {
const rec = recor... | https://github.com/DaLongZhuaZi/manxia | 9477cfebc1d9042afab91ec099522672936acb9d | github |
YANGZX22/Voot | entry/src/main/ets/pages/Index.ets | arkts | onWidgetReadingToggle | Widget Reading toggle handler | onWidgetReadingToggle(): void {
// Ignore if component not ready or if this is the same trigger we already handled
if (!this.isComponentReady || this.widgetReadingToggle === 0 || this.widgetReadingToggle === this.lastWidgetReadingToggle) {
return;
}
this.lastWidgetReadingToggle = this.widgetRead... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onWidgetReadingToggle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expr... | onWidgetReadingToggle(): void {
// Ignore if component not ready or if this is the same trigger we already handled
if (!this.isComponentReady || this.widgetReadingToggle === 0 || this.widgetReadingToggle === this.lastWidgetReadingToggle) {
return;
}
this.lastWidgetReadingToggle = this.widgetRead... | https://github.com/YANGZX22/Voot | 072b10fb2b1e26a8850bbfd51dffce9207bd6693 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | toReversed | Creates a reversed copy
@returns { Uint8ClampedArray } - a reversed copy
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public toReversed(): Uint8ClampedArray {
let newArray = new Uint8ClampedArray(this.lengthInt)
if (this.lengthInt > 0) {
Uint8ClampedArray.reverseCopyBuffer(newArray.buffer, this.buffer, this.byteOffset, this.lengthInt);
}
return newArray
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toReversed 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 Uint8Clampe... | public toReversed(): Uint8ClampedArray {
let newArray = new Uint8ClampedArray(this.lengthInt)
if (this.lengthInt > 0) {
Uint8ClampedArray.reverseCopyBuffer(newArray.buffer, this.buffer, this.byteOffset, this.lengthInt);
}
return newArray
} | https://gitcode.com/iop123123/arkts-static-skills | 8c8c6395996b8cb6aa64eb2465da5991a555721f | gitcode |
ccccjiemo/gles | src/main/ets/globjects/GLBuffer.ets | arkts | mapBufferRange | @param offset
@param length
@param access GL_MAP_READ_BIT / GL_MAP_WRITE_BIT
@returns | mapBufferRange(offset: number, length: number, access: number): ArrayBuffer {
this.bind();
return glMapBufferRange(this.type, offset, length, access);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left mapBufferRange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left offset AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left ... | mapBufferRange(offset: number, length: number, access: number): ArrayBuffer {
this.bind();
return glMapBufferRange(this.type, offset, length, access);
} | https://github.com/ccccjiemo/gles | 016808ec12645e7610c3b3a81e73b09276715f6f | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ets | arkts | getCommonFactor | Gets the greatest common divisor of two specified integers.
@param { long } firNum the integer.
@param { long } SecNum the integer.
@returns { long } returns the greatest common divisor of firNum and SecNum. | static getCommonFactor(firNum: long, SecNum: long): long {
if (firNum === 0 || SecNum === 0) {
throw createBusinessError(TypeErrorCodeId,
`Parameter error. The Parameter cannot be zero`);
}
return RationalNumber.getGCD(firNum, SecNum);
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCommonFactor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left firNum AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left long AST#ident... | static getCommonFactor(firNum: long, SecNum: long): long {
if (firNum === 0 || SecNum === 0) {
throw createBusinessError(TypeErrorCodeId,
`Parameter error. The Parameter cannot be zero`);
}
return RationalNumber.getGCD(firNum, SecNum);
... | https://gitcode.com/iop123123/arkts-static-skills | f113a35add440128bb4e0a9140b4b4804b8cdf63 | gitcode |
openharmony/codelabs | ETSUI/ContactManager/entry/src/main/ets/pages/ContactListPage.ets | arkts | groupContacts | 对联系人进行分组 | groupContacts(contacts: Contact[]): ContactGroup[] {
const groupMap = new Map<string, Contact[]>()
// 按首字母分组
contacts.forEach((contact: Contact) => {
const letter = this.getFirstLetter(contact.name)
if (!groupMap.has(letter)) {
groupMap.set(letter, [])
}
const group = grou... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left groupContacts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left contacts AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left Contact ... | groupContacts(contacts: Contact[]): ContactGroup[] {
const groupMap = new Map<string, Contact[]>()
// 按首字母分组
contacts.forEach((contact: Contact) => {
const letter = this.getFirstLetter(contact.name)
if (!groupMap.has(letter)) {
groupMap.set(letter, [])
}
const group = grou... | https://gitcode.com/openharmony/codelabs | 98b6d278c146047ef3d307efd4a50122ee2237d8 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/StringBuilder.ets | arkts | append | Appends a short as string to the builder's internal buffer
@param i value to be appended
@returns builder with updated internal buffer | public append(i: short): StringBuilder {
this.append(StringBuilder.toString(i));
return this;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left append AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left i AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left short AST#id... | public append(i: short): StringBuilder {
this.append(StringBuilder.toString(i));
return this;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | a3962557336c26148261ceb08bf6deabe53d3bba | gitee |
offlinecat-dev/OCNetORM | src/main/ets/mapping/EntityData.ets | arkts | getTransient | 获取临时数据
@param key 键名
@returns 值,如果不存在返回 null | getTransient(key: string): ValueType {
const value = this.transientData.get(key)
if (value === undefined) {
return null
}
return value
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getTransient AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST... | getTransient(key: string): ValueType {
const value = this.transientData.get(key)
if (value === undefined) {
return null
}
return value
} | https://github.com/offlinecat-dev/OCNetORM | 5494687894600d866b180d84f6393e30f5c5f95f | github |
TDCQCX/ShiHuaMusic-Harmony | entry/src/main/ets/utils/PreferencesUtil.ets | arkts | init | 初始化PreferencesUtil
@param context 应用上下文 | static init(context: Context): void {
PreferencesUtil.context = context;
PreferencesUtil.initPromise = null; // 重置初始化状态
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left init AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#E... | static init(context: Context): void {
PreferencesUtil.context = context;
PreferencesUtil.initPromise = null; // 重置初始化状态
} | https://github.com/TDCQCX/ShiHuaMusic-Harmony | c75251cdf33820c7fc46c1b5092dd112b4f71919 | github |
openharmony-sig/online_event | college_growth_program/homework/三期成长打卡作业/2022_0113/crusie/笔记和作业-0113-张煜华/code/ice1/entry/src/main/ets/MainAbility/pages/music2.ets | arkts | onPreviousMusic | 播放前一首 | onPreviousMusic() {
CommonLog.info("Play previous music")
if (this.isSwitching) {
CommonLog.info('onPreviousMusic ignored, isSwitching');
return;
}
this.isSwitching = true
this.playerManager.playPreviousMusic()
this.playAnimation()
this.isPlaying = true
this.isSwitching = ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPreviousMusic 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#Le... | onPreviousMusic() {
CommonLog.info("Play previous music")
if (this.isSwitching) {
CommonLog.info('onPreviousMusic ignored, isSwitching');
return;
}
this.isSwitching = true
this.playerManager.playPreviousMusic()
this.playAnimation()
this.isPlaying = true
this.isSwitching = ... | https://gitee.com/openharmony-sig/online_event.git | f5990d5f041ea773b6b259cb7efdb0a659606559 | gitee |
the-wwyang/kids-learning-app | src/main/ets/services/ParentalControlService.ets | arkts | getTimeLimitConfig | 获取时间限制配置 | public async getTimeLimitConfig(): Promise<TimeLimitConfig> {
if (!this.dataPreferences) {
return this.getDefaultTimeLimitConfig();
}
try {
const configJson = await this.dataPreferences.get(
ParentalControlService.TIME_LIMIT_CONFIG_KEY,
''
) as string;
if (configJ... | 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 getTimeLimitConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A... | public async getTimeLimitConfig(): Promise<TimeLimitConfig> {
if (!this.dataPreferences) {
return this.getDefaultTimeLimitConfig();
}
try {
const configJson = await this.dataPreferences.get(
ParentalControlService.TIME_LIMIT_CONFIG_KEY,
''
) as string;
if (configJ... | https://github.com/the-wwyang/kids-learning-app | c58cab726ad660540e6c8274ab7e359881ba559d | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/NvHttp.ets | arkts | getHttpBaseUrl | 获取 HTTP 基础 URL | private getHttpBaseUrl(): string {
return `http://${formatAddressForUrl(this.address)}:${this.httpPort}`;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getHttpBaseUrl 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 A... | private getHttpBaseUrl(): string {
return `http://${formatAddressForUrl(this.address)}:${this.httpPort}`;
} | https://github.com/AlkaidLab/moonlight-harmony | bc09a84a7e0c4b5020767c4be4a1a9995d7adf7c | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/BarLineChartBaseModel.ets | arkts | getLowestVisibleX | Returns the lowest x-index (value on the x-axis) that is still visible on
the chart.
@return | public getLowestVisibleX(): number {
let transformer: Transformer | null = this.getTransformer(AxisDependency.LEFT);
if (transformer) {
transformer.getValuesByTouchPoint(this.mViewPortHandler.contentLeft(),
this.mViewPortHandler.contentBottom(), this.posForGetLowestVisibleX);
}
let resul... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLowestVisibleX 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 A... | public getLowestVisibleX(): number {
let transformer: Transformer | null = this.getTransformer(AxisDependency.LEFT);
if (transformer) {
transformer.getValuesByTouchPoint(this.mViewPortHandler.contentLeft(),
this.mViewPortHandler.contentBottom(), this.posForGetLowestVisibleX);
}
let resul... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 543a81dcb6af456ede1a717f28b99d5f20fa7bb9 | gitee |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/common/constants/ApiConstants.ets | arkts | topicNotificationLevel | 更新话题通知级别 | static topicNotificationLevel(id: number): string {
return `/t/${id}/notifications`;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left topicNotificationLevel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | static topicNotificationLevel(id: number): string {
return `/t/${id}/notifications`;
} | https://github.com/Amaz1ny/HarmonyDO-public | 6a7b64b253fe3b1c38c8241c8cc2f544a58c43a9 | github |
harmonyos/codelabs | HarmonyOS_NEXT/SimpleCalculator/entry/src/main/ets/pages/HomePage.ets | arkts | resultFormat | Number Formatting.
@param value Formatting parameters.
@return Thousand percentile data. | resultFormat(value: string) {
let reg = (value.indexOf('.') > -1) ? new RegExp("/(\d)(?=(\d{3})+\.)/g") : new RegExp("/(\d)(?=(?:\d{3})+$)/g");
return value.replace(reg, '$1,');
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left resultFormat AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right... | resultFormat(value: string) {
let reg = (value.indexOf('.') > -1) ? new RegExp("/(\d)(?=(\d{3})+\.)/g") : new RegExp("/(\d)(?=(?:\d{3})+$)/g");
return value.replace(reg, '$1,');
} | https://gitee.com/harmonyos/codelabs.git | 0e83571a168c7d4e40b92993cc65b2ae56472204 | gitee |
CLMC2025/Vignette | entry/src/main/ets/ui/Animations.ets | arkts | isAnimating | 检查是否正在动画 | isAnimating(key: string): boolean {
const state = this.animationStates.get(key);
return state !== undefined && state.isAnimating;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isAnimating AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#... | isAnimating(key: string): boolean {
const state = this.animationStates.get(key);
return state !== undefined && state.isAnimating;
} | https://github.com/CLMC2025/Vignette | a6b38cdd49ed036db73c6b505770813f8fa92a7c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/CoverCacheManager.ets | arkts | countDirectoryStats | 计算目录统计信息 | private countDirectoryStats(dirPath: string): CoverStats {
try {
const files = SafeFileUtils.listFileSync(dirPath);
let totalSize = 0;
for (const fileName of files) {
const filePath = `${dirPath}/${fileName}`;
try {
const stat = SafeFileUtils.statSync(filePath);
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left countDirectoryStats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left dirPath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST... | private countDirectoryStats(dirPath: string): CoverStats {
try {
const files = SafeFileUtils.listFileSync(dirPath);
let totalSize = 0;
for (const fileName of files) {
const filePath = `${dirPath}/${fileName}`;
try {
const stat = SafeFileUtils.statSync(filePath);
... | https://github.com/DaLongZhuaZi/manxia | 0b9aaa67aa72108b1744c7e3946c31b1f3298c0a | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/component/GoodsDetailRichHeader.ets | arkts | build | 构建商品详情图文标题
@returns {void} 无返回值 | build(): void {
ColumnStart({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_medium"),
right: $r("app.float.space_horizontal_medium")
}
}) {
IBestCellGroup({
inset: true,
radius: {
topLeft: $r("app.float.radius_medium"),... | 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#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#... | build(): void {
ColumnStart({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_medium"),
right: $r("app.float.space_horizontal_medium")
}
}) {
IBestCellGroup({
inset: true,
radius: {
topLeft: $r("app.float.radius_medium"),... | https://github.com/Joker-x-dev/CoolMallArkTS | ea690ab8cc16ae9c1877b9d3e7466334caf65d45 | github |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/AccountManager.ets | arkts | hasReferencedBills | 判断账户是否已被任意账单引用,用于删除前保护。 | static async hasReferencedBills(name: string): Promise<boolean> {
const sourceMatched: boolean = await AccountManager.hasBillReferenceByColumn('account', name);
if (sourceMatched) {
return true;
}
return AccountManager.hasBillReferenceByColumn('target_account', name);
} | 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 hasReferencedBills AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left ... | static async hasReferencedBills(name: string): Promise<boolean> {
const sourceMatched: boolean = await AccountManager.hasBillReferenceByColumn('account', name);
if (sourceMatched) {
return true;
}
return AccountManager.hasBillReferenceByColumn('target_account', name);
} | https://github.com/ZestBox-18/kitebook-frontend | f51b61e1fceed54848dfc6cd6c8975aa41ec5ea2 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/components/RDPDisplay.ets | arkts | authenticate | 使用用户名和密码进行认证 | async authenticate(username: string, password: string, domain?: string): Promise<void> {
if (!this.config) {
this.callbacks.onError?.('连接配置不存在')
return
}
this.config.username = username
this.config.password = password
this.config.domain = domain
await this.performAuthenti... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left authenticate AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left username AST#identifier#Right AS... | async authenticate(username: string, password: string, domain?: string): Promise<void> {
if (!this.config) {
this.callbacks.onError?.('连接配置不存在')
return
}
this.config.username = username
this.config.password = password
this.config.domain = domain
await this.performAuthenti... | https://github.com/AetheriumSimulator/qemu-hmos | d71d9e9fe727a034973732df7dfd17ab7384c116 | github |
apap6628114/nga_oh | entry/src/main/ets/parser/bbcode/parser.ets | arkts | parseTableRowCells | 解析表格行内的 [td] 单元格,处理 colspan/rowspan/colwidth 属性。 | function parseTableRowCells(state: ParseState): BBNode[] {
const cells: BBNode[] = []
while (state.pos < state.len) {
const trClose = state.content.indexOf('[/tr]', state.pos)
const tdOpen = state.content.indexOf('[td', state.pos)
if (tdOpen < 0 || (trClose >= 0 && trClose < tdOpen)) {
if (trClose... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left parseTableRowCells AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left state AST#identifier#Right AST#type_annotation#Left AST#:#Left : AS... | function parseTableRowCells(state: ParseState): BBNode[] {
const cells: BBNode[] = []
while (state.pos < state.len) {
const trClose = state.content.indexOf('[/tr]', state.pos)
const tdOpen = state.content.indexOf('[td', state.pos)
if (tdOpen < 0 || (trClose >= 0 && trClose < tdOpen)) {
if (trClose... | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/parser/bbcode/parser.ets#L163-L195 | 7dae2ba3dd58f2543463b8c2f0337c94a1e90700 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/left_shift/left_shift_char.ets | arkts | main | ---
desc: check left shift operation for char
--- | function main(): void {
const a: char = {{v.left}}
const b: int = {{v.right}}
assert (a << b) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A... | function main(): void {
const a: char = {{v.left}}
const b: int = {{v.right}}
assert (a << b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | bfcc8de98bfb58ec7e1ac2c4ac27e08e1bae0a4f | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | reset | 重置规划器状态(用于测试或重新初始化) | public reset(): void {
this.graph.clear();
this.floorPlans.clear();
this.connections = [];
this.pathCache.clear();
this.navigationHistory = [];
this.buildingData = null;
this.isInitialized = false;
this.initializationPromise = null;
console.log('[PathPlanner] 规划器已重置');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left reset 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#:#Rig... | public reset(): void {
this.graph.clear();
this.floorPlans.clear();
this.connections = [];
this.pathCache.clear();
this.navigationHistory = [];
this.buildingData = null;
this.isInitialized = false;
this.initializationPromise = null;
console.log('[PathPlanner] 规划器已重置');
} | https://github.com/LJ666-ui/harmony-health-care | 8d73a5c5b0f2ea1cfd6114d9730b0256aeee8d66 | github |
aimilin6688/KeePassHO | entry/src/main/ets/workers/DatabaseSave.ets | arkts | mergeDatabase | 合并数据库
@param request 请求
@param fileContent 新文件内容
@param credentials 凭证
@throws Error 合并失败 | private async mergeDatabase(request: SaveDatabase, fileContent: FileContentInfo, credentials: KdbxCredentials): Promise<FileContentInfo> {
// 校验文件签名
this.postMessage($r('app.string.validating'));
// 尝试加载数据库(仅验证,不保留结果)
let newKdbx: Kdbx = await Kdbx.load(fileContent.content, credentials);
this.post... | 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 mergeDatabase AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left request AST#identifier#Right AST#:#Left... | private async mergeDatabase(request: SaveDatabase, fileContent: FileContentInfo, credentials: KdbxCredentials): Promise<FileContentInfo> {
// 校验文件签名
this.postMessage($r('app.string.validating'));
// 尝试加载数据库(仅验证,不保留结果)
let newKdbx: Kdbx = await Kdbx.load(fileContent.content, credentials);
this.post... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/workers/DatabaseSave.ets#L76-L87 | 326b361aeab3de67586515289314a85abea6b404 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/BillDAO.ets | arkts | delete | 软删除 - 需要验证 userId 以确保数据安全 | static async delete(billId: number, userId: number) {
const store = DatabaseManager.getDatabase();
const now = new Date().toISOString();
const sql = `UPDATE bills SET is_deleted = 1, updated_at = ? WHERE bill_id = ? AND user_id = ?`;
await store.executeSql(sql, [now, billId, userId]);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#delete#Left delete AST#delete#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left billId AST#identifier#Right AST#type_annotation#Left AST#:#Le... | static async delete(billId: number, userId: number) {
const store = DatabaseManager.getDatabase();
const now = new Date().toISOString();
const sql = `UPDATE bills SET is_deleted = 1, updated_at = ? WHERE bill_id = ? AND user_id = ?`;
await store.executeSql(sql, [now, billId, userId]);
} | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | f45eea08f7b007ad89cc193af167ca661ea9fc69 | github |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/calculator/Evaluator.ets | arkts | constructor | constructor
@param worker worker.ThreadWorker | constructor(worker: worker.ThreadWorker) {
this.worker = worker;
this.expressionsModel = new ExpressionsModel();
this.getPreference();
let expressionValue: string | undefined = AppStorage.get<string>('globalExpression');
if (expressionValue !== undefined) {
this.expression = expressionValue;... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left worker AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#identifier#Left ... | constructor(worker: worker.ThreadWorker) {
this.worker = worker;
this.expressionsModel = new ExpressionsModel();
this.getPreference();
let expressionValue: string | undefined = AppStorage.get<string>('globalExpression');
if (expressionValue !== undefined) {
this.expression = expressionValue;... | https://gitee.com/openharmony-sig/applications_calculator.git | 9048e5beab0c2c4c19b67c79ee3d24bccb6d8c2a | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Task/BackgroundTaskManager.ets | arkts | addListener | 添加任务状态监听器 | public addListener(listener: TaskStatusListener): void {
this.listeners.add(listener);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | public addListener(listener: TaskStatusListener): void {
this.listeners.add(listener);
} | https://github.com/DaLongZhuaZi/manxia | 86f1dc1e561c43485d4d4cd9335528f573df7781 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/WebViewImageLoader.ets | arkts | setPageIndex | 设置页面索引 | setPageIndex(pageIndex: number): ImageRequestBuilder {
this.pageIndex = pageIndex;
return this;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setPageIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pageIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST#)... | setPageIndex(pageIndex: number): ImageRequestBuilder {
this.pageIndex = pageIndex;
return this;
} | https://github.com/DaLongZhuaZi/manxia | 6ed6cd4b93cc8c3dca177016fda022f4c1595a0d | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/SharedLedgerDAO.ets | arkts | getByLedgerId | 获取账本的审批记录 | static async getByLedgerId(ledgerId: number): Promise<ApprovalRecord[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(ApprovalRecord.tableName);
predicates.equalTo('ledger_id',... | 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 getByLedgerId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ledgerId AST#identifier#Right AST#ERROR#Left AST#:#Left :... | static async getByLedgerId(ledgerId: number): Promise<ApprovalRecord[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(ApprovalRecord.tableName);
predicates.equalTo('ledger_id',... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | c14bc3db8c9dccade736732be7ccda7fd4e9f43d | github |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/BudgetManager.ets | arkts | addBudget | 新增预算记录。 | private static async addBudget(category: string, amount: number, month: string): Promise<number> {
const now: number = Date.now();
const data: relationalStore.ValuesBucket = {
category: category,
amount: amount,
month: month,
created_at: now,
updated_at: now
};
return ne... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left addBudget AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left category AST#identif... | private static async addBudget(category: string, amount: number, month: string): Promise<number> {
const now: number = Date.now();
const data: relationalStore.ValuesBucket = {
category: category,
amount: amount,
month: month,
created_at: now,
updated_at: now
};
return ne... | https://github.com/ZestBox-18/kitebook-frontend | 9044d7be418bbb02d62aee5a4377af787dd3471d | github |
FadingLight9291117/vscode-arkts | examples/advanced-method-test.ets | arkts | syncOpenStatus | 测试1: 简单方法 | syncOpenStatus() {
console.log('sync');
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left syncOpenStatus 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#Lef... | syncOpenStatus() {
console.log('sync');
} | https://github.com/FadingLight9291117/vscode-arkts | aad9be3a476bae860d011539ccdcf7fd3369e3dd | github |
offlinecat-dev/OCNetORM | src/main/ets/mapping/TypedEntityData.ets | arkts | getValue | 获取属性值(通用方法)
@param key 属性名
@returns 属性值,如果不存在返回 null | getValue(key: string): ValueType {
const value = this.data.get(key)
if (value === undefined) {
return null
}
return value
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)#R... | getValue(key: string): ValueType {
const value = this.data.get(key)
if (value === undefined) {
return null
}
return value
} | https://github.com/offlinecat-dev/OCNetORM | 45921136969023f630394bb472aea061fb83af56 | github |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/index.ets | arkts | setColorModeListener | 监听配置变化 | private static setColorModeListener() {
let appContext = ContextUtil.getAppCtx();
saveBaseDataToStorage(TnAppStorageKey.COLOR_MODE, ContextUtil.getUIAbilityCtx().config.colorMode as number);
saveBaseDataToStorage(TnAppStorageKey.LANGUAGE, ContextUtil.getUIAbilityCtx().config.language as string);
appCo... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left setColorModeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R... | private static setColorModeListener() {
let appContext = ContextUtil.getAppCtx();
saveBaseDataToStorage(TnAppStorageKey.COLOR_MODE, ContextUtil.getUIAbilityCtx().config.colorMode as number);
saveBaseDataToStorage(TnAppStorageKey.LANGUAGE, ContextUtil.getUIAbilityCtx().config.language as string);
appCo... | https://github.com/codelably/tuniao-ui | 8839462d82d0ff6594fb1b95b6b7e98add36f7ec | github |
NissonCX/CQU-HarmonyOS-APP-Dev-Final | entry/src/main/ets/pages/TrendsPage.ets | arkts | getMetricName | 获取度量名称 | getMetricName(): string {
switch (this.selectedMetric) {
case 'weight':
return '体重';
case 'heartRate':
return '心率';
case 'bloodPressure':
return '血压';
case 'steps':
return '步数';
default:
return '';
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getMetricName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#statemen... | getMetricName(): string {
switch (this.selectedMetric) {
case 'weight':
return '体重';
case 'heartRate':
return '心率';
case 'bloodPressure':
return '血压';
case 'steps':
return '步数';
default:
return '';
}
} | https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final | f6e12e47c913f1c3fc2502ebce7938996d929014 | github |
HarmonyCandies/image_cropper | image_cropper/src/main/ets/model/Geometry.ets | arkts | direction | Angle in radians from the positive x-axis | get direction(): number {
return Math.atan2(this.dy, this.dx);
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left direction 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 A... | get direction(): number {
return Math.atan2(this.dy, this.dx);
} | https://github.com/HarmonyCandies/image_cropper/blob/dd3664946b413166307b736a5763f998084364e1/image_cropper/src/main/ets/model/Geometry.ets#L93-L95 | c87883291b665b29a28fb198b0ac70e208d60af1 | github |
hiyuey3/Hixy_MyMemories | entry/src/main/ets/store/MemoryStore.ets | arkts | getSelected | 获取选中事件 ID
@returns number | undefined | function getSelected(): number | undefined {
return undefined; // 返回 undefined 作为默认值
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getSelected 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#union_type#Left... | function getSelected(): number | undefined {
return undefined; // 返回 undefined 作为默认值
} | https://github.com/hiyuey3/Hixy_MyMemories/blob/9769d82c97a877be3d464456e79f66c5c84a9590/entry/src/main/ets/store/MemoryStore.ets#L73-L75 | 432418328478de4624485debc11d1bcda78a227c | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/AudioVibrationService.ets | arkts | shouldVibrateDevice | ==================== 路由判断 ==================== | private shouldVibrateDevice(): boolean {
switch (this.vibrationMode) {
case '仅手柄': return false;
case '仅设备': return true;
case '同时': return true;
case '自动':
default:
return !GamepadManager.getInstance().hasUsbControllers();
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left shouldVibrateDevice 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 bo... | private shouldVibrateDevice(): boolean {
switch (this.vibrationMode) {
case '仅手柄': return false;
case '仅设备': return true;
case '同时': return true;
case '自动':
default:
return !GamepadManager.getInstance().hasUsbControllers();
}
} | https://github.com/AlkaidLab/moonlight-harmony | 338e1b8e383f27e712e52be40867eac3ce7323cf | github |
OSpark-Team/Free-PCM | library/src/main/ets/utils/AudioDecoderManager.ets | arkts | getContext | 获取当前缓存的上下文
@returns {common.Context | null} | public getContext(): common.Context | null {
return this.context;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#... | public getContext(): common.Context | null {
return this.context;
} | https://github.com/OSpark-Team/Free-PCM/blob/3440e7220d07d28815d172b4b3237145434075ee/library/src/main/ets/utils/AudioDecoderManager.ets#L224-L226 | 34873c99f5c1a9d5d0cd304c22039b601ac9e788 | github |
iHongRen/harmony-study-demo | entry/src/main/ets/pages/transcoder/Transcoder.ets | arkts | resumeTranscoderingProcess | 恢复对应的转码流程。 | async resumeTranscoderingProcess() {
if (Transcoder.canIUse()) {
if (this.avTranscoder != undefined) { // 仅在调用pause返回后调用resume为合理调用。
await this.avTranscoder.resume();
}
}
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left resumeTranscoderingProcess AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#... | async resumeTranscoderingProcess() {
if (Transcoder.canIUse()) {
if (this.avTranscoder != undefined) { // 仅在调用pause返回后调用resume为合理调用。
await this.avTranscoder.resume();
}
}
} | https://github.com/iHongRen/harmony-study-demo | db3042e881d4638136850f05830e4b85af6d3837 | github |
codelably/tuniao-ui | packages/main/src/main/ets/view/GradientBackgroundPage.ets | arkts | build | 构建渐变背景展示页面
@returns {void} 无返回值 | build() {
AppNavDestination({
title: "背景",
viewModel: this.vm,
paddingValue: {
top: this.windowSafeAreaState.topInset,
left: this.windowSafeAreaState.leftInset,
right: this.windowSafeAreaState.rightInset,
}
}) {
this.BackgroundContent();
}
} | 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#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST#c... | build() {
AppNavDestination({
title: "背景",
viewModel: this.vm,
paddingValue: {
top: this.windowSafeAreaState.topInset,
left: this.windowSafeAreaState.leftInset,
right: this.windowSafeAreaState.rightInset,
}
}) {
this.BackgroundContent();
}
} | https://github.com/codelably/tuniao-ui | ef002245faedd228ab17c600fcc3df6b4adbb87c | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.