nwo stringclasses 449
values | path stringlengths 9 173 | language stringclasses 1
value | identifier stringlengths 1 53 | docstring stringlengths 5 4.13k | function stringlengths 10 87.2k | ast_function stringlengths 351 354k | obf_function stringlengths 10 87.2k | url stringlengths 30 175 | function_sha stringlengths 40 40 | source stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Error.ets | arkts | toString | Converts this error to a string
Result includes error message and the stacktrace
@returns result of the conversion | override toString(): String {
let s: String = "";
if (this.message != "") {
s += this.name + ": " + this.message + "\n";
}
for (let i: int = (this.stack.length > 2 ? 2 : 0); i < this.stack.length; i++) {
s += this.stack[i];
if (i != this.stack.length - 1) {
s += "\n";
... | AST#program#Left AST#ERROR#Left AST#override#Left override AST#override#Right 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#identifier#Left String ... | override toString(): String {
let s: String = "";
if (this.message != "") {
s += this.name + ": " + this.message + "\n";
}
for (let i: int = (this.stack.length > 2 ? 2 : 0); i < this.stack.length; i++) {
s += this.stack[i];
if (i != this.stack.length - 1) {
s += "\n";
... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | ed5c49b4fc96cf25a23037657d577f02c71f346e | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets | arkts | executeCustomWorkflow | 执行自定义工作流
@param workflowName 工作流名称
@param page 页码
@param params 额外参数 | async executeCustomWorkflow(
workflowName: string,
page: number = 1,
params?: FilterParams
): Promise<EngineResult<SearchResult>> {
if (!this.config) {
logger.error(TAG, '配置未加载,无法执行自定义工作流');
throw new MangaSourceError(
MangaSourceErrorCode.CONFIG_NOT_LOADED,
'配置未加载'
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left executeCustomWorkflow AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left workflowName AST#identi... | async executeCustomWorkflow(
workflowName: string,
page: number = 1,
params?: FilterParams
): Promise<EngineResult<SearchResult>> {
if (!this.config) {
logger.error(TAG, '配置未加载,无法执行自定义工作流');
throw new MangaSourceError(
MangaSourceErrorCode.CONFIG_NOT_LOADED,
'配置未加载'
... | https://github.com/DaLongZhuaZi/manxia | e75f02bc54033fc18242d9536d6d1f0c8ff42d57 | github |
arkui-x/samples | CodeLab/Cases/feature/h5cache/src/main/ets/diskLruCache/DiskCacheEntry.ets | arkts | getSize | 返回缓存文件大小 | getSize(): number {
return this.size;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statement_bloc... | getSize(): number {
return this.size;
} | https://gitcode.com/arkui-x/samples | ab60aceb2c3dfe12be9641d0942a34974ea7cdcc | gitcode |
harmonyos/codelabs | HarmonyOS_NEXT/OxHornCampus/entry/src/main/ets/viewmodel/TrainsMapModel.ets | arkts | calcDelay | Calculate the time interval for redrawing. | calcDelay(distance: number, line: number): number {
let ret: number = 0;
switch (line) {
case TrainsLine.LINE_ONE:
ret = Const.LINE_ONE_TIME / distance;
break;
case TrainsLine.LINE_TWO:
ret = Const.LINE_TWO_TIME / distance;
break;
case TrainsLine.LINE_THREE:
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calcDelay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left distance AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , AST#,#Rig... | calcDelay(distance: number, line: number): number {
let ret: number = 0;
switch (line) {
case TrainsLine.LINE_ONE:
ret = Const.LINE_ONE_TIME / distance;
break;
case TrainsLine.LINE_TWO:
ret = Const.LINE_TWO_TIME / distance;
break;
case TrainsLine.LINE_THREE:
... | https://gitee.com/harmonyos/codelabs.git | 1926b9fbefd49888053dfafe1a9e627f55226485 | gitee |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/utils/KeyboardMapper.ets | arkts | sendCtrlAltDelete | Send Ctrl+Alt+Delete sequence | sendCtrlAltDelete(): void {
if (this.listener) {
// Press Ctrl
this.listener.onKeyEvent(VK_CONTROL, true);
// Press Alt
this.listener.onKeyEvent(VK_MENU, true);
// Press Delete
this.listener.onKeyEvent(VK_DELETE, true);
this.listener.onKeyEvent(VK_DELETE, false);
//... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left sendCtrlAltDelete 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_expressi... | sendCtrlAltDelete(): void {
if (this.listener) {
// Press Ctrl
this.listener.onKeyEvent(VK_CONTROL, true);
// Press Alt
this.listener.onKeyEvent(VK_MENU, true);
// Press Delete
this.listener.onKeyEvent(VK_DELETE, true);
this.listener.onKeyEvent(VK_DELETE, false);
//... | https://github.com/tangwengang-del/freerdp-harmonyos | 378fb2465f03dc1cb4dce3a045261ee5dca96552 | github |
Countly/countly-sdk-hos | library/src/main/ets/internal/modules/ModuleHealthCheck.ets | arkts | logFailedNetworkRequest | -- Counter mutators (called from Logger + RequestQueue listeners) -- | public logFailedNetworkRequest(statusCode: number, errorResponse: string): void {
if (statusCode > 0 && statusCode < 1000) this.statusCode = statusCode;
if (errorResponse) {
this.errorMessage = errorResponse.length > ERROR_MESSAGE_MAX
? errorResponse.substring(0, ERROR_MESSAGE_MAX)
: err... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left logFailedNetworkRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left statusCode AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number... | public logFailedNetworkRequest(statusCode: number, errorResponse: string): void {
if (statusCode > 0 && statusCode < 1000) this.statusCode = statusCode;
if (errorResponse) {
this.errorMessage = errorResponse.length > ERROR_MESSAGE_MAX
? errorResponse.substring(0, ERROR_MESSAGE_MAX)
: err... | https://github.com/Countly/countly-sdk-hos | ce4590a187b81bd323d582e33064508d22213955 | github |
OHPG/FinSdk | emby/src/main/ets/api/UserApi.ets | arkts | forgotPassword | forgotPassword
@summary Initiates the forgot password process for a local user.
@param forgotPasswordDto requestParameters Request parameters.
@throws {RequiredError}
@memberof UserApi | public async forgotPassword(forgotPasswordDto: ForgotPasswordDto): Promise<ForgotPasswordResult> {
return this.apiClient.post({ path: "/Users/ForgotPassword", data: forgotPasswordDto })
} | 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 forgotPassword AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left forgotPasswordDto AST#identifier#Right AS... | public async forgotPassword(forgotPasswordDto: ForgotPasswordDto): Promise<ForgotPasswordResult> {
return this.apiClient.post({ path: "/Users/ForgotPassword", data: forgotPasswordDto })
} | https://github.com/OHPG/FinSdk | 35f333a96146a6f1108004c9afa9cee78ddfa4dc | github |
Joker-x-dev/CoolMallArkTS | core/designsystem/src/main/ets/component/Row.ets | arkts | build | 渲染布局
@returns {void} 无返回值
@example
RowStartBottom() { Text("Hi"); } | build(): void {
RowBase({
options: this.options,
justifyContent: FlexAlign.Start,
alignItems: VerticalAlign.Bottom,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.marginValue,... | 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 {
RowBase({
options: this.options,
justifyContent: FlexAlign.Start,
alignItems: VerticalAlign.Bottom,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.marginValue,... | https://github.com/Joker-x-dev/CoolMallArkTS | a56337b14784a883ec6ff556613effea5feb4fed | github |
harmonyos/codelabs | HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/common/database/tables/GlobalInfoApi.ets | arkts | insertData | Insert globalInfo.
@param globalInfo
@param callback | insertData(globalInfo: GlobalInfo, callback: Function): void {
const valueBucket = generateBucket(globalInfo);
RdbUtils.insert('GlobalInfo', valueBucket).then(result => {
callback(result);
});
Logger.info('GlobalInfoTable', 'Insert globalInfo finished.');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left insertData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left globalInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left GlobalInfo AST#identifier#Right AST#,#L... | insertData(globalInfo: GlobalInfo, callback: Function): void {
const valueBucket = generateBucket(globalInfo);
RdbUtils.insert('GlobalInfo', valueBucket).then(result => {
callback(result);
});
Logger.info('GlobalInfoTable', 'Insert globalInfo finished.');
} | https://gitee.com/harmonyos/codelabs.git | f4ea5ef282dc738501271ae4d61dd76d0b722309 | gitee |
Delsin-Yu/JustPDF | entry/src/main/ets/continuation/PdfContinuationDistributed.ets | arkts | startRestore | 对端:在 onCreate/onNewWant(CONTINUATION) 尽早调用;在 setSessionId 之前注册 on('status')。 | startRestore(context: common.UIAbilityContext, want: Want): void {
this.resetRestoreState();
const emptySource = new PdfContinuationMigrateSource(undefined, undefined, undefined);
this.dataObject = distributedDataObject.create(context, emptySource);
this.dataObject.on(
'status',
(sessionI... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left startRestore AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#identifier#Left common AST#id... | startRestore(context: common.UIAbilityContext, want: Want): void {
this.resetRestoreState();
const emptySource = new PdfContinuationMigrateSource(undefined, undefined, undefined);
this.dataObject = distributedDataObject.create(context, emptySource);
this.dataObject.on(
'status',
(sessionI... | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/continuation/PdfContinuationDistributed.ets#L131-L165 | 39d121939923a34c2b168c44da0ff13924268f5f | github |
FinalScave/SweetEditor | platform/OHOS/sweeteditor/src/main/ets/core/EditorCore.ets | arkts | setLineLinks | ==================== Links ==================== | setLineLinks(lineOrData: number | ArrayBuffer, linksOrSize?: LinkSpan[] | number): EditorActionResult | null {
if (lineOrData instanceof ArrayBuffer) {
return CoreProtocol.decodeEditorActionResult(
native.editorSetLineLinks(this.handle, lineOrData, lineOrData.byteLength));
}
if (!Array.isArr... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left setLineLinks AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left lineOrData AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#... | setLineLinks(lineOrData: number | ArrayBuffer, linksOrSize?: LinkSpan[] | number): EditorActionResult | null {
if (lineOrData instanceof ArrayBuffer) {
return CoreProtocol.decodeEditorActionResult(
native.editorSetLineLinks(this.handle, lineOrData, lineOrData.byteLength));
}
if (!Array.isArr... | https://github.com/FinalScave/SweetEditor | 9d9a0a58909aa21123445c23e4f0cc7f3188c9b2 | github |
xiaofenger_705/protobuf-arkts-generator | runtime/arkpb/JsonEncodingVisitor.ets | arkts | visitMapStringBytes | 访问 map<string, bytes> 字段
JSON: object with base64 string values | visitMapStringBytes(value: Map<string, Uint8Array>, fieldNumber: number): void {
const fieldName = this.getFieldName(fieldNumber)
const obj: Record<string, Object> = {}
value.forEach((v, k) => {
obj[k] = this.bytesToBase64(v) as Object
})
this.json[fieldName] = obj as Object
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left visitMapStringBytes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Map AST#identifie... | visitMapStringBytes(value: Map<string, Uint8Array>, fieldNumber: number): void {
const fieldName = this.getFieldName(fieldNumber)
const obj: Record<string, Object> = {}
value.forEach((v, k) => {
obj[k] = this.bytesToBase64(v) as Object
})
this.json[fieldName] = obj as Object
} | https://gitcode.com/xiaofenger_705/protobuf-arkts-generator | d78459907df918f66403502c2033b5941561d354 | gitcode |
midori52000/ArkPilot | Agent/entry/src/main/ets/backend/ProviderConfigStore.ets | arkts | getCodexHome | ── helpers ── | function getCodexHome(): string {
return (AppStorage.get('codexHome') as string) ?? '';
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getCodexHome 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_typ... | function getCodexHome(): string {
return (AppStorage.get('codexHome') as string) ?? '';
} | https://github.com/midori52000/ArkPilot | 54d76d00bfef8adb34e331eda1db62b7ef99f018 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/Legend.ets | arkts | getFormToTextSpace | returns the space between the form and the actual label/text
@return | public getFormToTextSpace(): number {
return this.mFormToTextSpace;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getFormToTextSpace AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number ... | public getFormToTextSpace(): number {
return this.mFormToTextSpace;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 23086cc9169797486b5f2ed4aa4590a53bfa99d6 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/InteractionManager.ets | arkts | setVibrationEnabled | 设置全局震动开关 | public async setVibrationEnabled(enabled: boolean): Promise<void> {
this.settings.vibrationEnabled = enabled;
await this.saveSettings();
} | 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 setVibrationEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#L... | public async setVibrationEnabled(enabled: boolean): Promise<void> {
this.settings.vibrationEnabled = enabled;
await this.saveSettings();
} | https://github.com/DaLongZhuaZi/manxia | 7dd98a92386cce9b78065df6dfafe9127a531cc9 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Services/DataService.ets | arkts | updateRecord | 更新测试记录 | public async updateRecord(record: Record<string, string | number | boolean | string[] | number[]>): Promise<void> {
try {
if (!this.testRecords) {
throw new Error('测试记录存储未初始化');
}
const id = record.id as string;
if (!this.testRecords.has(id)) {
throw new Error(`记录不存在: ${id}... | 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 updateRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left record AST#identifier#Right AST#:#Left : AS... | public async updateRecord(record: Record<string, string | number | boolean | string[] | number[]>): Promise<void> {
try {
if (!this.testRecords) {
throw new Error('测试记录存储未初始化');
}
const id = record.id as string;
if (!this.testRecords.has(id)) {
throw new Error(`记录不存在: ${id}... | https://github.com/DaLongZhuaZi/manxia | 36e345b4b087144f9c41f6966d0d3b714f79fb0b | github |
David8Idira/AI-OA | packages/harmonyos/commons/src/main/ets/service/AiService.ets | arkts | sendMessage | 发送消息给AI(真实API调用) | async sendMessage(content: string, sessionId?: string, modelId: string = 'gpt-4o'): Promise<ApiResponse<{ reply: string; sessionId: string; messageId: string }>> {
return this.client.post<{ reply: string; sessionId: string; messageId: string }>(
API_ENDPOINTS.AI_CHAT,
{ content, sessionId, modelId }
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left sendMessage AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left content AST#identifier#Right AST#type_annotation#Left AST#:#Left : ... | async sendMessage(content: string, sessionId?: string, modelId: string = 'gpt-4o'): Promise<ApiResponse<{ reply: string; sessionId: string; messageId: string }>> {
return this.client.post<{ reply: string; sessionId: string; messageId: string }>(
API_ENDPOINTS.AI_CHAT,
{ content, sessionId, modelId }
... | https://github.com/David8Idira/AI-OA | 4942e5a2a49e8089f1c9510a7aeae6ae8801e59a | github |
openharmony/applications_app_samples | code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/VideoTrimmerView.ets | arkts | aboutToAppear | 界面初始化函数 | aboutToAppear() {
this.configUIInfo();
this.isPausePreview = true;
this.waitLoadedInitAVPlayer();
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
this.configUIInfo();
this.isPausePreview = true;
this.waitLoadedInitAVPlayer();
} | https://github.com/openharmony/applications_app_samples | daa281b64fa14c79e87d06e6a092ff1a3e06ff17 | github |
Dabing-0x19d/berverage_HarmonyOS6.0 | entry/src/main/ets/model/LoginStateManager.ets | arkts | removeListener | 移除状态变化监听 | removeListener(listener: (state: LoginState) => void): void {
this.listeners.delete(listener);
} | AST#program#Left AST#ERROR#Left AST#identifier#Left removeListener AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left listener AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Le... | removeListener(listener: (state: LoginState) => void): void {
this.listeners.delete(listener);
} | https://github.com/Dabing-0x19d/berverage_HarmonyOS6.0 | f992cbfcb3b1ebde7c95d1864368facb3eb9bee0 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/HorizontalBarChartModel.ets | arkts | getPosition | Returns a recyclable MPPointF instance.
@param e
@param axis
@return | getPosition(e: EntryOhos, axis: AxisDependency): MPPointF {
let vals: number[] = this.mGetPositionBuffer;
vals[0] = e.getY();
vals[1] = e.getX();
this.getTransformer(axis)?.pointValuesToPixel(vals);
return MPPointF.getInstance(vals[0], vals[1]);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPosition 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 EntryOhos AST#identifier#Right AST#,#Left , AST... | getPosition(e: EntryOhos, axis: AxisDependency): MPPointF {
let vals: number[] = this.mGetPositionBuffer;
vals[0] = e.getY();
vals[1] = e.getX();
this.getTransformer(axis)?.pointValuesToPixel(vals);
return MPPointF.getInstance(vals[0], vals[1]);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | ce6773ca6685bce181c7236e8ec80860844d1483 | gitee |
honjow/Next2V | shared/src/main/ets/parser/V2exTabParser.ets | arkts | extractTopicIds | 从 HTML 中提取主题 ID 列表
优先匹配主列表里的 topic-link,避免右栏热门主题污染不同 tab 的结果。 | static extractTopicIds(html: string): number[] {
// Strip non-content so the `/t/NNN` fallback never matches tracking-JS / comment links.
const clean = V2exTabParser.stripNonContent(html)
const ids: Set<number> = new Set()
const topicLinkRegex = /id=["']topic-link-(\d+)["']/g
let match: RegExpExec... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left extractTopicIds AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left html AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | static extractTopicIds(html: string): number[] {
// Strip non-content so the `/t/NNN` fallback never matches tracking-JS / comment links.
const clean = V2exTabParser.stripNonContent(html)
const ids: Set<number> = new Set()
const topicLinkRegex = /id=["']topic-link-(\d+)["']/g
let match: RegExpExec... | https://github.com/honjow/Next2V | f6d2262dc4848ee7cd10ba579deddd5066fbb44c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets | arkts | exportMangaSources | 导出漫画书源(完整字段) | private async exportMangaSources(): Promise<MangaSourceBackup[]> {
try {
const sql = 'SELECT * FROM comic_source';
const results = await this.dbManager.querySql(sql);
const backupItems: MangaSourceBackup[] = [];
for (const record of results) {
const source = record as Record... | 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 exportMangaSources AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | private async exportMangaSources(): Promise<MangaSourceBackup[]> {
try {
const sql = 'SELECT * FROM comic_source';
const results = await this.dbManager.querySql(sql);
const backupItems: MangaSourceBackup[] = [];
for (const record of results) {
const source = record as Record... | https://github.com/DaLongZhuaZi/manxia | d42c5ce53483af844f8be7236af07b0d8f0113e3 | github |
HarmonyOS_Samples/MultiPictureBeautification | multipicturecommon/src/main/ets/utils/WindowUtil.ets | arkts | updateWindowInfo | Initialize all window info and register all change listeners | updateWindowInfo(): void {
if (!this.mainWindow || !this.uiContext) {
Logger.error(LogConstants.LOG_TAG_WINDOW_UTIL, 'mainWindow or uiContext is not initialized.');
return;
}
try {
// Window status: fullscreen, split-screen, floating, etc.
this.mainWindowInfo.windowStatusType = thi... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateWindowInfo 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#{#Left { AST#{#Right AST#me... | updateWindowInfo(): void {
if (!this.mainWindow || !this.uiContext) {
Logger.error(LogConstants.LOG_TAG_WINDOW_UTIL, 'mainWindow or uiContext is not initialized.');
return;
}
try {
// Window status: fullscreen, split-screen, floating, etc.
this.mainWindowInfo.windowStatusType = thi... | https://gitcode.com/HarmonyOS_Samples/MultiPictureBeautification | d79bd4dbd9002c533c043482ae02810b5ef6eed4 | gitcode |
apap6628114/nga_oh | entry/src/main/ets/parser/bbcode/lexer.ets | arkts | createBBNode | 创建一个新的 BBNode 并分配全局自增 id。 | function createBBNode(): BBNode {
const n = new BBNode()
n.id = ++bbNodeIdCounter
return n
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left createBBNode 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#type_identifie... | function createBBNode(): BBNode {
const n = new BBNode()
n.id = ++bbNodeIdCounter
return n
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/parser/bbcode/lexer.ets#L13-L17 | c6aa92f78d4c61ceb5ca5b6cf6f6846fa5f2838a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Distributed/DistributedDataSyncManager.ets | arkts | joinSession | 启动同步会话
源端生成 sessionId,目标端加入同一 sessionId | public joinSession(sessionId: string): void {
if (!this.context) {
logger.error(TAG, 'Manager not initialized with context');
this.notifyStatusChange('error', 'Manager not initialized with context');
return;
}
this.sessionId = sessionId;
const defaultState: SyncReadingState = {
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left joinSession AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sessionId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#R... | public joinSession(sessionId: string): void {
if (!this.context) {
logger.error(TAG, 'Manager not initialized with context');
this.notifyStatusChange('error', 'Manager not initialized with context');
return;
}
this.sessionId = sessionId;
const defaultState: SyncReadingState = {
... | https://github.com/DaLongZhuaZi/manxia | 238a5c3722880559048dafa818f6ee240f36cdc1 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/libs/htmlparser/HTMLElement.ets | arkts | matchNextInChain | 匹配链中的下一个节点 | private matchNextInChain(
currentElem: HTMLElement,
chain: SelectorNode[],
nextIndex: number,
combinator: Combinator | null
): HTMLElement[] {
if (nextIndex >= chain.length) return [];
const nextNode = chain[nextIndex];
const isLast = nextIndex === chain.length - 1;
const resu... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left matchNextInChain AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left currentElem AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident... | private matchNextInChain(
currentElem: HTMLElement,
chain: SelectorNode[],
nextIndex: number,
combinator: Combinator | null
): HTMLElement[] {
if (nextIndex >= chain.length) return [];
const nextNode = chain[nextIndex];
const isLast = nextIndex === chain.length - 1;
const resu... | https://github.com/DaLongZhuaZi/manxia | ce7e258ca3b9f6fbc50e03427db24c085ec54391 | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/app/tabs/classes/meowTabsBunch.ets | arkts | refreshStopCurrent | Refresh or stop the current tab. | refreshStopCurrent() {
if (!this.currentTab) {
return;
}
if (this.currentTab.isLoading) {
this.currentTab.stop();
} else {
this.currentTab.refresh();
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left refreshStopCurrent 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... | refreshStopCurrent() {
if (!this.currentTab) {
return;
}
if (this.currentTab.isLoading) {
this.currentTab.stop();
} else {
this.currentTab.refresh();
}
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | 83a5671ed53d281f9b9163ef69f541ae73f390b4 | github |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/pages/ContactManager.ets | arkts | getAllContacts | 获取所有联系人(已按首字母排序) | public async getAllContacts(): Promise<ContactsItem[]> {
try {
return await this.contactDao.getAllContacts();
} catch (error) {
console.error('[ContactManager] 获取所有联系人失败:', error);
return [];
}
} | 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 getAllContacts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:... | public async getAllContacts(): Promise<ContactsItem[]> {
try {
return await this.contactDao.getAllContacts();
} catch (error) {
console.error('[ContactManager] 获取所有联系人失败:', error);
return [];
}
} | https://gitcode.com/openharmony/codelabs | 7ba049f4b8a26efb24173d1482de9862657952ae | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryCache.ets | arkts | set | 设置缓存数据
@param entityName 实体名称
@param id 实体主键值
@param data 实体数据 | set(entityName: string, id: ValueType, data: EntityData): void {
if (!this.enabled) {
return
}
// 检查是否需要驱逐旧数据
if (this.cache.size >= this.maxSize) {
this.evictOldest()
}
const key = this.generateKey(entityName, id)
// 存储深拷贝,避免原数据被外部修改影响缓存
this.cache.set(key, new CacheEntr... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left set AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left entityName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AST#,#Right A... | set(entityName: string, id: ValueType, data: EntityData): void {
if (!this.enabled) {
return
}
// 检查是否需要驱逐旧数据
if (this.cache.size >= this.maxSize) {
this.evictOldest()
}
const key = this.generateKey(entityName, id)
// 存储深拷贝,避免原数据被外部修改影响缓存
this.cache.set(key, new CacheEntr... | https://github.com/offlinecat-dev/OCNetORM | a3be8ddc44375bfc45dd8bde6a083f6b43734fd7 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Download/UnifiedDownloadManager.ets | arkts | savePartialDownload | ==================== 部分保存 ====================
手动保存部分下载为归档
@param contentId 漫画ID
@param chapterId 章节ID
@returns 是否保存成功 | public async savePartialDownload(contentId: string, chapterId: string): Promise<boolean> {
try {
const tasks = this.getTasksByContent(contentId);
const task = tasks.find(t => t.chapterId === chapterId);
if (!task) {
logger.warn(TAG, `未找到章节对应的下载任务: contentId=${contentId}, chapterId=${chap... | 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 savePartialDownload AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left contentId AST#identifier#Right AST#ERROR#Left AST#:... | public async savePartialDownload(contentId: string, chapterId: string): Promise<boolean> {
try {
const tasks = this.getTasksByContent(contentId);
const task = tasks.find(t => t.chapterId === chapterId);
if (!task) {
logger.warn(TAG, `未找到章节对应的下载任务: contentId=${contentId}, chapterId=${chap... | https://github.com/DaLongZhuaZi/manxia | 9e54ee323cd96bdf091fcbdc564a775f4cf61aa8 | github |
Cool_foolisher1/ArkTSRepository | MultiCalculator/features/calculator/src/main/ets/utils/CalculateUtil.ets | arkts | parseExpression | 表达式处理(解析表达式) | parseExpression(expressions: Array<string>): string {
if (checkEmptyUtil.isEmpty(expressions)) {
return 'NaN'
}
let len = expressions.length
let outputStack: string[] = []
let outputQueue: string[] = []
expressions.forEach((item: string, index: number) => {
// 处理表达式中的%
if (it... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left parseExpression AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left expressions AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Array AST#ident... | parseExpression(expressions: Array<string>): string {
if (checkEmptyUtil.isEmpty(expressions)) {
return 'NaN'
}
let len = expressions.length
let outputStack: string[] = []
let outputQueue: string[] = []
expressions.forEach((item: string, index: number) => {
// 处理表达式中的%
if (it... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 0a5e1f420281aecd8be05eb6418d1b914bbad3b3 | gitcode |
CLMC2025/Vignette | entry/src/main/ets/algorithm/Algorithm.ets | arkts | getInstance | Singleton accessor | static getInstance(): FSRSAlgorithm {
if (FSRSAlgorithm.instance === null) {
FSRSAlgorithm.instance = new FSRSAlgorithm();
}
return FSRSAlgorithm.instance;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left FSRSAlgori... | static getInstance(): FSRSAlgorithm {
if (FSRSAlgorithm.instance === null) {
FSRSAlgorithm.instance = new FSRSAlgorithm();
}
return FSRSAlgorithm.instance;
} | https://github.com/CLMC2025/Vignette | 348e3d4a6a00533803b2330f7508e3754f44d75a | github |
openharmony/vendor_unionman | unionpi_tiger/sample_hzu/DistributedControlTerminal/entry/src/main/ets/pages/camera.ets | arkts | angleChange | 使用 @State 来跟踪角度状态 | angleChange() {
console.log(TAG,'anglechange:'+this.angle);
pwmtest.setPwmStatus(2, this.angle);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left angleChange 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... | angleChange() {
console.log(TAG,'anglechange:'+this.angle);
pwmtest.setPwmStatus(2, this.angle);
} | https://gitee.com/openharmony/vendor_unionman.git | 37706a84359cac9ba6f9d120cd627b50c7b3e4af | gitee |
erosTeam/NextE | shared/src/main/ets/constants/EhConstants.ets | arkts | tagNamespaceLabel | Tag namespace → localized display label (eros_fe EHConst.translateTagType): the type header on the
detail page reads '作者/女性/男性…' for zh, capitalized English for en, Japanese for ja, instead of
the raw 'artist/female/male'. Driven by app i18n resources so it follows the system locale. An
unmapped namespace passes throug... | static tagNamespaceLabel(ns: string): ResourceStr {
if (EhConstants.tagNsLabelMap === null) {
const m: Map<string, Resource> = new Map<string, Resource>()
m.set('artist', $r('app.string.tag_ns_artist'))
m.set('female', $r('app.string.tag_ns_female'))
m.set('male', $r('app.string.tag_ns_mal... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left tagNamespaceLabel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ns AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | static tagNamespaceLabel(ns: string): ResourceStr {
if (EhConstants.tagNsLabelMap === null) {
const m: Map<string, Resource> = new Map<string, Resource>()
m.set('artist', $r('app.string.tag_ns_artist'))
m.set('female', $r('app.string.tag_ns_female'))
m.set('male', $r('app.string.tag_ns_mal... | https://github.com/erosTeam/NextE | 40858a7ab36bee45158bd22ffd61f85c936ee715 | github |
Nekofox-POT/LinMusic | entry/src/main/ets/package/audio_player/class_audio_player.ets | arkts | set_start_audio | 喜欢列表(路径备份)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
内部函数 //
//////////
歌曲初始化装载 // | private async set_start_audio(list: string[], index: number, auto_start: boolean, time: number): Promise<boolean> {
// 载入播放列表 //
this.play_list = []
for (const i of list) {
// 有效性检查 //
let tmp_ino: string = ''
try {tmp_ino = `${fs.statSync(i).ino}`} catch {continue}
// 官方播放器dsd检... | 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 set_start_audio AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left list AST#identifier#Right AST#:#Left ... | private async set_start_audio(list: string[], index: number, auto_start: boolean, time: number): Promise<boolean> {
// 载入播放列表 //
this.play_list = []
for (const i of list) {
// 有效性检查 //
let tmp_ino: string = ''
try {tmp_ino = `${fs.statSync(i).ino}`} catch {continue}
// 官方播放器dsd检... | https://github.com/Nekofox-POT/LinMusic | 63b53a61cad0138c6ea679f4589c37400311c256 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Workflow/WorkflowCapabilities.ets | arkts | getCapabilityStats | 获取能力统计 | getCapabilityStats(context: WorkflowContext): string {
const stats: string[] = [];
context.capabilities.forEach((config, type) => {
stats.push(type);
});
return `启用的能力 (${stats.length}): ${stats.join(', ')}`;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCapabilityStats 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#Left WorkflowContext AST#identifier#Rig... | getCapabilityStats(context: WorkflowContext): string {
const stats: string[] = [];
context.capabilities.forEach((config, type) => {
stats.push(type);
});
return `启用的能力 (${stats.length}): ${stats.join(', ')}`;
} | https://github.com/DaLongZhuaZi/manxia | d32068120a343e2f8fa003064e372be26679a444 | github |
NissonCX/CQU-HarmonyOS-AppDev-Course-Exp | entry/src/main/ets/pages/24Points.ets | arkts | aboutToAppear | 页面加载时初始化游戏 | aboutToAppear(): void {
this.startNewGame();
// 添加主题监听器
ThemeManager.getInstance().addThemeChangeListener((theme: ThemeType, colors: ThemeColors) => {
this.currentTheme = theme;
this.themeColors = colors;
});
} | 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.startNewGame();
// 添加主题监听器
ThemeManager.getInstance().addThemeChangeListener((theme: ThemeType, colors: ThemeColors) => {
this.currentTheme = theme;
this.themeColors = colors;
});
} | https://github.com/NissonCX/CQU-HarmonyOS-AppDev-Course-Exp | ad3017bad951814e7d4e4e3bd70704d00765f7e8 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/service/EventSourcingService.ets | arkts | processCommand | 处理命令(将命令转换为事件) | private static async processCommand(command: Command): Promise<ProcessedEvent[]> {
const events: ProcessedEvent[] = [];
const payload: Record<string, Object> = JSON.parse(command.payloadJson) as Record<string, Object>;
// 根据命令类型生成对应事件
switch (command.commandType) {
case 'CreateBill':
ev... | 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 processCommand AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ... | private static async processCommand(command: Command): Promise<ProcessedEvent[]> {
const events: ProcessedEvent[] = [];
const payload: Record<string, Object> = JSON.parse(command.payloadJson) as Record<string, Object>;
// 根据命令类型生成对应事件
switch (command.commandType) {
case 'CreateBill':
ev... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 5cbb36985fe7595c9399f2c522d2a0de7d0a1dc2 | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/component/GoodsInfoCard.ets | arkts | build | 构建商品信息卡片视图
@returns {void} 无返回值 | build(): void {
ColumnStart({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_medium"),
right: $r("app.float.space_horizontal_medium"),
}
}) {
Card({
widthValue: P100,
paddingValue: $r("app.float.space_padding_medium")
}) {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#... | build(): void {
ColumnStart({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_medium"),
right: $r("app.float.space_horizontal_medium"),
}
}) {
Card({
widthValue: P100,
paddingValue: $r("app.float.space_padding_medium")
}) {
... | https://github.com/Joker-x-dev/CoolMallArkTS | e1d2830461c2ee77e72bade781d1885072a91dce | github |
openharmony-sig/ohos_highlightguide | library/src/main/ets/highlightguide/core/Controller.ets | arkts | show | 开始显示引导页 | public show(): void {
// 组件名称必须设置,如果没有设置,则不显示组件引导页
if (!this.builder || !this.builder.label) {
hilog.info(0x0000, GlobalContext.HILOG_TAG, '%{public}s', 'label is empty, please set the label for guide');
return;
}
// 获取组件已经显示过的次数
let showedCount = 0;
if (this.preferences) {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left show AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Righ... | public show(): void {
// 组件名称必须设置,如果没有设置,则不显示组件引导页
if (!this.builder || !this.builder.label) {
hilog.info(0x0000, GlobalContext.HILOG_TAG, '%{public}s', 'label is empty, please set the label for guide');
return;
}
// 获取组件已经显示过的次数
let showedCount = 0;
if (this.preferences) {
... | https://gitee.com/openharmony-sig/ohos_highlightguide.git | 50bb12bb835e52e276de048e376bdb83b19e370f | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Components/ContentPanel.ets | arkts | showHelp | ==================== 快捷方法 ====================
显示帮助文档 | showHelp(title: string, content: string, source: ContentSource = ContentSource.INLINE): string {
return this.addTab({
title,
type: ContentPanelType.HELP,
source,
content
});
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showHelp 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 , AST#,... | showHelp(title: string, content: string, source: ContentSource = ContentSource.INLINE): string {
return this.addTab({
title,
type: ContentPanelType.HELP,
source,
content
});
} | https://github.com/DaLongZhuaZi/manxia | bb12855a4b095c6c936fecc5c4bff43b142ea812 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Loaders/MangaDetailLoader.ets | arkts | buildMangaFromMangaInfo | 从MangaInfo构建Manga对象 | private buildMangaFromMangaInfo(mangaInfo: MangaInfo, chapters: MangaChapter[], externalId: string): Manga {
const internalId = `id_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
return {
id: internalId,
title: mangaInfo.title || '未知标题',
alternativeTitles: [],
descr... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left buildMangaFromMangaInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mangaInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#... | private buildMangaFromMangaInfo(mangaInfo: MangaInfo, chapters: MangaChapter[], externalId: string): Manga {
const internalId = `id_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
return {
id: internalId,
title: mangaInfo.title || '未知标题',
alternativeTitles: [],
descr... | https://github.com/DaLongZhuaZi/manxia | 91c87b518f36ae10cc275263d364e2fbdf333596 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/utils/NavigationManager.ets | arkts | replaceWithParams | 替换当前页面(带参数)
@param url 目标页面路径
@param params 导航参数
@returns Promise<void> | public async replaceWithParams<T extends NavigationParams>(url: string, params: T): Promise<void> {
const startTime = Date.now();
try {
// 验证路由路径
if (!this.validateRoute(url)) {
throw NavigationErrorHandler.createRouteNotFoundError(url);
}
// 验证参数
if (!params || typeof ... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#identifier#Left replaceWithParams AST#identifier#Right AST#<#Left < AST#<#Right AST#type_identifier#Left T AST#type_identifier#Right AST#extends#Left extends AST#extends#Right AST#ERROR#Left AST#ty... | public async replaceWithParams<T extends NavigationParams>(url: string, params: T): Promise<void> {
const startTime = Date.now();
try {
// 验证路由路径
if (!this.validateRoute(url)) {
throw NavigationErrorHandler.createRouteNotFoundError(url);
}
// 验证参数
if (!params || typeof ... | https://github.com/LJ666-ui/harmony-health-care | d1b120467000331f3406cdeea3ca6a8176add8d0 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | matchXPathStep | 匹配XPath步骤 | private matchXPathStep(html: string, step: XPathStep): string[] {
const results: string[] = [];
// 查找所有匹配标签的元素
let elements: string[];
if (step.tag === '*') {
elements = this.findAllElements(html);
} else {
elements = this.findElementsByTag(html, step.tag);
}
// 应用谓词过... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left matchXPathStep AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left html AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | private matchXPathStep(html: string, step: XPathStep): string[] {
const results: string[] = [];
// 查找所有匹配标签的元素
let elements: string[];
if (step.tag === '*') {
elements = this.findAllElements(html);
} else {
elements = this.findElementsByTag(html, step.tag);
}
// 应用谓词过... | https://github.com/DaLongZhuaZi/manxia | 2c127afad8f7fb980e3f7415fb9be98b04f31ac5 | github |
openharmony/security_privacy_center | entry/src/main/ets/main/auto_menu/AutoMenuModel.ets | arkts | _getConfigResString | Get the configured title string resource | private async _getConfigResString(context: Context, bundleName: string, res: string): Promise<string> {
if (res === null || res === undefined) {
return '';
}
let resourceManager = resourceUtil.getBundleResourceManager(bundleName, context);
if (resourceManager === null) {
return '';
}
... | 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 _getConfigResString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#... | private async _getConfigResString(context: Context, bundleName: string, res: string): Promise<string> {
if (res === null || res === undefined) {
return '';
}
let resourceManager = resourceUtil.getBundleResourceManager(bundleName, context);
if (resourceManager === null) {
return '';
}
... | https://gitee.com/openharmony/security_privacy_center.git | c4cf2bee49d86ff4ff39165232bb9ac10b94dabc | gitee |
751496032/ZRouter | RouterApi/src/main/ets/api/RouterMgr.ets | arkts | addGlobalInterceptor | @deprecated
@see {setInterceptor}
@param callback | public addGlobalInterceptor(callback: (info: InterceptorInfo) => void) {
this.setGlobalInterceptor({
onNavigate: (context) => {
callback(context)
}
} as IGlobalNavigateInterceptor)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left addGlobalInterceptor AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#... | public addGlobalInterceptor(callback: (info: InterceptorInfo) => void) {
this.setGlobalInterceptor({
onNavigate: (context) => {
callback(context)
}
} as IGlobalNavigateInterceptor)
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/RouterMgr.ets#L816-L822 | 02a964b0e223c1e62c2a9379283ebd55ee6f1ae1 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/viewmodel/AppViewModel.ets | arkts | setLocalIconPath | 设置本地图标路径 | setLocalIconPath(path: string): void {
this.localIconPath = path;
this.iconLoaded = true;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setLocalIconPath 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 AST#identifier#Right AST#)#Left ... | setLocalIconPath(path: string): void {
this.localIconPath = path;
this.iconLoaded = true;
} | https://github.com/AlkaidLab/moonlight-harmony | 8431e39bde785a732191507cb3d6d320dfc95dc2 | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/SettingsService.ets | arkts | getThemeMode | 获取主题模式 | public async getThemeMode(): Promise<ThemeMode> {
if (!this.preferences) {
return ThemeMode.SYSTEM;
}
try {
// 尝试获取新的主题模式设置
const mode = await this.preferences.get(SettingsService.KEY_THEME_MODE, ThemeMode.SYSTEM) as ThemeMode;
if (mode) {
return mode;
}
// 向后兼... | 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 getThemeMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L... | public async getThemeMode(): Promise<ThemeMode> {
if (!this.preferences) {
return ThemeMode.SYSTEM;
}
try {
// 尝试获取新的主题模式设置
const mode = await this.preferences.get(SettingsService.KEY_THEME_MODE, ThemeMode.SYSTEM) as ThemeMode;
if (mode) {
return mode;
}
// 向后兼... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/SettingsService.ets#L126-L144 | e2c34a0ecd33163631a0296e08463c34b5097392 | github |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/services/network/HttpClient.ets | arkts | get | GET 请求 | async get(
path: string,
params: Record<string, Object> | null = null,
connectTimeoutMs: number | null = null,
readTimeoutMs: number | null = null,
guardOptions: CfGuardOptions | null = null,
extraHeaders: Record<string, string> | null = null
): Promise<string> {
await this.cookieStore.i... | 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 path AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefine... | async get(
path: string,
params: Record<string, Object> | null = null,
connectTimeoutMs: number | null = null,
readTimeoutMs: number | null = null,
guardOptions: CfGuardOptions | null = null,
extraHeaders: Record<string, string> | null = null
): Promise<string> {
await this.cookieStore.i... | https://github.com/Amaz1ny/HarmonyDO-public | cc21fcb5a565966dea6b7bb745ca7858ac1a9d83 | github |
OHPG/FinMusic | entry/src/main/ets/data/Repository.ets | arkts | getArtistAlbums | 查询艺术家专辑
@param id
@returns | public async getArtistAlbums(id: string): Promise<Array<BaseItemDto>> {
return this.requireApi().getArtistAlbums(id)
} | 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 getArtistAlbums AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST... | public async getArtistAlbums(id: string): Promise<Array<BaseItemDto>> {
return this.requireApi().getArtistAlbums(id)
} | https://github.com/OHPG/FinMusic | 6fd3e757d384176fc6838389d03e43c545810d9c | github |
openharmony/arkui_ace_engine | advanced_ui_component/treeviewv2/source/treeviewv2.ets | arkts | onNodeClick | Node click event registration and processing.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 26 | public onNodeClick(callback: OnChangedCallback): void {
this.nodeClickEvents.push(callback);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onNodeClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | public onNodeClick(callback: OnChangedCallback): void {
this.nodeClickEvents.push(callback);
} | https://gitcode.com/openharmony/arkui_ace_engine | b2dfc1140675dd1a88c80b06f3fb51252f4e8503 | gitcode |
Lycorius03/studyos | apps/harmonyos/entry/src/main/ets/bridge/StudyOsBridge.ets | arkts | close | Closes the database and releases native resources. | close(): void {
if (this.handle !== null) {
nativeModule.studyosCloseDb(this.handle);
this.handle = null;
this.initialized = false;
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left close AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left A... | close(): void {
if (this.handle !== null) {
nativeModule.studyosCloseDb(this.handle);
this.handle = null;
this.initialized = false;
}
} | https://github.com/Lycorius03/studyos | 577e404ec18b85e2e3f87e2707c9b38b8bfe5401 | github |
openharmony-tpc/XmlGraphicsBatik | library/src/main/ets/batik/svggen/SVGLine.ets | arkts | getY1 | 获取起始点Y坐标 | public getY1(): number{
return this._y1;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left getY1 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 getY1(): number{
return this._y1;
} | https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git | ce4198e7d1043765edc65a3ba236741729ef4089 | gitee |
the-wwyang/kids-learning-app | src/main/ets/utils/AudioManager.ets | arkts | playMainBGM | 开始播放背景音乐 | static playMainBGM(): void {
AudioManager.getInstance().playSound(SoundType.BGM_MAIN);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left playMainBGM 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... | static playMainBGM(): void {
AudioManager.getInstance().playSound(SoundType.BGM_MAIN);
} | https://github.com/the-wwyang/kids-learning-app | 5e6bbd31cd12bab1152dbd5a642a6c8d7230825e | github |
Tlntin/home-cloud-shield | entry/src/main/ets/data/DnsLogDb.ets | arkts | allFiltered | All matching rows (capped) for export. | async allFiltered(action: string, search: string, cap: number): Promise<DnsLogRow[]> {
return this.queryRows(action, search, cap, 0);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left allFiltered AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left action AST#identifier#Right AST#type_annotation#Left AST#:#Left : A... | async allFiltered(action: string, search: string, cap: number): Promise<DnsLogRow[]> {
return this.queryRows(action, search, cap, 0);
} | https://github.com/Tlntin/home-cloud-shield/blob/bfd8d549ccb3e55bdfc30fa7687b31d52e4c1cc0/entry/src/main/ets/data/DnsLogDb.ets#L262-L264 | 820b4d85037ddea26a08c107ff9e55e488246268 | github |
richshaw2015/nds | ohos/entry/src/test/DependencyRelations.test.ets | arkts | getDefaultValue | 获取设置项的默认值
@param key 设置键名
@returns 默认值 | private getDefaultValue(key: string): boolean | string | number {
// 根据设置键名返回默认值
const defaults: Record<string, boolean | string | number> = {
'audio_interpolation': 'none',
'audio_bitrate': 'auto',
'volume': 256,
'audio_latency': 'medium',
'rewind_period': 10,
'rewind_wind... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getDefaultValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | private getDefaultValue(key: string): boolean | string | number {
// 根据设置键名返回默认值
const defaults: Record<string, boolean | string | number> = {
'audio_interpolation': 'none',
'audio_bitrate': 'auto',
'volume': 256,
'audio_latency': 'medium',
'rewind_period': 10,
'rewind_wind... | https://github.com/richshaw2015/nds | 0080b6b076cf8e189eb6b21a38bdc87af40d60ca | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Map.ets | arkts | constructor | Constructs a Map from another Map
@param map another map | constructor(map: Map<K, V>) {
const capacity = Map.computeCapacity(map.sizeVal)
const alloc = this.allocDataAndBuckets(capacity)
this.data = alloc[0]
this.buckets = alloc[1]
this.cap = capacity
this.initialCapacity = capacity
map.forEach((v: V, k: K) => {
... | 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 map AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#L... | constructor(map: Map<K, V>) {
const capacity = Map.computeCapacity(map.sizeVal)
const alloc = this.allocDataAndBuckets(capacity)
this.data = alloc[0]
this.buckets = alloc[1]
this.cap = capacity
this.initialCapacity = capacity
map.forEach((v: V, k: K) => {
... | https://gitcode.com/iop123123/arkts-static-skills | ac20f6348af983cf6a9649d31ac57ae25e8354b8 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/UIContextManager.ets | arkts | showConfirmDialog | 显示确认对话框 | public showConfirmDialog(config: DialogConfig): Promise<boolean> {
return new Promise((resolve) => {
if (!this.uiContext) {
logger.warn(TAG, 'UI上下文未设置,无法显示对话框');
resolve(false);
return;
}
try {
// 注意:实际的Dialog实现可能需要根据HarmonyOS的具体API调整
logger.info(TAG, `显示... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left showConfirmDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | public showConfirmDialog(config: DialogConfig): Promise<boolean> {
return new Promise((resolve) => {
if (!this.uiContext) {
logger.warn(TAG, 'UI上下文未设置,无法显示对话框');
resolve(false);
return;
}
try {
// 注意:实际的Dialog实现可能需要根据HarmonyOS的具体API调整
logger.info(TAG, `显示... | https://github.com/DaLongZhuaZi/manxia | 68aeacca2f42d3eff860ff94a4c5b80685db49c4 | github |
qiuhaotc/Sunshine_HarmonyOS | entry/src/main/ets/utils/SunAngleHelper.ets | arkts | equationOfTime | 简化的时间方程计算(分钟) | static equationOfTime(dayOfYear: number): number {
const B = (360 / 365) * (dayOfYear - 81) * SunAngleHelper.DEGREE_TO_RADIAN;
return 9.87 * Math.sin(2 * B) - 7.53 * Math.cos(B) - 1.5 * Math.sin(B);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left equationOfTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left dayOfYear AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#numbe... | static equationOfTime(dayOfYear: number): number {
const B = (360 / 365) * (dayOfYear - 81) * SunAngleHelper.DEGREE_TO_RADIAN;
return 9.87 * Math.sin(2 * B) - 7.53 * Math.cos(B) - 1.5 * Math.sin(B);
} | https://github.com/qiuhaotc/Sunshine_HarmonyOS | bc7c0083c08836f373c88bedc41682840754cc9f | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/String.ets | arkts | trimRight | Trims all whitespaces from the end of this String.
@returns new right trimmed string | public trimRight(): String {
let lastNotWhiteSpaceIdx: int = -1;
for (let i: int = this.length() - 1; i >= 0; i--) {
if (!Char.isWhiteSpace(this.charAt(i))) {
lastNotWhiteSpaceIdx = i;
break;
}
}
return this.substring(0, lastNot... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left trimRight 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 String AST#i... | public trimRight(): String {
let lastNotWhiteSpaceIdx: int = -1;
for (let i: int = this.length() - 1; i >= 0; i--) {
if (!Char.isWhiteSpace(this.charAt(i))) {
lastNotWhiteSpaceIdx = i;
break;
}
}
return this.substring(0, lastNot... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 3d656ffbe1e9823bbc29a73a9dca8675fb7281fb | gitee |
openharmony/codelabs | ETSUI/ChatAppDemo/entry/src/main/ets/utils/FriendHandler.ets | arkts | sendRequest | 发送好友申请 | async sendRequest(request: FriendRequestModel) {
const valueBucket: relationalStore.ValuesBucket = {
fromPhone: request.fromPhone,
toPhone: request.toPhone,
fromName: request.fromName,
message: request.message,
status: 0
};
try {
return await this.store.insert('FriendRe... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left sendRequest AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left request AST#identifier#Right AST#type_annotation#Left AST#:#Left : ... | async sendRequest(request: FriendRequestModel) {
const valueBucket: relationalStore.ValuesBucket = {
fromPhone: request.fromPhone,
toPhone: request.toPhone,
fromName: request.fromName,
message: request.message,
status: 0
};
try {
return await this.store.insert('FriendRe... | https://gitcode.com/openharmony/codelabs | eaf417b4b9921fbf2436785b410b93153e712191 | gitcode |
751496032/ZRouter | RouterApi/src/main/ets/api/Router.ets | arkts | addLifecycleObserver | `
添加单个NavDestination页面的生命周期观察者,在NavDestination页面模版模式下才会生效
@param observer | public static addLifecycleObserver(observer: LifecycleObserver): TemplateMgr {
return TemplateMgr.getInstance().addObserver(observer)
} | 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 addLifecycleObserver AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left observer AST#identifier#Right AST#... | public static addLifecycleObserver(observer: LifecycleObserver): TemplateMgr {
return TemplateMgr.getInstance().addObserver(observer)
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/Router.ets#L330-L332 | ad6850257ffbfddb8d96959bc6e3e71202ca731d | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets | arkts | codePointAt | Gets the codepoint at the specified index in this string.
Is similar to charAt(index), but if the character at the
index is the beginning of a surrogate pair, the int
representation for this codepoint is returned. Otherwise,
the character at the index is returned.
@param { int } index index of the potential surrogate p... | public codePointAt(index: int): int | undefined {
if (index < 0 || index >= this.getLength() || this.getLength() == 0) {
return undefined
}
let highValue: char = this.charAt(index);
if (!Char.isHighSurrogate(highValue) || ++index == this.getLength()) {
return ... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left codePointAt AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#... | public codePointAt(index: int): int | undefined {
if (index < 0 || index >= this.getLength() || this.getLength() == 0) {
return undefined
}
let highValue: char = this.charAt(index);
if (!Char.isHighSurrogate(highValue) || ++index == this.getLength()) {
return ... | https://gitcode.com/iop123123/arkts-static-skills | 1ff7878bfde29dae15a39c1dc3754c33f457c983 | gitcode |
jiahaozheng406/huawei-travel-app-HarmonyOS | entry/src/main/ets/view/Home.ets | arkts | getItemSizeArray | 保存flow item宽/高 | getItemSizeArray() {
for (let i = 0; i < 100; i++) {
this.itemWidthArray.push(this.getSize())
this.itemHeightArray.push(this.getSize())
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getItemSizeArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#L... | getItemSizeArray() {
for (let i = 0; i < 100; i++) {
this.itemWidthArray.push(this.getSize())
this.itemHeightArray.push(this.getSize())
}
} | https://github.com/jiahaozheng406/huawei-travel-app-HarmonyOS | e7d7ee684cabe5c5effd3769c0bbc9745e46a09c | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/BarData.ets | arkts | setTopRadius | 设置顶部圆角半径
@param radius 顶部圆角半径 | public setTopRadius(radius: number): void{
if(radius < 0){
radius = 0;
}
this.topRadius = radius;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setTopRadius AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left radius AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left n... | public setTopRadius(radius: number): void{
if(radius < 0){
radius = 0;
}
this.topRadius = radius;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 297fd649b0e25862916ac62a9da3a3639ee0a64e | gitee |
UnbalancedCat/ohos-ssh-core | ssh_lib/src/main/ets/core/SshClient.ets | arkts | sftpWriteFile | Write text data to a remote file (creates or overwrites). | async sftpWriteFile(remotePath: string, data: string): Promise<void> {
if (!this.handle) throw new SshError('Client is disposed', SshErrorCode.DISPOSED);
try {
await ssh.sftpWriteFile(this.handle, remotePath, data);
} catch (err) {
const msg = (err as Error).message ?? 'SFTP writeFile failed';... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left sftpWriteFile AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left remotePath AST#identifier#Right AST#type_annot... | async sftpWriteFile(remotePath: string, data: string): Promise<void> {
if (!this.handle) throw new SshError('Client is disposed', SshErrorCode.DISPOSED);
try {
await ssh.sftpWriteFile(this.handle, remotePath, data);
} catch (err) {
const msg = (err as Error).message ?? 'SFTP writeFile failed';... | https://github.com/UnbalancedCat/ohos-ssh-core | 8b0baa18dbdbdd7d006ee0c45cc6f373c0fe8cc8 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceManager.ets | arkts | addSourcesToGroup | 批量添加书源到分组 | async addSourcesToGroup(sourceIds: string[], groupName: string): Promise<number> {
let successCount = 0;
for (const sourceId of sourceIds) {
const source = this.sources.get(sourceId);
if (!source) continue;
// 获取当前分组
const currentGroups = source.bookSourceGroup
? s... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left addSourcesToGroup AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceIds AST#identifier#Right AST#type_annotation#L... | async addSourcesToGroup(sourceIds: string[], groupName: string): Promise<number> {
let successCount = 0;
for (const sourceId of sourceIds) {
const source = this.sources.get(sourceId);
if (!source) continue;
// 获取当前分组
const currentGroups = source.bookSourceGroup
? s... | https://github.com/DaLongZhuaZi/manxia | bdf4cfb0edec47eafda0b851ffe685a1ccee1f80 | github |
cpdd5201314/harmonyOS-music-app | products/phone/src/main/ets/pages/ForumPage.ets | arkts | onPageShow | 页面显示时检查登录状态并重新加载帖子 | onPageShow() {
console.log('ForumPage onPageShow - 开始刷新帖子');
this.checkLoginStatus().then(() => {
// 每次显示都重新加载帖子,确保数据最新
// 这包括从CreatePostPage返回后的被动刷新
this.loadPosts();
});
} | 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.log('ForumPage onPageShow - 开始刷新帖子');
this.checkLoginStatus().then(() => {
// 每次显示都重新加载帖子,确保数据最新
// 这包括从CreatePostPage返回后的被动刷新
this.loadPosts();
});
} | https://github.com/cpdd5201314/harmonyOS-music-app | 8c177a82ca098f4df8f8e71c655b3cb2f6c1cdf8 | github |
openharmony-sig/fluttertpc_flutter_qr_reader | ohos/src/main/ets/me/hetian/flutter_qr_reader/components/viewmodel/CustomScanViewModel.ets | arkts | releaseCustomScan | 释放自定义扫码资源
@returns {void} | async releaseCustomScan(): Promise<void> {
try {
await customScan.release()
} catch (error) {
Log.e(TAG, 'Catch: release error: ' + JSON.stringify(error));
}
this.scanInitialized = false;
this.scanIsStart = false;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left releaseCustomScan AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#ge... | async releaseCustomScan(): Promise<void> {
try {
await customScan.release()
} catch (error) {
Log.e(TAG, 'Catch: release error: ' + JSON.stringify(error));
}
this.scanInitialized = false;
this.scanIsStart = false;
} | https://gitee.com/openharmony-sig/fluttertpc_flutter_qr_reader.git | 0f4b654ffb67acf33c5ec3deb80187aabdfb33d8 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/ImageProcessing/ImageInterceptor.ets | arkts | registerSource | 注册图源配置 | registerSource(sourceId: number, config: AlgorithmConfig): void {
this.sourceConfigs.set(sourceId, config);
logger.info(TAG, `注册图源配置: sourceId=${sourceId}, algorithm=${config.algorithm}`);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left registerSource AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sourceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , AST#... | registerSource(sourceId: number, config: AlgorithmConfig): void {
this.sourceConfigs.set(sourceId, config);
logger.info(TAG, `注册图源配置: sourceId=${sourceId}, algorithm=${config.algorithm}`);
} | https://github.com/DaLongZhuaZi/manxia | 41d47835135c4a4106b224dc5035d82434bb4b9c | github |
Countly/countly-sdk-hos | library/src/main/ets/internal/modules/ModuleRemoteConfig.ets | arkts | exitABTestsForKeys | Exit the user from A/B experiments. `null`/empty means "exit from all".
Sends `/o/sdk?method=ab_exit[&keys=[...]]`. No-op in temporary-id mode or
under revoked RC consent. | public async exitABTestsForKeys(keys: string[] | null): Promise<void> {
if (this.rejectIfHalted('ModuleRemoteConfig', 'exitABTestsForKeys')) return;
if (!this.canSendAB('exitABTestsForKeys')) return;
const params: Record<string, string> = this.core.requestBuilder.baseParams();
params['method'] = 'ab_e... | 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 exitABTestsForKeys AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left keys AST#identifier#Right AST#:#Left ... | public async exitABTestsForKeys(keys: string[] | null): Promise<void> {
if (this.rejectIfHalted('ModuleRemoteConfig', 'exitABTestsForKeys')) return;
if (!this.canSendAB('exitABTestsForKeys')) return;
const params: Record<string, string> = this.core.requestBuilder.baseParams();
params['method'] = 'ab_e... | https://github.com/Countly/countly-sdk-hos | 090813560f48d6b80b516cdeb18d9d7083f83a65 | github |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/services/RepeatService.ets | arkts | getRepeatOptions | 获取重复选项 | getRepeatOptions(): RepeatOption[] {
return this.repeatOptions;
} | AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getRepeatOptions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#iden... | getRepeatOptions(): RepeatOption[] {
return this.repeatOptions;
} | https://gitcode.com/openharmony/codelabs | 6ee7bd5dc01c67e67df141361226affd75975784 | gitcode |
PollenWang6/HiXD | entry/src/main/ets/services/SchoolnetService.ets | arkts | getCurrentOnlineInfo | ===== 在线状态查询(w.xidian.edu.cn,无需登录) ===== | async getCurrentOnlineInfo(): Promise<Record<string, string | number>> {
const resp: HttpResponse = await this.http.getWithQuery(
'https://w.xidian.edu.cn/cgi-bin/rad_user_info',
{ 'callback': 'jsonp', '_': Date.now().toString() }
);
let raw: string = resp.body;
let info: Record<string, st... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getCurrentOnlineInfo AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST... | async getCurrentOnlineInfo(): Promise<Record<string, string | number>> {
const resp: HttpResponse = await this.http.getWithQuery(
'https://w.xidian.edu.cn/cgi-bin/rad_user_info',
{ 'callback': 'jsonp', '_': Date.now().toString() }
);
let raw: string = resp.body;
let info: Record<string, st... | https://github.com/PollenWang6/HiXD | 3eaaf48994e231ca4e9f27bf239adac8607e5bd0 | github |
erosTeam/NextE | shared/src/main/ets/settings/ViewedHistorySettings.ets | arkts | parse | Defensive parse: bad JSON / shape → []; drop records without a gid; keep newest-first order. | private static parse(raw: string): ViewedGallery[] {
const out: ViewedGallery[] = []
try {
const arr: Object = JSON.parse(raw) as Object
if (Array.isArray(arr)) {
;(arr as Object[]).forEach((v: Object) => {
const rec = v as ViewedGallery
if (rec !== null && typeof rec.g... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left parse AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left raw AST#i... | private static parse(raw: string): ViewedGallery[] {
const out: ViewedGallery[] = []
try {
const arr: Object = JSON.parse(raw) as Object
if (Array.isArray(arr)) {
;(arr as Object[]).forEach((v: Object) => {
const rec = v as ViewedGallery
if (rec !== null && typeof rec.g... | https://github.com/erosTeam/NextE | ee69ea81363a76fd7af41616c879f70afd8aabd8 | github |
codelably/HCompass | core/spatialization/oh_modules/@core/util/src/main/ets/logger/LoggerUtil.ets | arkts | objToJson | 对象转格式化的JSON字符串
@param data 目标对象
@returns 带图标缩进的JSON字符串 | private static objToJson(data: object): string {
const icon = Logger.option.icon || '|';
return `${icon} ${JSON.stringify(data, null, 2).replace(/\n/g, `\n${icon} `)}`;
} | 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 objToJson AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST... | private static objToJson(data: object): string {
const icon = Logger.option.icon || '|';
return `${icon} ${JSON.stringify(data, null, 2).replace(/\n/g, `\n${icon} `)}`;
} | https://github.com/codelably/HCompass | 9b96f0b5eae0f8f72bba8f9c3cdd341f461bec68 | github |
arkui-x/samples | CodeLab/Cases/feature/encapsulationdialog/src/main/ets/dialog/util/AnimationUtil.ets | arkts | transitionFromCenter | 中间弹出动画
@param duration 动画时间
@returns | static transitionFromCenter(duration: number = 200): TransitionEffect {
return TransitionEffect.OPACITY.animation({ duration: duration });
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left transitionFromCenter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left duration AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignm... | static transitionFromCenter(duration: number = 200): TransitionEffect {
return TransitionEffect.OPACITY.animation({ duration: duration });
} | https://gitcode.com/arkui-x/samples | 178d74e4c760c7554b9b35392cdbec8d37993367 | gitcode |
aimilin6688/KeePassHO | entry/src/main/ets/services/kdbx/KdbxImportService.ets | arkts | isSupportType | 导入文件的后缀格式
@param locationInfo 文件位置信息 | private static isSupportType(filenameExt: string): boolean {
if (!filenameExt) {
return false;
}
filenameExt = filenameExt.startsWith(".") ? filenameExt : "." + filenameExt;
return KdbxImportService.EXPORT_TYPES.indexOf(filenameExt) !== -1;
} | 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 isSupportType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filenameExt AST#identifier#Right AST#ERROR#Left AST#:... | private static isSupportType(filenameExt: string): boolean {
if (!filenameExt) {
return false;
}
filenameExt = filenameExt.startsWith(".") ? filenameExt : "." + filenameExt;
return KdbxImportService.EXPORT_TYPES.indexOf(filenameExt) !== -1;
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxImportService.ets#L124-L130 | 0c87b2221740307f44a162c9397d9614dc4d4006 | github |
bluedeer000/HarmonyCalendar | entry/src/main/ets/pages/Index.ets | arkts | withViewConfig | ---- ViewConfig helper: create copy with single field override ---- | function withViewConfig(source: CalendarViewConfig, field: string, value: Object): CalendarViewConfig {
return {
id: field === "id" ? (value as string) : source.id,
defaultView: field === "defaultView" ? (value as string) : source.defaultView,
weekStartsOn: field === "weekStartsOn" ? (value as number) : s... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left withViewConfig AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left source AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | function withViewConfig(source: CalendarViewConfig, field: string, value: Object): CalendarViewConfig {
return {
id: field === "id" ? (value as string) : source.id,
defaultView: field === "defaultView" ? (value as string) : source.defaultView,
weekStartsOn: field === "weekStartsOn" ? (value as number) : s... | https://github.com/bluedeer000/HarmonyCalendar | 3806e81d862480cc9def1dfea70edc3b500d5189 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/PreferencesService.ets | arkts | getMaterialLevel | 获取材质级别 | async getMaterialLevel(): Promise<number> {
return await this.getNumber(PreferenceKeys.MATERIAL_LEVEL, 10) // ADAPTIVE
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getMaterialLevel AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#gen... | async getMaterialLevel(): Promise<number> {
return await this.getNumber(PreferenceKeys.MATERIAL_LEVEL, 10) // ADAPTIVE
} | https://github.com/LongLiveY96/chatcube | 3d3f221825638035bce5d84d9c2876279f6daeb6 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/OCRRecognition.ets | arkts | parseDateFromPosition | 从指定位置解析日期 | private static parseDateFromPosition(text: string, yearStart: number, separator: string): DateField | null {
const yearStr = text.substring(yearStart, yearStart + 4);
const year = parseInt(yearStr);
let monthStart = yearStart + 5; // 跳过年份和分隔符
if (separator === '年') {
monthStart = yearStart + 5;... | 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 parseDateFromPosition AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#... | private static parseDateFromPosition(text: string, yearStart: number, separator: string): DateField | null {
const yearStr = text.substring(yearStart, yearStart + 4);
const year = parseInt(yearStr);
let monthStart = yearStart + 5; // 跳过年份和分隔符
if (separator === '年') {
monthStart = yearStart + 5;... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 2810c3cdf917c2f54516b5bb71a98d58f8b9cdaa | github |
openharmony/applications_contacts | entry/src/main/ets/presenter/contact/detail/DetailPresenter.ets | arkts | doDeleteContact | Delete a contact | doDeleteContact() {
globalThis.DataWorker.sendRequest('deleteContactById', {
context: globalThis.context,
contactId: this.contactId
}, (result: number | undefined) => {
if (result == 0 || result == undefined) {
HiLog.i(TAG, 'doDeleteContact succ');
} else {
HiLog.i(TAG, `doDeleteContact ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left doDeleteContact AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Le... | doDeleteContact() {
globalThis.DataWorker.sendRequest('deleteContactById', {
context: globalThis.context,
contactId: this.contactId
}, (result: number | undefined) => {
if (result == 0 || result == undefined) {
HiLog.i(TAG, 'doDeleteContact succ');
} else {
HiLog.i(TAG, `doDeleteContact ... | https://gitee.com/openharmony/applications_contacts.git | 7ca1c5ed58cd36db28b775f1bd1e55f6f720a6c3 | gitee |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnSwitchViewModel.ets | arkts | toggleCustomValue | 切换自定义值开关
@param value 新的字符串状态值 | toggleCustomValue(value: string): void {
this.switchCustomValue = value;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toggleCustomValue 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#)#Lef... | toggleCustomValue(value: string): void {
this.switchCustomValue = value;
} | https://github.com/codelably/tuniao-ui | 6a8ddcec1ee035f75b4759bc27bd7c10b1b40855 | github |
tdcare/tdwebrtc | src/main/ets/MediaStream.ets | arkts | generateAndEncodePlaceholder | 生成占位画面 NV12 帧并通过 Rust 层编码发送 | private generateAndEncodePlaceholder(): void {
if (!this.videoEncoderCreated || this.cameraCapture === null) return;
const w: number = this.cameraCapture.getActualWidth();
const h: number = this.cameraCapture.getActualHeight();
if (w === 0 || h === 0) return;
// 生成 NV12 帧
const nv12: ArrayBu... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateAndEncodePlaceholder 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#L... | private generateAndEncodePlaceholder(): void {
if (!this.videoEncoderCreated || this.cameraCapture === null) return;
const w: number = this.cameraCapture.getActualWidth();
const h: number = this.cameraCapture.getActualHeight();
if (w === 0 || h === 0) return;
// 生成 NV12 帧
const nv12: ArrayBu... | https://github.com/tdcare/tdwebrtc | d21928ed6982b4fd79c99073d25cb10c5b2a8438 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/ItemTransitionAnimator.ets | arkts | prepareMoveAnimation | 准备移动动画 | private prepareMoveAnimation(
oldPosMap: Map<string, ItemPosition>,
newPosMap: Map<string, ItemPosition>,
pixelMaps: Map<string, PixelMap>
): void {
// 所有条目都移动到新位置
newPosMap.forEach((newPos, id) => {
const oldPos = oldPosMap.get(id);
const pixelMap = pixelMaps.get(id) || null;
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left prepareMoveAnimation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left oldPosMap AST#identifier#Right AST#ERROR#Left AST#:#Left : A... | private prepareMoveAnimation(
oldPosMap: Map<string, ItemPosition>,
newPosMap: Map<string, ItemPosition>,
pixelMaps: Map<string, PixelMap>
): void {
// 所有条目都移动到新位置
newPosMap.forEach((newPos, id) => {
const oldPos = oldPosMap.get(id);
const pixelMap = pixelMaps.get(id) || null;
... | https://github.com/DaLongZhuaZi/manxia | 47db84a1f1677202acd59816c7dfc7a968d8d8fa | github |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/BillManager.ets | arkts | insertSampleData | 插入示例数据 | static async insertSampleData(): Promise<void> {
const now = new Date();
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
// 创建示例账单
const bill1 = new BillBean();
bill1.type = BillTypeEnum.EXPENSE;
bill1.category = '餐饮';
bill1.amount = 35.00;
bill1.account = '微... | 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 insertSampleData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST... | static async insertSampleData(): Promise<void> {
const now = new Date();
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
// 创建示例账单
const bill1 = new BillBean();
bill1.type = BillTypeEnum.EXPENSE;
bill1.category = '餐饮';
bill1.amount = 35.00;
bill1.account = '微... | https://github.com/ZestBox-18/kitebook-frontend | 49040af299cd045e01aeba4a4c4d4b1d64e17e81 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/managers/QemuVMManager.ets | arkts | resumeVM | 恢复虚拟机 | async resumeVM(vmId: string): Promise<ResumeVMResult> {
try {
const response = await this.sendCommand({
command: 'resume_vm',
vmId: vmId
})
const result: ResumeVMResult = { success: response.success, message: response.message }
return result
} catch (error) {
cons... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left resumeVM AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left vmId AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#... | async resumeVM(vmId: string): Promise<ResumeVMResult> {
try {
const response = await this.sendCommand({
command: 'resume_vm',
vmId: vmId
})
const result: ResumeVMResult = { success: response.success, message: response.message }
return result
} catch (error) {
cons... | https://github.com/AetheriumSimulator/qemu-hmos | 9142757a28775a9e4d13373a53d96d7d2af31208 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/02.lexical_elements/09.literals/07.null_literal/null_literal.ets | arkts | main | x type is expected to be inferred to Object|null type | function main() {
assert x === null
} | 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#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#L... | function main() {
assert x === null
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | f69dc2b77fa738c8f266fece2da14847b3da6df4 | gitee |
XJTUWYD/ArkDiff | entry/src/main/ets/viewmodel/DiffSessionViewModel.ets | arkts | showSearch | ==================== 搜索 ==================== | showSearch(): void {
this.searchVisible = true;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showSearch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#L... | showSearch(): void {
this.searchVisible = true;
} | https://github.com/XJTUWYD/ArkDiff | 78f5bfe9973bc2e4b3f5f21c1aa07e0dd4d552bc | github |
LJ666-ui/harmony-health-care | 5-skill离线包/星云智联–分布式AI全周期智慧健康管理平台_skills/skills/XiaoyiSkillManager.ets | arkts | registerSkills | 注册所有技能 | private registerSkills(): void {
// S1 - 健康数据查询
this.skills.set('医疗.query.health', {
id: '医疗.query.health',
name: '健康数据查询',
skillClass: HealthQuerySkill,
priority: 1,
estimatedTime: '~500ms'
});
// S2 - AI智能问诊
this.skills.set('医疗.ai.consultation', {
id: '医疗... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left registerSkills AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expr... | private registerSkills(): void {
// S1 - 健康数据查询
this.skills.set('医疗.query.health', {
id: '医疗.query.health',
name: '健康数据查询',
skillClass: HealthQuerySkill,
priority: 1,
estimatedTime: '~500ms'
});
// S2 - AI智能问诊
this.skills.set('医疗.ai.consultation', {
id: '医疗... | https://github.com/LJ666-ui/harmony-health-care | 9e6d38f27ff1e72b4275635515649dbb390a1118 | github |
LongLiveY96/chatcube | entry/src/main/ets/state/AppSettingsStore.ets | arkts | configToProvider | ============================================================================
ProviderConfig ↔ ModelProvider 转换
============================================================================
从 DB 行(ProviderConfig)反序列化回运行时 ModelProvider。
原先在 ProviderViewModel.configToProvider 里,搬到这里让 Store 自洽 | configToProvider(config: ProviderConfig): ModelProvider {
const providerType = this.stringToProviderType(config.type)
const apiStyle = this.stringToApiStyle(config.apiStyle)
const provider = new ModelProvider(
config.id,
config.name,
providerType,
config.iconSymbol,
this.bran... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left configToProvider AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ProviderConfig AST#identifier#Right A... | configToProvider(config: ProviderConfig): ModelProvider {
const providerType = this.stringToProviderType(config.type)
const apiStyle = this.stringToApiStyle(config.apiStyle)
const provider = new ModelProvider(
config.id,
config.name,
providerType,
config.iconSymbol,
this.bran... | https://github.com/LongLiveY96/chatcube | 6373c137d369ad1c1b2fab1707d0c92c30df9556 | github |
fbinba3955/Flymby | main/src/main/ets/pages/player/EmbyPlayer.ets | arkts | doReportPlay | 上报播放开始 | doReportPlay(time: number) {
this.mPlaybackInfo && this.currentVideoParam.itemId &&
doReportPlay(this.mPlaybackInfo, this.currentVideoParam.itemId, time)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left doReportPlay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left time AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right ... | doReportPlay(time: number) {
this.mPlaybackInfo && this.currentVideoParam.itemId &&
doReportPlay(this.mPlaybackInfo, this.currentVideoParam.itemId, time)
} | https://github.com/fbinba3955/Flymby | 7d1f4cd76b555349e9119f0cb85016718714a04d | github |
HarmonyOS_Samples/MusicHome | features/recommendation/src/main/ets/util/RecommendDataUtil.ets | arkts | mapSongDtoToPrivateUi | Maps a song API DTO to {@link RecommendPrivateSongUi} for the private-songs strip.
@param dto - Source song DTO.
@returns Populated private-song row model. | private static mapSongDtoToPrivateUi(dto: SongApiDto): RecommendPrivateSongUi {
const ui = new RecommendPrivateSongUi();
ui.id = dto.id;
ui.title = dto.title;
ui.singer = dto.singer;
ui.cover = dto.label;
return ui;
} | 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 mapSongDtoToPrivateUi AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dto AST#identifier#Right AST#:... | private static mapSongDtoToPrivateUi(dto: SongApiDto): RecommendPrivateSongUi {
const ui = new RecommendPrivateSongUi();
ui.id = dto.id;
ui.title = dto.title;
ui.singer = dto.singer;
ui.cover = dto.label;
return ui;
} | https://gitcode.com/HarmonyOS_Samples/MusicHome | d0a43ef08a1b7bc9b9b296a7884be0c84caa3354 | gitcode |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/pages/Index.ets | arkts | aboutToAppear | ========== 生命周期 ========== | aboutToAppear(): void {
this.setupImmersive()
// initStore 是异步的:完成后再启动状态轮询,保证“安装模式打开新窗口”时主窗口也能看到状态变化
this.initStore().then(() => {
this.refreshVmStatusesOnce()
this.startStatusTimer()
}).catch((_e: Error) => {
// initStore 内部已有日志
})
this.initVncSettings()
this.loadCapabil... | 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.setupImmersive()
// initStore 是异步的:完成后再启动状态轮询,保证“安装模式打开新窗口”时主窗口也能看到状态变化
this.initStore().then(() => {
this.refreshVmStatusesOnce()
this.startStatusTimer()
}).catch((_e: Error) => {
// initStore 内部已有日志
})
this.initVncSettings()
this.loadCapabil... | https://github.com/AetheriumSimulator/qemu-hmos | fee4465e0210b73879622fbee6c582ba009097b8 | github |
Yebingiscn/SweetVideo | entry/src/main/ets/utils/DebounceUtil.ets | arkts | debounce | 防抖执行函数
@param key 唯一标识键
@param func 要执行的函数
@param delay 延迟时间(毫秒) | static debounce(key: string, func: Function, delay: number = 300): void {
const existingTimer = DebounceUtil.timers.get(key)
if (existingTimer !== undefined) {
clearTimeout(existingTimer)
}
const timer = setTimeout(() => {
func()
DebounceUtil.timers.delete(key)
}, delay)
Debo... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left debounce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string A... | static debounce(key: string, func: Function, delay: number = 300): void {
const existingTimer = DebounceUtil.timers.get(key)
if (existingTimer !== undefined) {
clearTimeout(existingTimer)
}
const timer = setTimeout(() => {
func()
DebounceUtil.timers.delete(key)
}, delay)
Debo... | https://github.com/Yebingiscn/SweetVideo | 7e7bfc55a5e3ad39bdbfd2250a8a00cf09602d7f | github |
Eklps/harmony-mall-perf | entry/src/main/ets/pages/ListIndex.ets | arkts | build | 主界面构建函数,用navigation导航容器包裹TabBar组件,
并设置导航栏的标题、菜单、目标页面 | build() {
Row() {
Navigation(this.pageStack) {
Column() {
TabBar()
}
.width(LAYOUT_WIDTH_OR_HEIGHT)
.justifyContent(FlexAlign.Center)
}
.size({ width: LAYOUT_WIDTH_OR_HEIGHT, height: LAYOUT_WIDTH_OR_HEIGHT })
.title(STORE)
.titleMode(Navigati... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Row() {
Navigation(this.pageStack) {
Column() {
TabBar()
}
.width(LAYOUT_WIDTH_OR_HEIGHT)
.justifyContent(FlexAlign.Center)
}
.size({ width: LAYOUT_WIDTH_OR_HEIGHT, height: LAYOUT_WIDTH_OR_HEIGHT })
.title(STORE)
.titleMode(Navigati... | https://github.com/Eklps/harmony-mall-perf | 14bd3cdd268d9a712ececcc38efced8b198aeb96 | github |
YDYm233/EasyRandom_HarmonyNextApp | common/SystemUtils/src/main/ets/utils/ApiVersionUtil.ets | arkts | filterSupportedTools | 过滤出当前设备支持的工具列表
@param tools 工具列表
@returns 过滤后的工具列表 | static filterSupportedTools<T extends ToolWithApiVersion>(tools: T[]): T[] {
return tools.filter(tool => ApiVersionUtil.isApiSupported(tool.minApiVersion));
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left filterSupportedTools AST#identifier#Right AST#<#Left < AST#<#Right AST#type_identifier#Left T AST#type_identifier#Right AST#extends#Left extends AST#extends#Right AST#ERROR#Left AST#type_identifier#Left ToolWithApiVersion AST#ty... | static filterSupportedTools<T extends ToolWithApiVersion>(tools: T[]): T[] {
return tools.filter(tool => ApiVersionUtil.isApiSupported(tool.minApiVersion));
} | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | 2f6589b2dc62068e6990bbafd8122e59f3451fc6 | github |
ZestBox-18/kitebook-frontend | commons/kite_utils/src/main/ets/utils/clog/Clog.ets | arkts | setLogDomain | 设置日志域
@param domain 日志域值,默认为0x0fff | public static setLogDomain(domain: number): void {
Clog.LOG_DOMAIN = domain;
} | 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 setLogDomain AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left domain AST#identifier#Right AST#:#Left : A... | public static setLogDomain(domain: number): void {
Clog.LOG_DOMAIN = domain;
} | https://github.com/ZestBox-18/kitebook-frontend | 2378de4d3f90fdfa1945de42c4fae667094fc6f8 | github |
CLMC2025/Vignette | entry/src/main/ets/sync/VersionControl.ets | arkts | getChangeLog | 获取变更日志 | getChangeLog(): ChangeLogEntry[] {
return [...this.changeLog];
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getChangeLog 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 ChangeLogEntry AST#identifier#Right AST#[#Left [ ... | getChangeLog(): ChangeLogEntry[] {
return [...this.changeLog];
} | https://github.com/CLMC2025/Vignette | 8edab505fcb4873351f4aa4c8a904000ead7a7ef | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceManager.ets | arkts | importFromJSONWithProgress | 批量导入书源(带进度回调)
适用于大量书源导入场景 | async importFromJSONWithProgress(
jsonStr: string,
onProgress?: (current: number, total: number, sourceName: string) => void
): Promise<LegadoSourceImportResult[]> {
const results: LegadoSourceImportResult[] = [];
const parser = new LegadoSourceParser();
const sources = parser.parseMultipleFromJ... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left importFromJSONWithProgress AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left jsonStr AST#identifier#Right AST#type_annotation#Lef... | async importFromJSONWithProgress(
jsonStr: string,
onProgress?: (current: number, total: number, sourceName: string) => void
): Promise<LegadoSourceImportResult[]> {
const results: LegadoSourceImportResult[] = [];
const parser = new LegadoSourceParser();
const sources = parser.parseMultipleFromJ... | https://github.com/DaLongZhuaZi/manxia | 7fe0ea5f6a30cd8ed9243d483e0c1b303ed3e766 | github |
openharmony-tpc/openharmony_tpc_samples | SmartRefreshLayout/library/src/main/ets/components/topRefresh/SmartRefresh.ets | arkts | scrollerIsEnableRollWhenRefreshingFunction | 刷新过程中是否可以滚动列表 | scrollerIsEnableRollWhenRefreshingFunction() {
if (this.model.refreshState == SmartRefresh.REFRESHSTATE.REFRESHING || this.model.refreshState == SmartRefresh.REFRESHSTATE.REFRESHFINISH) {
if (this.model.scrollLocation == SmartRefresh.LOCATION.HEAD) {
if (!this.model.disableContentWhenRefresh) {
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left scrollerIsEnableRollWhenRefreshingFunction 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#R... | scrollerIsEnableRollWhenRefreshingFunction() {
if (this.model.refreshState == SmartRefresh.REFRESHSTATE.REFRESHING || this.model.refreshState == SmartRefresh.REFRESHSTATE.REFRESHFINISH) {
if (this.model.scrollLocation == SmartRefresh.LOCATION.HEAD) {
if (!this.model.disableContentWhenRefresh) {
... | https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git | bef28d6802176d328383ea505da98483ab22f2da | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.