nwo stringclasses 449
values | path stringlengths 9 173 | language stringclasses 1
value | identifier stringlengths 1 53 | docstring stringlengths 5 4.13k | function stringlengths 10 87.2k | ast_function stringlengths 351 354k | obf_function stringlengths 10 87.2k | url stringlengths 30 175 | function_sha stringlengths 40 40 | source stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|
LJ666-ui/harmony-health-care | entry/src/main/ets/services/TerminalManager.ets | arkts | canAccessPage | 验证页面访问权限
@param pageUrl 页面URL | canAccessPage(pageUrl: string): boolean {
if (!this.currentTerminal) {
return false;
}
const allowedTerminals = this.pageAccessMap.get(pageUrl);
if (!allowedTerminals) {
// 未配置的页面默认不允许访问
console.warn(`页面 ${pageUrl} 未配置访问权限`);
return false;
}
return allowedTerm... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left canAccessPage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pageUrl AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#)#... | canAccessPage(pageUrl: string): boolean {
if (!this.currentTerminal) {
return false;
}
const allowedTerminals = this.pageAccessMap.get(pageUrl);
if (!allowedTerminals) {
// 未配置的页面默认不允许访问
console.warn(`页面 ${pageUrl} 未配置访问权限`);
return false;
}
return allowedTerm... | https://github.com/LJ666-ui/harmony-health-care | e7b3fa1e96791cb02ed791731feb34ce30c9c67e | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoJsExtensions.ets | arkts | getCookie | ==================== Cookie管理 ====================
获取Cookie(使用持久化存储) | getCookie(tag: string, key?: string): string {
// 优先从持久化存储获取
const cookieStore = getCookieStore();
const persistedCookie = cookieStore.getCookieByTag(tag, key);
if (persistedCookie) {
return persistedCookie;
}
// 回退到内存存储
const cookieKey = key ? `${tag}_${key}` : tag;
return ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCookie AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tag AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#... | getCookie(tag: string, key?: string): string {
// 优先从持久化存储获取
const cookieStore = getCookieStore();
const persistedCookie = cookieStore.getCookieByTag(tag, key);
if (persistedCookie) {
return persistedCookie;
}
// 回退到内存存储
const cookieKey = key ? `${tag}_${key}` : tag;
return ... | https://github.com/DaLongZhuaZi/manxia | 74097b5ca7562950bb4cbd5646446b4c7d976f1a | github |
SMAT-Lab/PhantomRendering | Harmoney_Next-Tiktok/entry/src/main/ets/pages/Setting/SettingPage.ets | arkts | getCurrentSpeedOption | 获取当前速度选项 | getCurrentSpeedOption(): SpeedOption {
return playSpeedManager.SPEED_OPTIONS[this.currentSpeedIndex] || playSpeedManager.SPEED_OPTIONS[2]
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCurrentSpeedOption 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 SpeedOption AST#identifier#Right AST#ERR... | getCurrentSpeedOption(): SpeedOption {
return playSpeedManager.SPEED_OPTIONS[this.currentSpeedIndex] || playSpeedManager.SPEED_OPTIONS[2]
} | https://github.com/SMAT-Lab/PhantomRendering | 0c55d48c647a9fcfe3d3e32cad8bc0f8aafd8af2 | github |
harmonyos/codelabs | HarmonyOS_NEXT/TargetManagement/entry/src/main/ets/view/TargetList.ets | arkts | deleteSelected | Delete the selected item and exit the editing mode. | deleteSelected() {
DataModel.deleteData(this.selectArray);
this.targetData = DataModel.getData();
this.overAllProgressChanged = !this.overAllProgressChanged;
this.isEditMode = false;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left deleteSelected 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... | deleteSelected() {
DataModel.deleteData(this.selectArray);
this.targetData = DataModel.getData();
this.overAllProgressChanged = !this.overAllProgressChanged;
this.isEditMode = false;
} | https://gitee.com/harmonyos/codelabs.git | e7643a2e39bf897989121c306fefc4ab2bfa3c8a | gitee |
harmonyos/codelabs | HarmonyOS_NEXT/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets | arkts | isSymbol | Determines whether it is an operator.
@param value The symbol.
@return Is Operator. | isSymbol(value: string) {
if (CheckEmptyUtil.isEmpty(value)) {
return ;
}
return (CommonConstants.OPERATORS.indexOf(value) !== -1);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left isSymbol AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST... | isSymbol(value: string) {
if (CheckEmptyUtil.isEmpty(value)) {
return ;
}
return (CommonConstants.OPERATORS.indexOf(value) !== -1);
} | https://gitee.com/harmonyos/codelabs.git | 0ee6210f472bf6a87bd956b0373de4690ea7a669 | gitee |
openharmony-sig/ohos_easyui | easyui/src/main/ets/common/components/AddressEdit.ets | arkts | showTips | 展示提示弹窗 | showTips(message:string){
promptAction.showToast({
message:message,
duration:1000,
bottom:400
})
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left showTips 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#string#Left string AST#string#Right AST#ERROR#Right AST#)#Lef... | showTips(message:string){
promptAction.showToast({
message:message,
duration:1000,
bottom:400
})
} | https://gitee.com/openharmony-sig/ohos_easyui.git | 7ab959a01edf47c50a035c2fd97bdb177129bf59 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Task/BackgroundTaskManager.ets | arkts | cancelTaskNotification | 取消任务通知 | private async cancelTaskNotification(task: InternalTask): Promise<void> {
if (!task.options?.notification) {
return;
}
logger.info(TAG, `取消后台任务通知:id=${task.id},目标=${task.options.notification.targetName}`);
await this.notificationManager.cancelTaskNotification(task.id);
} | 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 cancelTaskNotification AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left task AST#identifier#Right AST#... | private async cancelTaskNotification(task: InternalTask): Promise<void> {
if (!task.options?.notification) {
return;
}
logger.info(TAG, `取消后台任务通知:id=${task.id},目标=${task.options.notification.targetName}`);
await this.notificationManager.cancelTaskNotification(task.id);
} | https://github.com/DaLongZhuaZi/manxia | 97b7b190e312e44910c5da72093e7c5ec0e3137e | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | from | Creates an array from an object of FixedArray<int>.
@param { FixedArray<int> } arr - An instance of the FixedArray type to convert to an array.
@returns { Int32Array } - A new Int32Array
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static from(arr: FixedArray<int>): Int32Array {
let result = new Int32Array(arr.length)
result.ofInt(stub.toValueArray(arr))
return result
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Righ... | public static from(arr: FixedArray<int>): Int32Array {
let result = new Int32Array(arr.length)
result.ofInt(stub.toValueArray(arr))
return result
} | https://gitcode.com/iop123123/arkts-static-skills | 5f490c61b255ff9d1be060506d029382d847d388 | gitcode |
richshaw2015/nds | ohos/entry/src/main/ets/utils/CheatManager.ets | arkts | loadEnabledState | ========================================================================
启用状态持久化
======================================================================== | private loadEnabledState(gameCode: string, checksum: string): Set<string> {
const path = this.getEnabledStatePath(gameCode, checksum);
try {
if (!fileIo.accessSync(path)) return new Set<string>();
const content = this.readFileContent(path);
if (!content) return new Set<string>();
const... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left loadEnabledState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left gameCode AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#s... | private loadEnabledState(gameCode: string, checksum: string): Set<string> {
const path = this.getEnabledStatePath(gameCode, checksum);
try {
if (!fileIo.accessSync(path)) return new Set<string>();
const content = this.readFileContent(path);
if (!content) return new Set<string>();
const... | https://github.com/richshaw2015/nds | 4717ff4510450218e76c61d8627e56c65e774992 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebDAV/WebDAVAutoBackupScheduler.ets | arkts | saveWebDAVSettings | 保存WebDAV设置 | private async saveWebDAVSettings(settings: WebDAVSettings): Promise<void> {
if (!this.context) return;
try {
const options: preferences.Options = { name: 'webdav_settings' };
const dataPreferences = await preferences.getPreferences(this.context, options);
await dataPreferences.pu... | 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 saveWebDAVSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left settings AST#identifier#Right AST#... | private async saveWebDAVSettings(settings: WebDAVSettings): Promise<void> {
if (!this.context) return;
try {
const options: preferences.Options = { name: 'webdav_settings' };
const dataPreferences = await preferences.getPreferences(this.context, options);
await dataPreferences.pu... | https://github.com/DaLongZhuaZi/manxia | ef9328205e3807b128b80c5c012c7ba1cf6696db | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/utils/CryptoUtil.ets | arkts | asn1PrintableString | 构造 ASN.1 PrintableString | private static asn1PrintableString(str: string): Uint8Array {
const textEncoder = new util.TextEncoder();
const strBytes = textEncoder.encodeInto(str);
const len = CryptoUtil.encodeAsn1Length(strBytes.length);
const result = new Uint8Array(1 + len.length + strBytes.length);
result[0] = 0x13; // Pr... | 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 asn1PrintableString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left str AST#identifier#Right AST#:#L... | private static asn1PrintableString(str: string): Uint8Array {
const textEncoder = new util.TextEncoder();
const strBytes = textEncoder.encodeInto(str);
const len = CryptoUtil.encodeAsn1Length(strBytes.length);
const result = new Uint8Array(1 + len.length + strBytes.length);
result[0] = 0x13; // Pr... | https://github.com/AlkaidLab/moonlight-harmony | 94a83ede99cb6bc0211bd1a82bb7e53f061a2601 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/ChartModel.ets | arkts | highlightValuesForArray | Highlights the values at the given indices in the given DataSets. Provide
null or an empty array to undo all highlighting. This should be used to
programmatically highlight values.
This method *will not* call the listener.
@param highs | public highlightValuesForArray(highs: Highlight[]) {
// set the indices to highlight
this.mIndicesToHighlight = highs;
this.setLastHighlighted(highs);
// redraw the chart
this.invalidate();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left highlightValuesForArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left highs AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscri... | public highlightValuesForArray(highs: Highlight[]) {
// set the indices to highlight
this.mIndicesToHighlight = highs;
this.setLastHighlighted(highs);
// redraw the chart
this.invalidate();
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 1e6be2453938bf07227c7ab6585b6c43f95a9b64 | gitee |
erosTeam/NextE | shared/src/main/ets/parser/HtmlSelectorUtils.ets | arkts | rows | Split a table body into its <tr>…</tr> rows (EH rows never nest). | static rows(tableHtml: string): string[] {
const re: RegExp = new RegExp('<tr[^>]*>[\\s\\S]*?</tr>', 'g')
const out: string[] = []
let m: RegExpExecArray | null = re.exec(tableHtml)
while (m !== null) {
out.push(m[0])
m = re.exec(tableHtml)
}
return out
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left rows AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left tableHtml AST#identifier#Right AST#ERROR#Left AST#:#Left : ... | static rows(tableHtml: string): string[] {
const re: RegExp = new RegExp('<tr[^>]*>[\\s\\S]*?</tr>', 'g')
const out: string[] = []
let m: RegExpExecArray | null = re.exec(tableHtml)
while (m !== null) {
out.push(m[0])
m = re.exec(tableHtml)
}
return out
} | https://github.com/erosTeam/NextE | a3002f1a57575d153adead2fcd0ff011a66c675a | github |
Joker-x-dev/CoolMallArkTS | core/designsystem/src/main/ets/component/Column.ets | arkts | build | 渲染布局
@returns {void} 无返回值
@example
ColumnSpaceAroundStart() { Text("A"); Text("B"); Text("C"); } | build(): void {
ColumnBase({
options: this.options,
justifyContent: FlexAlign.SpaceAround,
alignItems: HorizontalAlign.Start,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.ma... | 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 {
ColumnBase({
options: this.options,
justifyContent: FlexAlign.SpaceAround,
alignItems: HorizontalAlign.Start,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.ma... | https://github.com/Joker-x-dev/CoolMallArkTS | f657a5ab373c98071e50fe41c2bc18ee9cfa5a82 | github |
Joker-x-dev/CoolMallArkTS | core/navigation/src/main/ets/RouteBuild.ets | arkts | getBuilder | 获取路由构建器
@param name 路由名称
@returns 路由构建器 | static getBuilder(name: string): WrappedBuilder<[]> | undefined {
return RouteBuild.builderMap.get(name);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getBuilder AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left strin... | static getBuilder(name: string): WrappedBuilder<[]> | undefined {
return RouteBuild.builderMap.get(name);
} | https://github.com/Joker-x-dev/CoolMallArkTS | cac5d64274db544ccdeb35feec6a3d7bd02162a5 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/GameManager.ets | arkts | extractGameName | 从文件名提取游戏名称(去除扩展名) | private extractGameName(fileName: string): string {
const dotIndex = fileName.lastIndexOf('.');
return dotIndex > 0 ? fileName.substring(0, dotIndex) : fileName;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left extractGameName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left fileName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st... | private extractGameName(fileName: string): string {
const dotIndex = fileName.lastIndexOf('.');
return dotIndex > 0 ? fileName.substring(0, dotIndex) : fileName;
} | https://github.com/richshaw2015/nds | d5f30704411e06d507d25b1a563ac537509278ec | github |
terryma2024/happyword | harmonyos/entry/src/main/ets/services/BattleEngine.ets | arkts | submitAnswer | Apply one answer submission and return a description of what happened.
Preconditions (each throws on violation so UI bugs surface as real errors
instead of silently corrupting the score):
- `status` is Playing.
- `option` is one of `currentQuestion.options`. | submitAnswer(option: string): AnswerOutcome {
if (this.state_.status !== BattleStatus.Playing) {
throw new Error(`BattleEngine.submitAnswer called while status=${this.state_.status}`);
}
const q: Question | undefined = this.state_.currentQuestion;
if (q === undefined) {
throw new Error('Ba... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left submitAnswer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left option AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) ... | submitAnswer(option: string): AnswerOutcome {
if (this.state_.status !== BattleStatus.Playing) {
throw new Error(`BattleEngine.submitAnswer called while status=${this.state_.status}`);
}
const q: Question | undefined = this.state_.currentQuestion;
if (q === undefined) {
throw new Error('Ba... | https://github.com/terryma2024/happyword | f40fb17e3a141686e926355ca80d1217aebbf0a0 | github |
offlinecat-dev/OCNetORM | src/main/ets/query/WhereCondition.ets | arkts | like | 创建 LIKE 条件
@param column 列名
@param pattern 匹配模式
@returns WhereCondition 实例 | static like(column: string, pattern: string): WhereCondition {
const condition = new WhereCondition()
condition.column = column
condition.operator = ConditionOperator.LIKE
condition.value = pattern
return condition
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left like AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left column AST#identifier#Right AST#:#Left : AST#:#Right AST#ER... | static like(column: string, pattern: string): WhereCondition {
const condition = new WhereCondition()
condition.column = column
condition.operator = ConditionOperator.LIKE
condition.value = pattern
return condition
} | https://github.com/offlinecat-dev/OCNetORM | 2fe2b08cfbde2589c74a9002df53692fd89c62d6 | github |
Joker-x-dev/CoolMallArkTS | feature/auth/src/main/ets/view/AccountLoginPage.ets | arkts | build | 构建账号登录页面
@returns {void} 无返回值 | build(): void {
AppNavDestination({
pageBackgroundColor: $r("app.color.bg_white"),
titleOptions: { backgroundColor: $r("app.color.bg_white") },
viewModel: this.vm
}) {
this.AccountLoginContent();
}
} | 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 {
AppNavDestination({
pageBackgroundColor: $r("app.color.bg_white"),
titleOptions: { backgroundColor: $r("app.color.bg_white") },
viewModel: this.vm
}) {
this.AccountLoginContent();
}
} | https://github.com/Joker-x-dev/CoolMallArkTS | 8cba8565222636508f62b5704073da4c9a61c6e2 | github |
harmonyos/codelabs | HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/model/DatabaseModel.ets | arkts | query | Init when open the app
@param date
@param callback | query(date: string, callback: Function) {
let result: TaskInfo[] = [];
let self = this;
GlobalInfoApi.query((globalResult: GlobalInfo) => {
if (!globalResult.firstDate) { // if global information is not found, it is written
let globalInfo: GlobalInfo = new GlobalInfo(date, date, 0, '');
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left query AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#L... | query(date: string, callback: Function) {
let result: TaskInfo[] = [];
let self = this;
GlobalInfoApi.query((globalResult: GlobalInfo) => {
if (!globalResult.firstDate) { // if global information is not found, it is written
let globalInfo: GlobalInfo = new GlobalInfo(date, date, 0, '');
... | https://gitee.com/harmonyos/codelabs.git | 5a1bcc7e6d8531c9ba5ede73cf9c65ddec7d5ebc | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/ancientimage/ImageRestorationEngine.ets | arkts | getCachedResult | 获取缓存结果 | getCachedResult(imageId: number): ProcessingResult | null {
const cached = this.resultCache.get(imageId);
if (cached) {
const age = Date.now() - cached.report.generatedAt;
if (age < this.CACHE_EXPIRY) {
return cached;
} else {
this.resultCache.delete(imageId);
}
}
... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getCachedResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left imageId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#numb... | getCachedResult(imageId: number): ProcessingResult | null {
const cached = this.resultCache.get(imageId);
if (cached) {
const age = Date.now() - cached.report.generatedAt;
if (age < this.CACHE_EXPIRY) {
return cached;
} else {
this.resultCache.delete(imageId);
}
}
... | https://github.com/LJ666-ui/harmony-health-care | 9fb8d1d20ce7870326eb6da9d9b04f9afab3f944 | github |
aimilin6688/KeePassHO | entry/src/main/ets/storage/webdav/WebDAVStorage.ets | arkts | isSameConfig | 判断配置是否相同
比较 url/username/password 三个字段,相同则 session 等价,无需重建
注意:比较解密后的值,因为加密结果每次不同 | private isSameConfig(newConfig: WebDAVStorageConfig): boolean {
if (!this.config) {
return false;
}
return this.config.url === newConfig.url
&& this.config.getUserNameText() === newConfig.getUserNameText()
&& this.config.getPasswordText() === newConfig.getPasswordText();
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isSameConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newConfig AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | private isSameConfig(newConfig: WebDAVStorageConfig): boolean {
if (!this.config) {
return false;
}
return this.config.url === newConfig.url
&& this.config.getUserNameText() === newConfig.getUserNameText()
&& this.config.getPasswordText() === newConfig.getPasswordText();
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/webdav/WebDAVStorage.ets#L63-L70 | 067266f5f004ae3c41f9a42c5a3c4d45ba1c1410 | github |
UnbalancedCat/ohos-ssh-core | ssh_lib/src/main/ets/core/EventEmitter.ets | arkts | on | Subscribe to an event. | public on(event: string, callback: EventCallback): void {
if (!this.listeners.has(event)) {
this.listeners.set(event, []);
}
this.listeners.get(event)?.push(callback);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left on AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR... | public on(event: string, callback: EventCallback): void {
if (!this.listeners.has(event)) {
this.listeners.set(event, []);
}
this.listeners.get(event)?.push(callback);
} | https://github.com/UnbalancedCat/ohos-ssh-core | 4956811f840799ce78fcf17b95362dbfa788bfe0 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/EventSourcingDAO.ets | arkts | getByEventType | 根据事件类型查询 | static async getByEventType(eventType: string, limit: number = 100): Promise<DomainEvent[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(DomainEvent.tableName);
predicates.equ... | 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 getByEventType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left eventType AST#identifier#Right AST#ERROR#Left AST#:#Left... | static async getByEventType(eventType: string, limit: number = 100): Promise<DomainEvent[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(DomainEvent.tableName);
predicates.equ... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 31640a423cfe6d290fb4fa2e2ad9e63c280b5687 | github |
openharmony/codelabs | Media/VideoPlayer/entry/src/main/ets/controller/VideoController.ets | arkts | setSpeed | Set the playback speed.
@param playSpeed Current playback speed. | setSpeed(playSpeed: number) {
if (this.avPlayer === null) {
return;
}
if (CommonConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) {
return;
}
this.playerModel.playSpeed = playSpeed;
this.avPlayer.setSpeed(this.playerModel.playSpeed);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setSpeed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left playSpeed AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#L... | setSpeed(playSpeed: number) {
if (this.avPlayer === null) {
return;
}
if (CommonConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) {
return;
}
this.playerModel.playSpeed = playSpeed;
this.avPlayer.setSpeed(this.playerModel.playSpeed);
} | https://gitee.com/openharmony/codelabs.git | d28c1c261789f5e2800842d1cafcbeccca2ae243 | gitee |
itrainhub/wu-ui | WuUI/wu_ui/src/main/ets/components/loading/spinner.ets | arkts | drawSpinner | 画菊花图
角度转弧度: 180度=Math.PI弧度,则 1度=(Math.PI/180)弧度 | drawSpinner() {
const centerX = this.canvasWidth / 2
const centerY = this.canvasWidth / 2
for(let i = 0; i < this.numberOfCircles; i++) {
// 当前花瓣弧度
const currAngle = (i * (360 / this.numberOfCircles) + this.angle) * Math.PI / 180
// 花瓣坐标
const x = centerX + this.radius * Math.cos(... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left drawSpinner AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A... | drawSpinner() {
const centerX = this.canvasWidth / 2
const centerY = this.canvasWidth / 2
for(let i = 0; i < this.numberOfCircles; i++) {
// 当前花瓣弧度
const currAngle = (i * (360 / this.numberOfCircles) + this.angle) * Math.PI / 180
// 花瓣坐标
const x = centerX + this.radius * Math.cos(... | https://github.com/itrainhub/wu-ui | 0f3fa967a286e0b89c1f0b0c2899fa33615d5e5d | github |
OHPG/FinMusic | entry/src/main/ets/player/LyricCache.ets | arkts | resolveToTemp | 非持久化模式:写入固定临时文件,每次覆盖 | private async resolveToTemp(itemId: string, fetcher: () => Promise<LyricDto | undefined>): Promise<string | undefined> {
return this.fetchAndWrite(this.tempFile, fetcher)
} | 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 resolveToTemp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left itemId AST#identifier#Right AST#:#Left ... | private async resolveToTemp(itemId: string, fetcher: () => Promise<LyricDto | undefined>): Promise<string | undefined> {
return this.fetchAndWrite(this.tempFile, fetcher)
} | https://github.com/OHPG/FinMusic | 5c4eb7f607c7de3c2ab21a3851fac306cada5e85 | github |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/components/calendar/TnCalendar.ets | arkts | getLunarText | 获取农历显示文本
@param year 年
@param month 月
@param day 日
@returns 农历文本(初一时显示月名,其余显示日名) | function getLunarText(year: number, month: number, day: number): string {
const date: Date = new Date(year, month - 1, day);
const lunarInfo = lunar(date);
if (lunarInfo.getDay() === 1) {
return lunarInfo.getMonthInChinese() + "月";
}
return lunarInfo.getDayInChinese();
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getLunarText AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left year AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Rig... | function getLunarText(year: number, month: number, day: number): string {
const date: Date = new Date(year, month - 1, day);
const lunarInfo = lunar(date);
if (lunarInfo.getDay() === 1) {
return lunarInfo.getMonthInChinese() + "月";
}
return lunarInfo.getDayInChinese();
} | https://github.com/codelably/tuniao-ui | 6d38c4ca10558795b47b9b5531c559753522e73a | github |
HarmonyOS_Samples/MusicHome | features/player/src/main/ets/model/MediaService.ets | arkts | unregisterSessionControlListeners | Unsubscribe AVSession controller command listeners. | private async unregisterSessionControlListeners(): Promise<void> {
if (!this.session) {
return;
}
try {
this.session.off('play');
this.session.off('pause');
this.session.off('playNext');
this.session.off('playPrevious');
} catch (error) {
Logger.error(TAG, `${error.... | 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 unregisterSessionControlListeners AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_... | private async unregisterSessionControlListeners(): Promise<void> {
if (!this.session) {
return;
}
try {
this.session.off('play');
this.session.off('pause');
this.session.off('playNext');
this.session.off('playPrevious');
} catch (error) {
Logger.error(TAG, `${error.... | https://gitcode.com/HarmonyOS_Samples/MusicHome | e08430f025547277fd063d600cb6bdf6fcf7af99 | gitcode |
xiaofenger_705/protobuf-arkts-generator | runtime/arkpb/Writer.ets | arkts | int64 | Write signed varint64 as bigint | int64(v: bigint): Writer {
let x = BigInt.asUintN(64, v)
while (x > 0x7Fn) { this.push(Number((x & 0x7Fn) | 0x80n)); x >>= 7n }
this.push(Number(x & 0x7Fn))
return this
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left int64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left bigint AST#identifier#Right AST#)#Left ) AST#)#Right ... | int64(v: bigint): Writer {
let x = BigInt.asUintN(64, v)
while (x > 0x7Fn) { this.push(Number((x & 0x7Fn) | 0x80n)); x >>= 7n }
this.push(Number(x & 0x7Fn))
return this
} | https://gitcode.com/xiaofenger_705/protobuf-arkts-generator | 5e468b576fe626709d92e573e45f0ec17abc108b | gitcode |
seagazer/cclyric | lib/src/main/ets/CcLyricController.ets | arkts | setEmptyHint | Set the hint when the lyric is null.
@param hintText The hint text. | public setEmptyHint(hintText: ResourceStr): CcLyricController {
this._emptyHint = hintText;
this.invalidate()
return this
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setEmptyHint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left hintText AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | public setEmptyHint(hintText: ResourceStr): CcLyricController {
this._emptyHint = hintText;
this.invalidate()
return this
} | https://github.com/seagazer/cclyric | 2e637479dd4e9478121678311589c218acd3ddec | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.uri.ets | arkts | clearQuery | Clears the previously set query.
@returns { URI } After clearing, return the URI object. | clearQuery(): URI {
let uriStr: string = this.uriEntry.clearQuery();
return new URI(uriStr);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clearQuery 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 URI AST#identifier#Right AST#ERROR#Right AST#statem... | clearQuery(): URI {
let uriStr: string = this.uriEntry.clearQuery();
return new URI(uriStr);
} | https://gitcode.com/iop123123/arkts-static-skills | df2f1691727f6d4adc589c1e34f57e294edfb599 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EAWorker.ets | arkts | start | Start the worker execution
Begins processing tasks in the worker thread | public start(): void {
if ((this.loopStarted.get() || this.loopJoined.get()) && !this.isMain()) {
throw new Error('EAWorker:: Worker already started or quit');
}
this.reserveUserWorkerSlot();
try {
this.worker.start(() => {
try {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left start AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Rig... | public start(): void {
if ((this.loopStarted.get() || this.loopJoined.get()) && !this.isMain()) {
throw new Error('EAWorker:: Worker already started or quit');
}
this.reserveUserWorkerSlot();
try {
this.worker.start(() => {
try {
... | https://gitcode.com/iop123123/arkts-static-skills | 459ced2fe3208fd31a97135170aad4581e959cf2 | gitcode |
openharmony-sig/applications_clock | feature/alarmclock/src/main/ets/utils/AlarmCardUtil.ets | arkts | notifyAlarmCardRingUpdate | notify AlarmCard show Ring when alarmClock is ringing
@returns | public static async notifyAlarmCardRingUpdate(): Promise<void> {
const ringingTips = await ResourceManager.getStringByIdAsync($r('app.string.fa_ringing').id);
const firingAlarmId = await AlarmStateManager.getAlarmId();
const firingAlarm = await AlarmManager.getLatestAlarmFromDb(firingAlarmId) as AlarmInfo... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left notifyAlarmCardRingUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AS... | public static async notifyAlarmCardRingUpdate(): Promise<void> {
const ringingTips = await ResourceManager.getStringByIdAsync($r('app.string.fa_ringing').id);
const firingAlarmId = await AlarmStateManager.getAlarmId();
const firingAlarm = await AlarmManager.getLatestAlarmFromDb(firingAlarmId) as AlarmInfo... | https://gitee.com/openharmony-sig/applications_clock.git | 3fa55495ef859a983eb7f419dc96ca94d896e6e5 | gitee |
HarmonyOS_Samples/StateStore | entry/src/main/ets/model/TodoListModel.ets | arkts | updateState | [StartExclude todo_item_data] | updateState(state: number) {
this.state = state;
this.toDoItemSendable.state = state;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left state AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right ... | updateState(state: number) {
this.state = state;
this.toDoItemSendable.state = state;
} | https://gitcode.com/HarmonyOS_Samples/StateStore | 8d924241fab0be1d20a51549b457897c3c36accc | gitcode |
tdcare/tdwebrtc | src/main/ets/utils/NetworkUtil.ets | arkts | getNetBearTypes | 获取网络类型,数组里面只包含了一种具体的网络类型。 | static getNetBearTypes(): Array<connection.NetBearType> {
const netCapabilities = NetworkUtil.getNetCapabilitiesSync(NetworkUtil.getDefaultNetSync());
return netCapabilities.bearerTypes;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getNetBearTypes 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... | static getNetBearTypes(): Array<connection.NetBearType> {
const netCapabilities = NetworkUtil.getNetCapabilitiesSync(NetworkUtil.getDefaultNetSync());
return netCapabilities.bearerTypes;
} | https://github.com/tdcare/tdwebrtc | fcdbc946efc5f79c05ed678244f8b574b7a38451 | github |
openharmony/arkui_ace_engine | advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.TreeViewV2.ets | arkts | addNode | Initialize the interface of the tree view. This interface is used to generate ListNodeDataSource data.
addNode is only designed for initialization. It can only be invoked during initialization.
A maximum of 50 directory levels can be added. | public addNode(nodeParam?: NodeParamV2): TreeControllerV2 {
if (nodeParam === undefined) {
this.add(this.initBuild);
return this;
} else {
for (let i: int = 0; i < this.nodeIdList.length; i++) {
if (nodeParam.currentNodeId === this.nodeIdList[i]) {
throw new Error('ListTree... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addNode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left nodeParam AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Righ... | public addNode(nodeParam?: NodeParamV2): TreeControllerV2 {
if (nodeParam === undefined) {
this.add(this.initBuild);
return this;
} else {
for (let i: int = 0; i < this.nodeIdList.length; i++) {
if (nodeParam.currentNodeId === this.nodeIdList[i]) {
throw new Error('ListTree... | https://gitcode.com/openharmony/arkui_ace_engine | 3c926dd48bf9bc1d1ba4b57ec31b10fbc4bd28c5 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Components/ContentPanel.ets | arkts | showRawfileHelp | 兼容旧版API - 显示rawfile帮助 | showRawfileHelp(title: string, rawfilePath: string): string {
return this.showHelp(title, rawfilePath, ContentSource.RAWFILE);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showRawfileHelp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left title AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left ... | showRawfileHelp(title: string, rawfilePath: string): string {
return this.showHelp(title, rawfilePath, ContentSource.RAWFILE);
} | https://github.com/DaLongZhuaZi/manxia | 6a4da30277ee9b24345e5772d2c74e081a41b68b | github |
SMAT-Lab/PhantomRendering | Harmoney_Next-Tiktok/entry/src/main/ets/pages/Login/LoginPage.ets | arkts | aboutToAppear | 初始化时自动获取一些基本数据 | aboutToAppear(): void {
this.userInfo.tiktokNub = common.creteRandom() //获取随机生成的抖音号
this.userInfo.avatar = 'https://c-ssl.dtstatic.com/uploads/blog/202206/16/20220616151457_21591.thumb.400_0.jpg'
this.userInfo.user_id = common.creteUserID(11, 100).toString() //获取随机生产的id
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | aboutToAppear(): void {
this.userInfo.tiktokNub = common.creteRandom() //获取随机生成的抖音号
this.userInfo.avatar = 'https://c-ssl.dtstatic.com/uploads/blog/202206/16/20220616151457_21591.thumb.400_0.jpg'
this.userInfo.user_id = common.creteUserID(11, 100).toString() //获取随机生产的id
} | https://github.com/SMAT-Lab/PhantomRendering | 34e5426f306b601f739076c3dffd40322ea8ccf6 | github |
tdcare/tdwebrtc | src/main/ets/utils/LogUtil.ets | arkts | getMessage | 获取格式化日志内容 | public static getMessage(message: string[] | object[]): string {
try {
let logMessage = '';
message.forEach((msg: string | object) => {
if (typeof msg === 'object') {
if (msg instanceof Error) {
logMessage = logMessage + LogUtil.getErrorStr(msg);
} else {
... | 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 getMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left message AST#identifier#Right AST#:#Left : AS... | public static getMessage(message: string[] | object[]): string {
try {
let logMessage = '';
message.forEach((msg: string | object) => {
if (typeof msg === 'object') {
if (msg instanceof Error) {
logMessage = logMessage + LogUtil.getErrorStr(msg);
} else {
... | https://github.com/tdcare/tdwebrtc | f316f6f31b79178de72427ceaa046734e45285b6 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncArrayConcurrentQueue.ets | arkts | add | The insert operation. Returns true upon success and false if no space is currently available, non-blocking.
@param { T } element the element inserted to the ConcurrentQueue
@returns { boolean } True upon success and false if no space is currently available.
@syscap SystemCapability.Utils.Lang | public override add(element: T): boolean {
ConcurrencyHelpers.mutexLock(this.mutex);
try {
if (this.isQueueFull) {
return false;
}
this.array[this.curTailIdx] = element;
this.increaseTailIdx();
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left override AST#identifier#Right AST#identifier#Left add AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left element AST#identifier#Ri... | public override add(element: T): boolean {
ConcurrencyHelpers.mutexLock(this.mutex);
try {
if (this.isQueueFull) {
return false;
}
this.array[this.curTailIdx] = element;
this.increaseTailIdx();
... | https://gitcode.com/iop123123/arkts-static-skills | 72f7dd4edcfe36197c0972d3dfdb2133ebd35bb4 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceExecutor.ets | arkts | executeRequest | 执行HTTP请求 | private async executeRequest(request: ParsedUrlRequest): Promise<string | null> {
try {
request.url = this.normalizeRequestUrl(request.url);
if (request.requestUrl && request.requestUrl.length > 0) {
request.requestUrl = this.normalizeRequestUrl(request.requestUrl);
}
if (this.has... | 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 executeRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left request AST#identifier#Right AST#:#Lef... | private async executeRequest(request: ParsedUrlRequest): Promise<string | null> {
try {
request.url = this.normalizeRequestUrl(request.url);
if (request.requestUrl && request.requestUrl.length > 0) {
request.requestUrl = this.normalizeRequestUrl(request.requestUrl);
}
if (this.has... | https://github.com/DaLongZhuaZi/manxia | 2215db8dcfcac5f6cb070db2372b6a46d0825a07 | github |
openharmony/testfwk_arkxtest | jsunit/src_static/module/assert/deepEquals/DeepTypeUtils.ets | arkts | has | 对象是否有key属性
@param obj 对象
@param key 对象属性名称 | static has(obj: object, key: string): boolean {
if (obj === null) {
return false;
}
return obj.hasOwnProperty(key);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left has AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | static has(obj: object, key: string): boolean {
if (obj === null) {
return false;
}
return obj.hasOwnProperty(key);
} | https://gitee.com/openharmony/testfwk_arkxtest.git | ca96204124913c6e9d3b9d1c951f317d75c35530 | gitee |
Joker-x-dev/CoolMallArkTS | feature/auth/src/main/ets/component/PasswordInputField.ets | arkts | build | 构建密码输入组件
@returns {void} 无返回值 | build(): void {
ColumnStart({ widthValue: P100 }) {
IBestField({
value: this.password,
type: this.isPasswordHidden ? "password" : "normal",
showLabel: false,
labelWidth: 0,
inputAlign: "left",
inputFontSize: 16,
inputFontColor: $r("app.color.text_prima... | 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 }) {
IBestField({
value: this.password,
type: this.isPasswordHidden ? "password" : "normal",
showLabel: false,
labelWidth: 0,
inputAlign: "left",
inputFontSize: 16,
inputFontColor: $r("app.color.text_prima... | https://github.com/Joker-x-dev/CoolMallArkTS | 9fd4e32ae147c40ff2349f971172d8b17fe50b43 | github |
Vincent-Leon/zotero-harmony | entry/src/main/ets/api/ZoteroClient.ets | arkts | getItems | GET /users/{uid}/items/top. Top-level items only — child notes and
attachments are excluded (cheat sheet §9). For attachments of an item,
call getItem() and read the response's links. | async getItems(options?: ListOptions): Promise<PagedResult<ZoteroItem>> {
const uid = this.requireUserId();
const path = `/users/${uid}/items/top${buildQuery(options)}`;
const raw = await this.send(path, options !== undefined ? options.since : undefined);
return {
items: parseItems(raw.body),
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getItems AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#optional_parameter#Left AST#identifier#Left options AST#identifier#Right AST#?#Left ? AST#?#Right AST#type_annotat... | async getItems(options?: ListOptions): Promise<PagedResult<ZoteroItem>> {
const uid = this.requireUserId();
const path = `/users/${uid}/items/top${buildQuery(options)}`;
const raw = await this.send(path, options !== undefined ? options.since : undefined);
return {
items: parseItems(raw.body),
... | https://github.com/Vincent-Leon/zotero-harmony | 8d46daec540ee6a30a18e422d9a7bb8e156ddf76 | github |
midori52000/ArkPilot | Agent/entry/src/main/ets/apim/ApiManagementService.ets | arkts | addEndpoint | ========== 端点管理 ========== | addEndpoint(provider: ProviderRecord, url: string): void {
const trimmedUrl = url.trim();
if (!isValidUrl(trimmedUrl)) {
throw new ApiError(ApiErrorCode.INVALID_URL, url, '端点 URL 格式不合法');
}
if (provider.endpoints.length >= MAX_ENDPOINTS_PER_PROVIDER) {
throw new ApiError(ApiErrorCode.TOO_... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addEndpoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left provider AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ProviderRecord AST#identifier#Right AST#... | addEndpoint(provider: ProviderRecord, url: string): void {
const trimmedUrl = url.trim();
if (!isValidUrl(trimmedUrl)) {
throw new ApiError(ApiErrorCode.INVALID_URL, url, '端点 URL 格式不合法');
}
if (provider.endpoints.length >= MAX_ENDPOINTS_PER_PROVIDER) {
throw new ApiError(ApiErrorCode.TOO_... | https://github.com/midori52000/ArkPilot | fe2026b0375e2833991f27c418009526e0d7ec36 | github |
xiaofenger_705/protobuf-arkts-generator | runtime/arkpb/Writer.ets | arkts | double | Write float64 little-endian | double(v: number): Writer { const ab = new ArrayBuffer(8); const dv = new DataView(ab); dv.setFloat64(0, v, true); const u = new Uint8Array(ab); for (let i = 0; i < 8; i++) this.push(u[i]); return this } | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left double AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#Right... | double(v: number): Writer { const ab = new ArrayBuffer(8); const dv = new DataView(ab); dv.setFloat64(0, v, true); const u = new Uint8Array(ab); for (let i = 0; i < 8; i++) this.push(u[i]); return this } | https://gitcode.com/xiaofenger_705/protobuf-arkts-generator | 699c22ed38fc4731e37f122955c179bf15154ac1 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | findIndex | Finds an index of the first element in the BigUint64Array that satisfies the condition
@param fn condition
@returns the index of the first element that satisfies fn | public findIndex(fn: (val: BigInt, index: int, array: BigUint64Array) => boolean): int {
for (let i = 0; i < this.length; ++i) {
let val = this.at(i)
if (fn(val, i, this)) {
return i
}
}
return -1
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left findIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#... | public findIndex(fn: (val: BigInt, index: int, array: BigUint64Array) => boolean): int {
for (let i = 0; i < this.length; ++i) {
let val = this.at(i)
if (fn(val, i, this)) {
return i
}
}
return -1
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | c0e66b04f7328931a0cf41ec9736b0afbf1327a1 | gitee |
webabcd/HarmonyDemo | entry/src/main/ets/pages/network/HttpDemo.ets | arkts | <arrow> | 无论成功还是失败,都会先走到 httpRequest.on('dataEnd') 然后再走到这里 | (err: BusinessError, responseCode: number) => {
if (!err) {
this.message += `response code: ${responseCode}\n`
} else {
this.message += `error: ${JSON.stringify(err)}\n`
}
} | AST#program#Left AST#expression_statement#Left AST#arrow_function#Left AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left err AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#type_identifier#Left BusinessError AST#type_identifier#Right AST#type_... | (err: BusinessError, responseCode: number) => {
if (!err) {
this.message += `response code: ${responseCode}\n`
} else {
this.message += `error: ${JSON.stringify(err)}\n`
}
} | https://github.com/webabcd/HarmonyDemo | 118ffb15b741b02ffdb01c915ede1622e261b8d3 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/NetworkManager.ets | arkts | getNetworkDiagnostics | 获取网络诊断信息 | public getNetworkDiagnostics(): string[] {
const diagnostics: string[] = [];
diagnostics.push(`网络模式: ${this.config.mode}`);
diagnostics.push(`DHCP: ${this.config.enableDHCP ? '启用' : '禁用'}`);
diagnostics.push(`DNS: ${this.config.enableDNS ? '启用' : '禁用'}`);
diagnostics.push(`端口转发数量: ${this.conf... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getNetworkDiagnostics 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 ... | public getNetworkDiagnostics(): string[] {
const diagnostics: string[] = [];
diagnostics.push(`网络模式: ${this.config.mode}`);
diagnostics.push(`DHCP: ${this.config.enableDHCP ? '启用' : '禁用'}`);
diagnostics.push(`DNS: ${this.config.enableDNS ? '启用' : '禁用'}`);
diagnostics.push(`端口转发数量: ${this.conf... | https://github.com/AetheriumSimulator/qemu-hmos | 2875f15c8eb1ea45b9dae4834f5679de222baab4 | github |
YANGZX22/Voot | entry/src/main/ets/workers/NonStreamingAsrWithVadWorker.ets | arkts | handlePcm | -------- PCM handling -------- | function handlePcm(msg: PcmMessage): void {
if (!msg.pcm) {
return;
}
const chunk = new Int16Array(msg.pcm);
if (chunk.length > 0) {
pcmChunks.push(chunk);
}
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left handlePcm AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left msg AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right A... | function handlePcm(msg: PcmMessage): void {
if (!msg.pcm) {
return;
}
const chunk = new Int16Array(msg.pcm);
if (chunk.length > 0) {
pcmChunks.push(chunk);
}
} | https://github.com/YANGZX22/Voot | dd93bf27319615ba520840d50b61551b33c0871f | github |
PollenWang6/HiXD | entry/src/main/ets/utils/HttpUtil.ets | arkts | get | ===== HTTP 方法 ===== | async get(url: string, headers?: Record<string, string>, skipCookies?: boolean): Promise<HttpResponse> {
await this.loadCookies();
return this.request(url, 'GET', undefined, headers, skipCookies);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#get#Left get AST#get#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left url AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined... | async get(url: string, headers?: Record<string, string>, skipCookies?: boolean): Promise<HttpResponse> {
await this.loadCookies();
return this.request(url, 'GET', undefined, headers, skipCookies);
} | https://github.com/PollenWang6/HiXD | 41f7bdf3fbd1ad0a0de0ebd4144c024c5cb18805 | github |
offlinecat-dev/OCNetORM | src/main/ets/repository/Repository.ets | arkts | findAll | 查询所有实体
如果实体启用了软删除,默认只查询未删除的数据
查询成功后对每条记录执行 afterLoad 钩子
@param includeDeleted 是否包含已删除的数据,默认 false
@returns Promise<Array<EntityData>> | async findAll(includeDeleted: boolean = false): Promise<Array<EntityData>> {
const startTime = Date.now()
return await this.withSessionStore(async (repo) => {
try {
const store = repo.getStore()
const predicates = new relationalStore.RdbPredicates(repo.entityMetadata.tableName)
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left findAll AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left includeDeleted AST#identifier#Right AST#type_annotation#Left AST#:#Left... | async findAll(includeDeleted: boolean = false): Promise<Array<EntityData>> {
const startTime = Date.now()
return await this.withSessionStore(async (repo) => {
try {
const store = repo.getStore()
const predicates = new relationalStore.RdbPredicates(repo.entityMetadata.tableName)
... | https://github.com/offlinecat-dev/OCNetORM | c0e2b6f43dbae6bb61a8ef4146a9bbab0debb9b0 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets | arkts | constructor | Constructs a new NullPointerError 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("NullPointerError", 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("NullPointerError", message, options)
} | https://gitcode.com/iop123123/arkts-static-skills | 16376488da718b67826637e3b0670da108673e8b | gitcode |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/TouchInputHandler.ets | arkts | getTrackedForce | 获取触摸点的当前压力值
优先使用历史点追踪的 force,不可用时返回默认值 | private getTrackedForce(pointerId: number, defaultForce: number = 1.0): number {
const force = this.lastForce.get(pointerId);
return force !== undefined ? force : defaultForce;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getTrackedForce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pointerId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#n... | private getTrackedForce(pointerId: number, defaultForce: number = 1.0): number {
const force = this.lastForce.get(pointerId);
return force !== undefined ? force : defaultForce;
} | https://github.com/AlkaidLab/moonlight-harmony | 025bfea75af5df6491be4e8f2b6c4c72daecedc5 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/AdviceFeedbackDAO.ets | arkts | getPendingEvaluations | 获取需要评估的反馈(已过生效期但未评估的) | static async getPendingEvaluations(userId: number): Promise<AdviceFeedback[]> {
try {
const store = DatabaseManager.getDatabase();
const now = new Date().toISOString();
const predicates = new relationalStore.RdbPredicates(AdviceFeedback.tableName);
predicates.equalTo('user_id', user... | 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 getPendingEvaluations AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#... | static async getPendingEvaluations(userId: number): Promise<AdviceFeedback[]> {
try {
const store = DatabaseManager.getDatabase();
const now = new Date().toISOString();
const predicates = new relationalStore.RdbPredicates(AdviceFeedback.tableName);
predicates.equalTo('user_id', user... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 487f153c96e7e0869dd75f61e0ec21e96ba9fbb6 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/GyroAssistService.ets | arkts | denoisePhys | 物理摇杆去噪(对齐 Android ControllerHandler.denoisePhys)
消除微小抖动,避免物理摇杆的细微噪声干扰陀螺仪瞄准 | private denoisePhys(v: number): number {
return Math.abs(v) <= PHYS_EPSILON ? 0 : v;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left denoisePhys AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left numb... | private denoisePhys(v: number): number {
return Math.abs(v) <= PHYS_EPSILON ? 0 : v;
} | https://github.com/AlkaidLab/moonlight-harmony | 4c252e74a10c7c7b0c126b6d876b90532e6a8164 | github |
harmonyos/codelabs | HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/common/utils/FormUtils.ets | arkts | insertFormData | Insert form data
@param {Context} context Indicates the context of application or capability.
@param {FormInfo} formInfo Insert the form information to be saved. | public insertFormData(context: Context, formInfo: FormInfo): void {
RdbUtils.initDb(context, Const.RDB_NAME.dbName ? Const.RDB_NAME.dbName : '');
let isCreatePromise = RdbUtils.isCreateTable(Const.FORM_INFO.tableName ?
Const.FORM_INFO.tableName : '', columnFormInfoList);
isCreatePromise.then((result... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left insertFormData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | public insertFormData(context: Context, formInfo: FormInfo): void {
RdbUtils.initDb(context, Const.RDB_NAME.dbName ? Const.RDB_NAME.dbName : '');
let isCreatePromise = RdbUtils.isCreateTable(Const.FORM_INFO.tableName ?
Const.FORM_INFO.tableName : '', columnFormInfoList);
isCreatePromise.then((result... | https://gitee.com/harmonyos/codelabs.git | 72aea000905f279f7628c56f25d3aca8d374b869 | gitee |
huaiminqin/TankWar-Master-with-Many-Tasks | game/src/main/ets/actors/actor/DecryptPoint.ets | arkts | paint | 自定义绘制密码破译点 | paint(g: CanvasRenderingContext2D): void {
if (!this.isVisible()) return;
const x = this.getX() + this.getOffsetX();
const y = this.getY() + this.getOffsetY();
const w = this.getWidth();
const h = this.getHeight();
if (this.isDecrypted) {
// 已破译 - 绿色对勾
g.fillStyle = '#4caf50';
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left paint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left g AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CanvasRenderingContext2D AST#identifier#Right AST#)#L... | paint(g: CanvasRenderingContext2D): void {
if (!this.isVisible()) return;
const x = this.getX() + this.getOffsetX();
const y = this.getY() + this.getOffsetY();
const w = this.getWidth();
const h = this.getHeight();
if (this.isDecrypted) {
// 已破译 - 绿色对勾
g.fillStyle = '#4caf50';
... | https://github.com/huaiminqin/TankWar-Master-with-Many-Tasks | 6c864648d424ca315ef2c54cc8bf10213047fd10 | github |
the-wwyang/kids-learning-app | src/main/ets/storage/DataStorageManager.ets | arkts | getAllKeys | 获取所有键名
@param storeName 存储文件名
@returns 键名数组 | async getAllKeys(storeName: string): Promise<string[]> {
try {
const prefs = await this.getPreferences(storeName);
// HarmonyOS Preferences 没有直接获取所有key的方法
// 这里返回空数组,实际使用时需要应用层维护键列表
console.warn('[DataStorageManager] getAllKeys not fully supported');
return [];
} catch (error) {
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAllKeys AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left storeName AST#identifier#Right AST#type_annotation#Left AST#:#Left :... | async getAllKeys(storeName: string): Promise<string[]> {
try {
const prefs = await this.getPreferences(storeName);
// HarmonyOS Preferences 没有直接获取所有key的方法
// 这里返回空数组,实际使用时需要应用层维护键列表
console.warn('[DataStorageManager] getAllKeys not fully supported');
return [];
} catch (error) {
... | https://github.com/the-wwyang/kids-learning-app | ee309149d1ffc5afef0070b64ab4026219e0bc38 | github |
Joker-x-dev/CoolMallArkTS | feature/launch/src/main/ets/navigation/LaunchGraph.ets | arkts | register | 注册启动模块导航路由 | register(): void {
RouteBuild.register(LaunchRoutes.Splash, wrapBuilder(SplashNav));
RouteBuild.register(LaunchRoutes.Guide, wrapBuilder(GuideNav));
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left register 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#Lef... | register(): void {
RouteBuild.register(LaunchRoutes.Splash, wrapBuilder(SplashNav));
RouteBuild.register(LaunchRoutes.Guide, wrapBuilder(GuideNav));
} | https://github.com/Joker-x-dev/CoolMallArkTS | 7e4626604ae9e58bacd36caca5103ea8be976236 | github |
OHPG/FinSdk | komga/src/main/ets/api/SystemApi.ets | arkts | getActuatorInfo | getActuatorInfo
@summary Gets information about the server.
@throws {RequiredError}
@memberof SystemApi | public async getActuatorInfo(): Promise<ActuatorInfo> {
return this.apiClient.get({ path: "/actuator/info" })
} | 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 getActuatorInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#... | public async getActuatorInfo(): Promise<ActuatorInfo> {
return this.apiClient.get({ path: "/actuator/info" })
} | https://github.com/OHPG/FinSdk | 2d5ebe8f897fa24088ab5dc38604c06dfe9d1ff8 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | updateComicSourceCookies | @deprecated 请使用 updateComicSourceCookiesByPkg | async updateComicSourceCookies(sourceId: number, cookiesJson: string): Promise<void> {
try {
const sql: string = `UPDATE comic_source SET cookies = ? WHERE id = ?`;
await this.databaseManager.executeSql(sql, [cookiesJson, String(sourceId)]);
logger.info(TAG, `已更新图源Cookie到comic_source: sourceId=$... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateComicSourceCookies AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left... | async updateComicSourceCookies(sourceId: number, cookiesJson: string): Promise<void> {
try {
const sql: string = `UPDATE comic_source SET cookies = ? WHERE id = ?`;
await this.databaseManager.executeSql(sql, [cookiesJson, String(sourceId)]);
logger.info(TAG, `已更新图源Cookie到comic_source: sourceId=$... | https://github.com/DaLongZhuaZi/manxia | da1f133772aefa77328837216d9f7a3eb5726f7f | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/config/RouteConfigManager.ets | arkts | addRoute | 添加新路由
@param path 路由路径
@param meta 路由元信息(可选) | public addRoute(path: string, meta?: RouteMeta): void {
const normalizedPath = this.normalizePath(path);
this.routes.add(normalizedPath);
if (meta) {
this.routeMetas.set(normalizedPath, meta);
}
console.info(`[RouteConfigManager] 添加路由: ${normalizedPath}`);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addRoute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string ... | public addRoute(path: string, meta?: RouteMeta): void {
const normalizedPath = this.normalizePath(path);
this.routes.add(normalizedPath);
if (meta) {
this.routeMetas.set(normalizedPath, meta);
}
console.info(`[RouteConfigManager] 添加路由: ${normalizedPath}`);
} | https://github.com/LJ666-ui/harmony-health-care | ac3667b6acb22d3eae66d47da17f57931fcb004f | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/bitwise_or/bitwise_or_byte.ets | arkts | main | ---
desc: check bitwise OR of two bytes
--- | function main(): void {
const a: byte = {{v.left}}
const b: byte = {{v.right}}
assert (a | b) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A... | function main(): void {
const a: byte = {{v.left}}
const b: byte = {{v.right}}
assert (a | b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 276a7c0b4cd4267d3330eca47ed39563e1473144 | gitee |
LongLiveY96/chatcube | entry/src/main/ets/viewmodels/ChatViewModel.ets | arkts | handleHostedResponsesToolEvent | OpenAI Responses 内置工具 (web_search / image_generation) 状态事件处理。
设计要点:
- 每次 web_search_call 创建一个独立的 TOOL part 写入 aiMessage.parts (toolCallId='hws_<itemId>'),
后续 in_progress / searching / completed 只更新这一个 part. 保证 "新一轮搜索 ≠ 覆盖老结果",
timeline 上能逐条看到每一次搜索的 query/状态, 不再使用 message.searchQuery 字符串拼接的低质量呈现。
- aiMessage.isSearching... | private handleHostedResponsesToolEvent(
aiMessage: ChatMessage,
event: HostedResponsesToolEvent,
onAIMessageUpdated: (message: ChatMessage) => void
): void {
const kind = event.kind
if (kind === HostedResponsesToolEventKind.WEB_SEARCH_STARTED ||
kind === HostedResponsesToolEventKind.WEB_SE... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handleHostedResponsesToolEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left aiMessage AST#identifie... | private handleHostedResponsesToolEvent(
aiMessage: ChatMessage,
event: HostedResponsesToolEvent,
onAIMessageUpdated: (message: ChatMessage) => void
): void {
const kind = event.kind
if (kind === HostedResponsesToolEventKind.WEB_SEARCH_STARTED ||
kind === HostedResponsesToolEventKind.WEB_SE... | https://github.com/LongLiveY96/chatcube | f6e62afabc6901b287d6b9c152a547c217c0506d | github |
OnceWeWere/Weather_HarmonyOS | entry/src/main/ets/pages/Index.ets | arkts | onPageShow | 2. 页面显示生命周期 | onPageShow() {
setTimeout(() => {
if (this.isSwitchingCity) {
return;
}
if (this.refreshCityInfo && this.refreshCityInfo.adcode && this.refreshCityInfo.adcode !== '') {
const adcode = this.refreshCityInfo.adcode;
const cityName = this.refreshCityInfo.cityName;
thi... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPageShow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS... | onPageShow() {
setTimeout(() => {
if (this.isSwitchingCity) {
return;
}
if (this.refreshCityInfo && this.refreshCityInfo.adcode && this.refreshCityInfo.adcode !== '') {
const adcode = this.refreshCityInfo.adcode;
const cityName = this.refreshCityInfo.cityName;
thi... | https://github.com/OnceWeWere/Weather_HarmonyOS | 0297a88bdd33cbfd2ee4ae7e25ff34fa84c62ba6 | github |
openharmony-sig/online_event | solution_student_challenge/基于OpenHarmony的OpenGit_潘骏翔/OpenGit/entry/src/main/ets/MainAbility/pages/index.ets | arkts | onPageShow | 当前是否登录,通过AppStorage
页面生命周期,用于判断并进行闪屏 | onPageShow() {
console.info('isLogin: ' + this.isLogin)
//判断当前是否已登录,若已登录直接跳转到主页面
//TODO 在这里进行数据加载
if (this.isLogin) {
//执行暂停1.5s后跳转到main页面的命令
Sleep(1500).then(() => {
router.push({ url: 'pages/main/main' })
})
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPageShow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS... | onPageShow() {
console.info('isLogin: ' + this.isLogin)
//判断当前是否已登录,若已登录直接跳转到主页面
//TODO 在这里进行数据加载
if (this.isLogin) {
//执行暂停1.5s后跳转到main页面的命令
Sleep(1500).then(() => {
router.push({ url: 'pages/main/main' })
})
}
} | https://gitee.com/openharmony-sig/online_event.git | c2d1ae1ce9f1270de3301b8cd627b2e8e02fb464 | gitee |
Cool_foolisher1/ArkTSRepository | GraphicalCode/features/algorithm/src/main/ets/service/AlgorithmService.ets | arkts | getComponentDetail | 获取组件详情
@param componentId number
@returns ComponentDetailModel | public getComponentDetail(componentId: number): Promise<ComponentDetailModel> {
return new Promise((resolve: (value: ComponentDetailModel) => void, reject: (reason?: Object) => void) => {
this.getComponentDetailDataByLocal().then((result: ComponentDetailModel[]) => {
const item = result.find((item: ... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getComponentDetail AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left componentId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST... | public getComponentDetail(componentId: number): Promise<ComponentDetailModel> {
return new Promise((resolve: (value: ComponentDetailModel) => void, reject: (reason?: Object) => void) => {
this.getComponentDetailDataByLocal().then((result: ComponentDetailModel[]) => {
const item = result.find((item: ... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | f818b4a4a66ed88b2cf3942869bdcca31e2ccba7 | gitcode |
wodekouwei/qlog | qloglib/src/main/ets/qlog/Logg.ets | arkts | getAndSwitchLogFiles | 获取所有的日志文件列表,不包括正在写入的文件。文件路径为绝对路径。之后的log写入到新的文件中 | public static getAndSwitchLogFiles():Promise<string[]> {
return LogFileProvider.getHistoryLogFiles();
} | 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 getAndSwitchLogFiles AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | public static getAndSwitchLogFiles():Promise<string[]> {
return LogFileProvider.getHistoryLogFiles();
} | https://gitcode.com/wodekouwei/qlog | 7303a5ff213bd1a1553682a38dff8ab77980a226 | gitcode |
LZZLHY/hlib | entry/src/main/ets/viewmodel/DownloadVM.ets | arkts | startInternal | 实际启动逻辑。`overrideDomain` 非空时用它拼下载 URL(自动镜像漂移路径用),
否则用 HttpClient 当前 domain。 | private static async startInternal(
book: Book,
ctx: common.UIAbilityContext,
overrideDomain: string | undefined,
): Promise<DownloadTask> {
if (!DownloadVM.canDownload(book)) {
throw new Error('no_download_link');
}
const bookId: string = String(book.id);
const hashId: string = bo... | 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 startInternal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left b... | private static async startInternal(
book: Book,
ctx: common.UIAbilityContext,
overrideDomain: string | undefined,
): Promise<DownloadTask> {
if (!DownloadVM.canDownload(book)) {
throw new Error('no_download_link');
}
const bookId: string = String(book.id);
const hashId: string = bo... | https://github.com/LZZLHY/hlib | d46e14bba898e72139af85104059f363a5a5a68a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/GlobalAnimationSystem.ets | arkts | getActiveAnimations | 获取所有活跃动画 | public getActiveAnimations(): Map<string, AnimationState> {
return new Map(this.activeAnimations);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getActiveAnimations 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#ex... | public getActiveAnimations(): Map<string, AnimationState> {
return new Map(this.activeAnimations);
} | https://github.com/DaLongZhuaZi/manxia | 4a17b109e4abd060a08aa12bb434e1e1dda0ba00 | github |
AGenUI/AGenUI | playground/harmony/entry/src/main/ets/utils/PlaygroundRuntimeLogger.ets | arkts | getFullTimestamp | Get full timestamp for file name
Format: yyyyMMdd_HHmmss_SSS (e.g., 20260510_143025_123) | private getFullTimestamp(date: Date): string {
const year = date.getFullYear();
const month = this.padZero(date.getMonth() + 1, 2);
const day = this.padZero(date.getDate(), 2);
const hours = this.padZero(date.getHours(), 2);
const minutes = this.padZero(date.getMinutes(), 2);
const seconds = t... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getFullTimestamp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | private getFullTimestamp(date: Date): string {
const year = date.getFullYear();
const month = this.padZero(date.getMonth() + 1, 2);
const day = this.padZero(date.getDate(), 2);
const hours = this.padZero(date.getHours(), 2);
const minutes = this.padZero(date.getMinutes(), 2);
const seconds = t... | https://github.com/AGenUI/AGenUI | e455cbfe309913517c1a97e38145e3b8f31ef9fa | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectMethod.ets | arkts | getName | Gets the name of the method.
@returns { string } Returns the name string of the method. | public getName(): string {
return this.name ?? Method.getNameInternal(this.methodPtr)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getName 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#... | public getName(): string {
return this.name ?? Method.getNameInternal(this.methodPtr)
} | https://gitcode.com/iop123123/arkts-static-skills | 779c0994b74981bb4d552dd807baae25558248d4 | gitcode |
openharmony-sig/flutter_packages | packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/ViewFlutterApiImpl.ets | arkts | constructor | Constructs a {@link ViewFlutterApiImpl}.
@param binaryMessenger used to communicate with Dart over asynchronous messages
@param instanceManager maintains instances stored to communicate with attached Dart objects | constructor(binaryMessenger: BinaryMessenger, instanceManager: InstanceManager) {
this.binaryMessenger = binaryMessenger;
this.instanceManager = instanceManager;
this.api = new ViewFlutterApi(binaryMessenger);
} | 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 binaryMessenger AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left BinaryMessenger AS... | constructor(binaryMessenger: BinaryMessenger, instanceManager: InstanceManager) {
this.binaryMessenger = binaryMessenger;
this.instanceManager = instanceManager;
this.api = new ViewFlutterApi(binaryMessenger);
} | https://gitee.com/openharmony-sig/flutter_packages.git | d3dba09112c414a5975bc615c8751bac57972802 | gitee |
Nekofox-POT/LinMusic | entry/src/main/ets/建筑垃圾堆/class_audio_ffmpeg_player.ets | arkts | play_data_save | 播放数据保存 // | play_data_save() {
if (!this.global_config?.reset) {
// 保存播放列表
array_to_json_save(this.play_list, audio_player_path + '/playing_data_list.json')
// 保存其他元数据
let tmp: string[] = [
`${this.play_list_index}`,
`${this.current_backup}`,
`${this.play_mode}`
]
a... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left play_data_save 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... | play_data_save() {
if (!this.global_config?.reset) {
// 保存播放列表
array_to_json_save(this.play_list, audio_player_path + '/playing_data_list.json')
// 保存其他元数据
let tmp: string[] = [
`${this.play_list_index}`,
`${this.current_backup}`,
`${this.play_mode}`
]
a... | https://github.com/Nekofox-POT/LinMusic | 74cdf10976afdc3bc3633e38e49d0a0b209fddad | github |
kumaleap/ArkLuban | library/src/main/ets/luban/LubanUtils.ets | arkts | deleteFile | 删除文件
@param filePath 文件路径
@returns 是否删除成功 | static deleteFile(filePath: string): boolean {
try {
if (fileIo.accessSync(filePath)) {
fileIo.unlinkSync(filePath);
return true;
}
return false;
} catch (error) {
LogUtil.error('删除文件失败:', error);
return false;
}
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left deleteFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Rig... | static deleteFile(filePath: string): boolean {
try {
if (fileIo.accessSync(filePath)) {
fileIo.unlinkSync(filePath);
return true;
}
return false;
} catch (error) {
LogUtil.error('删除文件失败:', error);
return false;
}
} | https://github.com/kumaleap/ArkLuban | 5fc6688ee90a3bda5f168d2eef3bd38f46b067a0 | github |
holg/eulumdat-rs | EulumdatHarmonyOS/Eulumdat/entry/src/main/ets/model/EulumdatEngine.ets | arkts | butterflySvg | Generate butterfly (3D) diagram SVG
@param width SVG width in pixels
@param height SVG height in pixels
@param tiltDegrees Tilt angle in degrees
@param theme Light or Dark theme
@returns SVG string | public butterflySvg(width: number = 400, height: number = 400, tiltDegrees: number = 60, theme: SvgTheme = SvgTheme.Light): string {
return eulumdat_napi.butterflySvg(width, height, tiltDegrees, theme);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left butterflySvg AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left width AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_express... | public butterflySvg(width: number = 400, height: number = 400, tiltDegrees: number = 60, theme: SvgTheme = SvgTheme.Light): string {
return eulumdat_napi.butterflySvg(width, height, tiltDegrees, theme);
} | https://github.com/holg/eulumdat-rs | 3d82f7fca4ffad5ce1609909c3928dca10d2b0db | github |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryBuilder.ets | arkts | getSubQueries | 获取子查询列表
@returns 子查询数组 | getSubQueries(): Array<SubQuery> {
return this.subQueries.slice()
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getSubQueries AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Righ... | getSubQueries(): Array<SubQuery> {
return this.subQueries.slice()
} | https://github.com/offlinecat-dev/OCNetORM | 37aa245ab8351b9b634a050e9e2bbd4c973379a0 | github |
openharmony/arkui_advanced_ui_component | atomicserviceweb/source/atomicserviceweb.ets | arkts | reportComponentEvent | asweb 组件创建打点
@param apiName 接口名
@param actionState 接口调用状态
@param errorNumber 错误码 | public static reportComponentEvent(): void {
try {
HiAnalyticsUtil.initAnalytics();
const content: string = JSON.stringify({
appIdentify: HiAnalyticsUtil.appIdentifier, // 获取元服务appid
ascfVersionName: deviceInfo.displayVersion, // rom版本号
runningMode: HiAnalyticsUtil.runningMode... | 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 reportComponentEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | public static reportComponentEvent(): void {
try {
HiAnalyticsUtil.initAnalytics();
const content: string = JSON.stringify({
appIdentify: HiAnalyticsUtil.appIdentifier, // 获取元服务appid
ascfVersionName: deviceInfo.displayVersion, // rom版本号
runningMode: HiAnalyticsUtil.runningMode... | https://gitee.com/openharmony/arkui_advanced_ui_component.git | c3fb9f65dbb8cb98063c61c304512f1c6d6b2ad2 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Value.ets | arkts | getField | Returns ith field of value
@param i index
@throws error when i greater then field's number
@returns field {@link reflect.Value} | public getField(i: long): reflect.Value {
let f = this.typ.getField(i)
if (f.isStatic()) {
throw new Error("Field must be not static")
}
let ft = f.getType()
if (!ft.isReference()) {
if (ft instanceof BooleanType) {
return new BooleanVa... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getField 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 long AST#i... | public getField(i: long): reflect.Value {
let f = this.typ.getField(i)
if (f.isStatic()) {
throw new Error("Field must be not static")
}
let ft = f.getType()
if (!ft.isReference()) {
if (ft instanceof BooleanType) {
return new BooleanVa... | https://gitcode.com/iop123123/arkts-static-skills | 228fab8967240e19b4384fcbd50a0d77a498ceb5 | gitcode |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | safeCalculatePath | ==================== 异常处理和错误恢复 ====================
安全执行路径计算(带异常处理) | public async safeCalculatePath(
startPos: Position3D,
destPos: Position3D,
options?: PathPlanningOptions
): Promise<PathCalculationResult> {
try {
// 验证输入参数
if (!this.validatePosition(startPos)) {
return { success: false, error: '起点位置无效' } as PathCalculationResult;
}
... | 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 safeCalculatePath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left startPos AST#identifier#Right AST#:#Le... | public async safeCalculatePath(
startPos: Position3D,
destPos: Position3D,
options?: PathPlanningOptions
): Promise<PathCalculationResult> {
try {
// 验证输入参数
if (!this.validatePosition(startPos)) {
return { success: false, error: '起点位置无效' } as PathCalculationResult;
}
... | https://github.com/LJ666-ui/harmony-health-care | c382734b0db931c78e4c9227dcc7ea2865de94ac | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.url.ets | arkts | toString | Returns the serialized URL as a string.
@returns { string } Returns the serialized URL as a string. | toString(): string {
return this.cHref;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toString 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#statement_blo... | toString(): string {
return this.cHref;
} | https://gitcode.com/iop123123/arkts-static-skills | acc4937c09ef9f6edb8f4f4ae5277cd7fdbd258b | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | fill | Fills the Int16Array with specified value
@param { short } value - new value
@param { int } [start] - start index to begin fill from
@param { int } [end] - last index to end fill from, excluded
@returns { this } - modified Int16Array
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public fill(value: short, start?: int, end?: int): this {
const k = normalizeIndex(start ?? 0, this.lengthInt)
const finalPos = normalizeIndex(end ?? this.lengthInt, this.lengthInt)
this.fillInternal(value, k, finalPos)
return this
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left fill AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERR... | public fill(value: short, start?: int, end?: int): this {
const k = normalizeIndex(start ?? 0, this.lengthInt)
const finalPos = normalizeIndex(end ?? this.lengthInt, this.lengthInt)
this.fillInternal(value, k, finalPos)
return this
} | https://gitcode.com/iop123123/arkts-static-skills | 2b32e6760a82f6e3ff6eba7ad7a2db7ed779db9a | gitcode |
openharmony/xts_tools | sample/AppSampleD/entry/src/main/ets/component/MessageComponent.ets | arkts | aboutToAppear | 对端用户信息 | aboutToAppear(){
// globalThis.oppositeUser = new User('13222222222',$r('app.media.ic_headphoto_2'));
if (AppStorage.get("currentUser")) {
this.currentUser = AppStorage.get("currentUser")!;
}
if (AppStorage.get("oppositeUser")) {
this.oppositeUser = AppStorage.get("oppositeUser")!;
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear(){
// globalThis.oppositeUser = new User('13222222222',$r('app.media.ic_headphoto_2'));
if (AppStorage.get("currentUser")) {
this.currentUser = AppStorage.get("currentUser")!;
}
if (AppStorage.get("oppositeUser")) {
this.oppositeUser = AppStorage.get("oppositeUser")!;
... | https://gitee.com/openharmony/xts_tools.git | 5b99f94a4301875792787176dd0f0ced9630010e | gitee |
jjjjjjava/ffmpeg_tools | src/main/ets/ffmpeg/Task.ets | arkts | isCancelled | ==================== 状态管理 ==================== | public isCancelled(): boolean {
return this.cancelled;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isCancelled 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#b... | public isCancelled(): boolean {
return this.cancelled;
} | https://github.com/jjjjjjava/ffmpeg_tools | 178900b21636bad1b5e33677a56033215d43fde7 | github |
XJTUWYD/ArkDiff | entry/src/main/ets/entryability/EntryAbility.ets | arkts | onNewWant | 应用已运行时再次被"分享"唤起 | onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {
const text = this.extractSharedText(want);
if (text.length === 0) return;
AppStorage.setOrCreate('pendingSharedText', text);
// 若 UI 已就绪,直接跳到工作台让用户立即处理分享内容
try {
if (this.mainUiContext) {
this.mainUiContext.getRo... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onNewWant AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifier#Right AST#,#Left , AST#,#R... | onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {
const text = this.extractSharedText(want);
if (text.length === 0) return;
AppStorage.setOrCreate('pendingSharedText', text);
// 若 UI 已就绪,直接跳到工作台让用户立即处理分享内容
try {
if (this.mainUiContext) {
this.mainUiContext.getRo... | https://github.com/XJTUWYD/ArkDiff | e85be78e348097aa8508df39b03e04ced10932cf | github |
bhengubv/aether-protocol | arkts/src/main/ets/incentive/TipPacketPayload.ets | arkts | buildCanonicalData | Builds the canonical byte array that is signed/verified for this payload. The
`signature` field itself is excluded.
Layout (little-endian lengths):
TipperLen(4 LE i32) || Tipper(UTF-8)
RecipientLen(4 LE i32) || Recipient(UTF-8)
AmountLen(4 LE i32) || Amount(UTF-8, invariant round-trip decimal string)
TrafficLen(4... | buildCanonicalData(): Uint8Array {
const tipperBytes: Uint8Array = utf8Encode(this.tipperUhid);
const recipientBytes: Uint8Array = utf8Encode(this.recipientUhid);
const amountBytes: Uint8Array = utf8Encode(this.amount);
const trafficBytes: Uint8Array = utf8Encode(this.trafficType);
const totalLen... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left buildCanonicalData 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 Uint8Array AST#identifier#Right AST#ERROR#R... | buildCanonicalData(): Uint8Array {
const tipperBytes: Uint8Array = utf8Encode(this.tipperUhid);
const recipientBytes: Uint8Array = utf8Encode(this.recipientUhid);
const amountBytes: Uint8Array = utf8Encode(this.amount);
const trafficBytes: Uint8Array = utf8Encode(this.trafficType);
const totalLen... | https://github.com/bhengubv/aether-protocol | fb440067fc63dac87846aacc444833867021d58c | github |
CLMC2025/Vignette | entry/src/main/ets/ui/Animations.ets | arkts | AnimatedContent | 动画构建器 | @Builder
function AnimatedContent(
key: string,
config: AnimationConfig,
progress: number
): void {
Column() {
// 内容直接嵌入,不通过函数调用
}
.opacity(progress)
.scale({
x: config.type === AnimationType.SCALE_IN ? progress : 1,
y: config.type === AnimationType.SCALE_IN ? progress : 1
})
.animation({
... | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left AnimatedContent AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#r... | @Builder
function AnimatedContent(
key: string,
config: AnimationConfig,
progress: number
): void {
Column() {
// 内容直接嵌入,不通过函数调用
}
.opacity(progress)
.scale({
x: config.type === AnimationType.SCALE_IN ? progress : 1,
y: config.type === AnimationType.SCALE_IN ? progress : 1
})
.animation({
... | https://github.com/CLMC2025/Vignette | 34de42678c1798aca9dd5404bd04d208b0ba4ba1 | github |
fbinba3955/Flymby | common/src/main/ets/utils/VolumeUtil.ets | arkts | getMediaVolume | 获取当前媒体音量
@returns 音量值 0.0-1.0 | public static async getMediaVolume(): Promise<number> {
try {
if (!VolumeUtil.audioVolumeGroupManager) {
LogUtil.error('VolumeUtil 音量组管理器未初始化');
return VolumeUtil.DEFAULT_VOLUME;
}
// 使用音量组管理器的同步方法获取音量
const systemVolume = VolumeUtil.audioVolumeGroupManager.getVolumeSync(a... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left getMediaVolume AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments... | public static async getMediaVolume(): Promise<number> {
try {
if (!VolumeUtil.audioVolumeGroupManager) {
LogUtil.error('VolumeUtil 音量组管理器未初始化');
return VolumeUtil.DEFAULT_VOLUME;
}
// 使用音量组管理器的同步方法获取音量
const systemVolume = VolumeUtil.audioVolumeGroupManager.getVolumeSync(a... | https://github.com/fbinba3955/Flymby | 9adfaee12a4fd10b7e43f8b40ed9c3b5e4293276 | github |
openharmony-sig/flutter_packages | packages/local_auth/local_auth_ohos/ohos/src/main/ets/io/flutter/plugins/localauth/LocalAuthPlugin.ets | arkts | stop | Stops the biometric listener. | stop(): void {
try {
// this.off('result', {
// onResult (result) {
// Log.i(TAG, 'auth off result: ' + JSON.stringify(result));
// }
// });
Log.i(TAG, 'auth off success');
} catch (error) {
Log.e(TAG, 'auth catch error: ' + JSON.stringify(error));
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left stop 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 AS... | stop(): void {
try {
// this.off('result', {
// onResult (result) {
// Log.i(TAG, 'auth off result: ' + JSON.stringify(result));
// }
// });
Log.i(TAG, 'auth off success');
} catch (error) {
Log.e(TAG, 'auth catch error: ' + JSON.stringify(error));
}
} | https://gitee.com/openharmony-sig/flutter_packages.git | 1e1314d16ce8a01063391c1f89f5a5a0d1422a52 | gitee |
openharmony/applications_contacts | feature/call/src/main/ets/missedcall/MissedCallNotifier.ets | arkts | cancelAllNotification | cancel Missed Call Notification | public cancelAllNotification() {
HiLog.i(TAG, 'cancelNotification,cancel all')
this.setMissedBadgeNumber(0);
NotificationManager.cancelGroup(GROUP_NAME).catch((error: Error) => {
HiLog.e(TAG, `cancelNotification,err ${JSON.stringify(error)}}`)
});
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left cancelAllNotification 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#... | public cancelAllNotification() {
HiLog.i(TAG, 'cancelNotification,cancel all')
this.setMissedBadgeNumber(0);
NotificationManager.cancelGroup(GROUP_NAME).catch((error: Error) => {
HiLog.e(TAG, `cancelNotification,err ${JSON.stringify(error)}}`)
});
} | https://gitee.com/openharmony/applications_contacts.git | a00d01178925d5c905f289bc93dae663720abea4 | gitee |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test22_original_index.ets | arkts | testMathMinMax | --- Math.min/max with multiple args --- | function testMathMinMax(): string {
let min: number = Math.min(5, 2, 8, 1, 9);
let max: number = Math.max(5, 2, 8, 1, 9);
return String(min) + ',' + String(max);
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testMathMinMax 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_t... | function testMathMinMax(): string {
let min: number = Math.min(5, 2, 8, 1, 9);
let max: number = Math.max(5, 2, 8, 1, 9);
return String(min) + ',' + String(max);
} | https://github.com/miaochiahao/ark-ghidra | a1c0dfe2b07c2f8124c06d042742156f3f0875dc | github |
XHXYT/Pixark | entry/src/main/ets/viewmodel/SearchViewModel.ets | arkts | loadData | 加载 搜索历史 & 推荐标签 | async loadData() {
// 每次加载搜索主页数据时,先重置一下状态,避免模式切换后的残留
this.resetSearchState();
try {
// await this.getDB().fixNullSearchType();
const mode = appSettings.novel_mode ? 'novel' : 'illust';
const values = await this.getDB().queryByMode(mode)
this.searchHistory = values
} catch (e) {... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left loadData 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#{#Left { AST#{#Right... | async loadData() {
// 每次加载搜索主页数据时,先重置一下状态,避免模式切换后的残留
this.resetSearchState();
try {
// await this.getDB().fixNullSearchType();
const mode = appSettings.novel_mode ? 'novel' : 'illust';
const values = await this.getDB().queryByMode(mode)
this.searchHistory = values
} catch (e) {... | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/SearchViewModel.ets#L101-L117 | 6fea8529f30699d6489c4268914f0c05f3220703 | github |
itrainhub/wu-ui | WuUI/wu_ui/src/main/ets/components/field/index.ets | arkts | validateField | 字段校验
@param value
@param type
@returns | validateField(value: string, type: 'blur' | 'change') {
return new Promise<boolean>((resolve, reject) => {
for(let i = 0, len = this.rules.length; i < len; i++) {
const rule: WuFormRule = this.rules[i]
// 没有校验时机,则默认 blur
rule.trigger = rule.trigger ?? 'blur'
// 是否触发... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left validateField 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#Righ... | validateField(value: string, type: 'blur' | 'change') {
return new Promise<boolean>((resolve, reject) => {
for(let i = 0, len = this.rules.length; i < len; i++) {
const rule: WuFormRule = this.rules[i]
// 没有校验时机,则默认 blur
rule.trigger = rule.trigger ?? 'blur'
// 是否触发... | https://github.com/itrainhub/wu-ui | 777edbb376e5381c6fffaba0678c71fcf3f6a939 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/Message.ets | arkts | constructor | Create a message instance with message identifier and additional object
@param { int } what The message identifier
@param { Any } obj Additional object data
@param { MessageHandler } handler The message handler | constructor(what: int, obj: Any, handler: concurrency.MessageHandler) {
this.handler = handler;
this.what = what;
this.obj = obj;
} | 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 what AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Right AST#ERROR#Right AST#... | constructor(what: int, obj: Any, handler: concurrency.MessageHandler) {
this.handler = handler;
this.what = what;
this.obj = obj;
} | https://gitcode.com/iop123123/arkts-static-skills | 23ff8204c341e0c3e48ca0e0dbaba16b78a12cea | gitcode |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/LineDataSet.ets | arkts | setCircleHoleRadius | Sets the hole radius of the drawn circles.
Default radius = 2f, Min = 0.5f
@param holeRadius | public setCircleHoleRadius(holeRadius: number): void {
if (holeRadius >= 0.5) {
// this.mCircleHoleRadius = Utils.convertDpToPixel(holeRadius);
this.mCircleHoleRadius = holeRadius;
} else {
LogUtil.log("LineDataSet", "Circle radius cannot be < 0.5")
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setCircleHoleRadius AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left holeRadius AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST... | public setCircleHoleRadius(holeRadius: number): void {
if (holeRadius >= 0.5) {
// this.mCircleHoleRadius = Utils.convertDpToPixel(holeRadius);
this.mCircleHoleRadius = holeRadius;
} else {
LogUtil.log("LineDataSet", "Circle radius cannot be < 0.5")
}
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | f536d193547bc6439d0544d30335dec840939336 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Database/DatabaseTypes.ets | arkts | createFavoriteInfoRecord | 创建收藏信息数据库记录 | static createFavoriteInfoRecord(): FavoriteInfoDatabaseRecord {
return {
id: '',
comicId: '',
userId: '',
addTime: 0,
lastReadChapterId: null,
lastReadTime: null,
tags: '[]',
notes: null
};
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createFavoriteInfoRecord 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#Le... | static createFavoriteInfoRecord(): FavoriteInfoDatabaseRecord {
return {
id: '',
comicId: '',
userId: '',
addTime: 0,
lastReadChapterId: null,
lastReadTime: null,
tags: '[]',
notes: null
};
} | https://github.com/DaLongZhuaZi/manxia | 1a77bd571f9f9a92a5caba7ada55d4c025307032 | github |
Delsin-Yu/JustPDF | entry/src/main/ets/pages/pdfview/PDFLinkJumpHistory.ets | arkts | popBack | 后退:弹出后退栈顶页,并将当前页压入前进栈。 | popBack(currentPageIndex: number): number | undefined {
const backLen = this.backStack.length;
if (backLen === 0) {
return undefined;
}
const target = this.backStack[backLen - 1];
this.backStack = this.backStack.slice(0, backLen - 1);
this.forwardStack = [...this.forwardStack, currentPag... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left popBack AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left currentPageIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#num... | popBack(currentPageIndex: number): number | undefined {
const backLen = this.backStack.length;
if (backLen === 0) {
return undefined;
}
const target = this.backStack[backLen - 1];
this.backStack = this.backStack.slice(0, backLen - 1);
this.forwardStack = [...this.forwardStack, currentPag... | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/pages/pdfview/PDFLinkJumpHistory.ets#L29-L38 | 969c47db425cfc313d683693a6b3572c2b1ecce9 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | includes | Checks if specified argument is in BigInt64Array
@param e search element
@param fromIndex start index to search from
@returns true if e is in BigInt64Array, false otherwise | public includes(e: BigInt, fromIndex: number): boolean {
return this.includes(e.getLong(), fromIndex as int)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left includes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left e AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left BigInt AST... | public includes(e: BigInt, fromIndex: number): boolean {
return this.includes(e.getLong(), fromIndex as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 41e8359809082b942e1278338662aed8abed40ee | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.