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/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ColorTemplate.ets | arkts | rgb | Converts the given hex-color-string to rgb.
@param hex
@return | public static rgb(hex: string): number {
var color: number = Number(hex.replace('#', ''));
var r: number = (color >> 16) & 0xff;
var g: number = (color >> 8) & 0xff;
var b: number = (color >> 0) & 0xff;
return Color.rgb(r, g, b);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left rgb AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left hex AST#iden... | public static rgb(hex: string): number {
var color: number = Number(hex.replace('#', ''));
var r: number = (color >> 16) & 0xff;
var g: number = (color >> 8) & 0xff;
var b: number = (color >> 0) & 0xff;
return Color.rgb(r, g, b);
} | https://gitee.com/openharmony/developtools_profiler.git | 547a0bd0c124d80cf39dd24636ec37a49d998b9a | gitee |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterEngineCache.ets | arkts | remove | 移除engineId对应的FlutterEngine | remove(engineId: String) : void {
this.put(engineId, null);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left remove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left engineId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left String AST#identifier#Right AST#ERROR#Right AST#)#Left ) AST#... | remove(engineId: String) : void {
this.put(engineId, null);
} | https://gitee.com/openharmony-sig/flutter_engine.git | 579bdf3f249b25bdaf32fbe64d9a53ac70101081 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/NovelDetailPage.ets | arkts | searchAlternativeSources | 换源 - 搜索同名书籍
使用新的换源搜索服务,支持分批并行搜索和进度回调 | searchAlternativeSources(): void {
if (!this.book) return;
// 取消之前的搜索任务
if (this.searchTaskHandle) {
this.searchTaskHandle.cancel();
}
// 重置状态
this.isSearchingSource = true;
this.alternativeSources = [];
this.alternativeSourceResults = [];
this.searchSourceCompleted... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left searchAlternativeSources 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#sta... | searchAlternativeSources(): void {
if (!this.book) return;
// 取消之前的搜索任务
if (this.searchTaskHandle) {
this.searchTaskHandle.cancel();
}
// 重置状态
this.isSearchingSource = true;
this.alternativeSources = [];
this.alternativeSourceResults = [];
this.searchSourceCompleted... | https://github.com/DaLongZhuaZi/manxia | c99df6cc466ed6bb3bc6c87763ac05691394da89 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/multiplication/multiplication_ushort.ets | arkts | main | ---
desc: check multiplication of two unsigned short integers
--- | function main(): void {
const a: ushort = {{v.left}}
const b: ushort = {{v.right}}
assert (a * b) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A... | function main(): void {
const a: ushort = {{v.left}}
const b: ushort = {{v.right}}
assert (a * b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | e6f4f490092b2568bd0f1326daf9dfe264ea3fa9 | gitee |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/CategoryManager.ets | arkts | insertDefaultCategories | 首次建库后写入默认分类,避免把分类定义散落在页面本地状态里。 | static async insertDefaultCategories(): Promise<void> {
const defaults: CategoryBean[] = CategoryManager.buildDefaultCategories();
for (const category of defaults) {
await CategoryManager.addSeedCategory(category);
}
} | 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 insertDefaultCategories AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Ri... | static async insertDefaultCategories(): Promise<void> {
const defaults: CategoryBean[] = CategoryManager.buildDefaultCategories();
for (const category of defaults) {
await CategoryManager.addSeedCategory(category);
}
} | https://github.com/ZestBox-18/kitebook-frontend | e232f6fe8fa33c721e2a9e6b59c88e465f67d2d4 | github |
aimilin6688/KeePassHO | entry/src/main/ets/storage/cache/CacheStorage.ets | arkts | getPageConfig | 获取页面配置
@returns 页面配置 | public getPageConfig() {
return this.decoratedStorage.getPageConfig();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getPageConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left {... | public getPageConfig() {
return this.decoratedStorage.getPageConfig();
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/cache/CacheStorage.ets#L28-L30 | dc6c2892d8c957380b4db7d9aeef864f80fad105 | github |
honjow/Next2V | shared/src/main/ets/settings/AvatarAppearanceSettings.ets | arkts | apply | Single dual-write point: writes the legacy V1 AppStorage key (applyDescriptorValue
-> setAppStorageValue) AND the V2 mirror, so @StorageProp and @ComponentV2 readers
stay in lockstep during the migration. Returns the normalized value. | static apply(appearance: string): string {
const normalized = applyDescriptorValue<string>(AVATAR_APPEARANCE_DESCRIPTOR, appearance)
connectAvatarAppearance().appearance = normalized
return normalized
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left apply AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left appearance AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right A... | static apply(appearance: string): string {
const normalized = applyDescriptorValue<string>(AVATAR_APPEARANCE_DESCRIPTOR, appearance)
connectAvatarAppearance().appearance = normalized
return normalized
} | https://github.com/honjow/Next2V | 38760197a590599173d1eb8daad7061a71ddbead | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/ChartModel.ets | arkts | setExtraTopOffset | Set an extra offset to be appended to the viewport's top | public setExtraTopOffset(offset: number) {
this.mExtraTopOffset = Utils.handleDataValues(offset);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setExtraTopOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left offset AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | public setExtraTopOffset(offset: number) {
this.mExtraTopOffset = Utils.handleDataValues(offset);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | cb0f79e7bb1025781239e2aaf4eda0716cd3e3fc | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/PieEntry.ets | arkts | setX | @Deprecated
@Override | public setX(x: number): void {
super.setX(x);
// Log.i("DEPRECATED", "Pie entries do not have x values");
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left setX AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#R... | public setX(x: number): void {
super.setX(x);
// Log.i("DEPRECATED", "Pie entries do not have x values");
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 5118a7ccbb947236dddbb7a4ebf17fff0ed53343 | gitee |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryExecutor.ets | arkts | applySubQueryFilter | 将子查询结果作为 IN 条件应用到主查询
@param sourceIds 源实体 ID 数组 | private applySubQueryFilter(sourceIds: Array<ValueType>): boolean {
const metadata = this.queryBuilder.getEntityMetadata()
const pkColumn = metadata.getPrimaryKeyColumn()
if (pkColumn === null) {
return false
}
if (sourceIds.length === 0) {
return false
}
// 使用 whereIn 添加 IN 条... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left applySubQueryFilter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left sourceIds AST#identifier#Right AST#ERROR#Left AST#:#Left : AS... | private applySubQueryFilter(sourceIds: Array<ValueType>): boolean {
const metadata = this.queryBuilder.getEntityMetadata()
const pkColumn = metadata.getPrimaryKeyColumn()
if (pkColumn === null) {
return false
}
if (sourceIds.length === 0) {
return false
}
// 使用 whereIn 添加 IN 条... | https://github.com/offlinecat-dev/OCNetORM | deb944b9631c4667fc6fe414ad44cd51f204eb47 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/RdpConnectionManager.ets | arkts | requestCancel | 请求取消连接(温和方式) | requestCancel(): boolean {
try {
if (qemuModule.rdpRequestCancel) {
qemuModule.rdpRequestCancel()
return true
}
} catch (e) {
console.error('[RdpConnectionManager] requestCancel error:', e)
}
return false
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left requestCancel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#state... | requestCancel(): boolean {
try {
if (qemuModule.rdpRequestCancel) {
qemuModule.rdpRequestCancel()
return true
}
} catch (e) {
console.error('[RdpConnectionManager] requestCancel error:', e)
}
return false
} | https://github.com/AetheriumSimulator/qemu-hmos | 2a1ff2bcb87c5e04a681c98e95d728ae743f269d | github |
openharmony/applications_contacts | entry/src/main/ets/model/ContactAbilityModel.ets | arkts | phoneContact | The contact mobile number information is saved to the database.
@param {Object} addParams Contact Information
@param {string} DAHelper Database path
@param {number} result Contact ID
@param {string} uri Database address | phoneContact(addParams: ContactInfo, DAHelper: dataShare.DataShareHelper, result: string, uri: string) {
if (addParams.phones != undefined && addParams.phones.length > 0) {
let index = 1;
addParams.phones.forEach(element => {
if (StringUtil.isEmpty(element.num)) {
return;
}
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left phoneContact AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left addParams AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ContactInfo AST#identif... | phoneContact(addParams: ContactInfo, DAHelper: dataShare.DataShareHelper, result: string, uri: string) {
if (addParams.phones != undefined && addParams.phones.length > 0) {
let index = 1;
addParams.phones.forEach(element => {
if (StringUtil.isEmpty(element.num)) {
return;
}
... | https://gitee.com/openharmony/applications_contacts.git | f71c419acb5bc0022ae1a4afd79c2cdb663c7b27 | gitee |
openharmony/codelabs | Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets | arkts | scale | Set zoom factor.
@param scale | scale(scale: number): void {
this.left *= scale;
this.right *= scale;
this.top *= scale;
this.bottom *= scale;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left scale AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left scale AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#Ri... | scale(scale: number): void {
this.left *= scale;
this.right *= scale;
this.top *= scale;
this.bottom *= scale;
} | https://gitee.com/openharmony/codelabs.git | 5b2086bce0d07d7144fb92be00c5c4400981ef2c | gitee |
openharmony/arkui_ace_engine | examples/Accessibility/AccessibilityCapi/entry/src/main/ets/pages/Index.ets | arkts | navigateToScenario | 导航到场景页面 | navigateToScenario(routeName: string): void {
this.pathStack.pushPath({ name: routeName });
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left navigateToScenario AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left routeName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left )... | navigateToScenario(routeName: string): void {
this.pathStack.pushPath({ name: routeName });
} | https://gitcode.com/openharmony/arkui_ace_engine | e882588b4955c578750fa9ac36500e0544561536 | gitcode |
richshaw2015/nds | ohos/entry/src/main/ets/types/MelonDSNative.ets | arkts | setBackgroundImage | 设置背景图片 (RGBA 像素数据, 对齐 Android DSRenderer.setBackground) | static setBackgroundImage(pixels: ArrayBuffer, width: number, height: number): boolean {
return MelonDSNative.native.setBackgroundImage(pixels, width, height);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setBackgroundImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pixels AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | static setBackgroundImage(pixels: ArrayBuffer, width: number, height: number): boolean {
return MelonDSNative.native.setBackgroundImage(pixels, width, height);
} | https://github.com/richshaw2015/nds | 9810504617d51973b849de9c1ee23afab3f82501 | github |
Harrisonls2004/WaterFlow | entry/src/main/ets/common/network/HttpClient.ets | arkts | buildUrl | 构建完整 URL | private buildUrl(path: string): string {
let fullPath = path;
if (!path.startsWith('/')) {
fullPath = '/' + path;
}
return SERVER_BASE_URL + API_BASE_PATH + fullPath;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left buildUrl 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 stri... | private buildUrl(path: string): string {
let fullPath = path;
if (!path.startsWith('/')) {
fullPath = '/' + path;
}
return SERVER_BASE_URL + API_BASE_PATH + fullPath;
} | https://github.com/Harrisonls2004/WaterFlow | 0c1650a5daf49c9d00ca0b59dc9659cad4b27ca0 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Utils/WidgetDataSync.ets | arkts | refreshAllForms | 刷新所有卡片 | private async refreshAllForms(): Promise<void> {
if (!this.context) return;
try {
const pref = await preferences.getPreferences(this.context, FORM_STORAGE);
const formIdsStr = (await pref.get('formIds', '[]')) as string;
const formIds: string[] = SafeUtils.parseObj(formIdsStr);
... | 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 refreshAllForms AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A... | private async refreshAllForms(): Promise<void> {
if (!this.context) return;
try {
const pref = await preferences.getPreferences(this.context, FORM_STORAGE);
const formIdsStr = (await pref.get('formIds', '[]')) as string;
const formIds: string[] = SafeUtils.parseObj(formIdsStr);
... | https://github.com/DaLongZhuaZi/manxia | 60c9d581b7a2555ba4b737d13d1ece010c3a6153 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets | arkts | constructor | Constructs a new CoroutinesLimitExceedError instance with provided message and error specific information
@param { String | undefined } message - Error text
@param { ErrorOptions | undefined } options - Error options
@syscap SystemCapability.Utils.Lang | constructor(message?: String, options?: ErrorOptions) {
super("CoroutinesLimitExceedError", message, options)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#Left String AST#identi... | constructor(message?: String, options?: ErrorOptions) {
super("CoroutinesLimitExceedError", message, options)
} | https://gitcode.com/iop123123/arkts-static-skills | 43f4b28ea05d5fbcc13c2efb10589a85ad589e0d | gitcode |
openharmony/arkui_ace_engine | advanced_ui_component/composelistitem/source/composelistitem.ets | arkts | getAccessibilityLevelOnChange | Obtain accessible level
@param resource
@param selected select state
@returns string | function getAccessibilityLevelOnChange(accessibilityLevel?: string, onChange?: (value: boolean) => void): string {
if (accessibilityLevel) {
return accessibilityLevel;
}
if (onChange) {
return ACCESSIBILITY_LEVEL_YES;
}
return ACCESSIBILITY_LEVEL_NO;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getAccessibilityLevelOnChange AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#optional_parameter#Left AST#identifier#Left accessibilityLevel AST#identifier#Right AST#?#Left ? AST... | function getAccessibilityLevelOnChange(accessibilityLevel?: string, onChange?: (value: boolean) => void): string {
if (accessibilityLevel) {
return accessibilityLevel;
}
if (onChange) {
return ACCESSIBILITY_LEVEL_YES;
}
return ACCESSIBILITY_LEVEL_NO;
} | https://gitee.com/openharmony/arkui_ace_engine.git | 2e3190092aff08fcba21de130a7674c3de1dd649 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/ternary/ternary_byte.ets | arkts | main | ---
desc: check ternary if-else operation with condition of byte operand
--- | function main(): void {
const a: byte = {{v.condition}}
const b: byte = {{v.ifTrue}}
const c: byte = {{v.ifFalse}}
assert (a ? b : c) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A... | function main(): void {
const a: byte = {{v.condition}}
const b: byte = {{v.ifTrue}}
const c: byte = {{v.ifFalse}}
assert (a ? b : c) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 9dc78d3c93d80012eb2171adc43c8a68dd3742fa | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/String.ets | arkts | at | The at() method takes an integer value and returns a new String consisting of the single UTF-16 code unit located
at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character.
@returns A String consisting of the single UTF-16 code unit locat... | public at(index: number): String throws {
throw new Error("not implemented")
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left at AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR... | public at(index: number): String throws {
throw new Error("not implemented")
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 7dd2d2bc776e657d38b6e38bea03662e081637e9 | gitee |
erosTeam/NextE | shared/src/main/ets/network/EhApiService.ets | arkts | getGalleryDetail | Fetch a gallery detail page; returns header (incl. tags/apikey) + first preview page. | async getGalleryDetail(gid: string, token: string, isEx: boolean): Promise<GalleryDetailResult> {
const url: string = `${EhConstants.baseUrl(isEx)}/g/${gid}/${token}/`
const resp = await this.fetch(url, isEx, 'detail')
const gallery: EhGallery = EhGalleryDetailParser.parse(resp.body, gid, token)
const... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getGalleryDetail AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left gid AST#identifier#Right AST#type_annotation#Left AST#:#Left :... | async getGalleryDetail(gid: string, token: string, isEx: boolean): Promise<GalleryDetailResult> {
const url: string = `${EhConstants.baseUrl(isEx)}/g/${gid}/${token}/`
const resp = await this.fetch(url, isEx, 'detail')
const gallery: EhGallery = EhGalleryDetailParser.parse(resp.body, gid, token)
const... | https://github.com/erosTeam/NextE | e67d05644d706947a2ce224958465b5dca012d71 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Map.ets | arkts | forEach | Applies a function over all elements of the Map
@param fn to apply | forEach(fn: (v: V) => void): void {
let l: (v: V, k: K) => void = (v: V, k: K): void => { fn(v) }
Map.forEachNode(this.tree, l)
} | AST#program#Left AST#ERROR#Left AST#identifier#Left forEach AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left fn 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#Left v AST#iden... | forEach(fn: (v: V) => void): void {
let l: (v: V, k: K) => void = (v: V, k: K): void => { fn(v) }
Map.forEachNode(this.tree, l)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 3b533b12acaa780d42983b6ba6900aa9df1fa8c9 | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/VoiceGuide.ets | arkts | simplifyText | 简化播报文本
@param text 原始文本 | private simplifyText(text: string): string {
// 移除"约"、"左右"等模糊词
let simplified = text
.replace(/约/g, '')
.replace(/左右/g, '')
.replace(/大约/g, '');
// 简化数字
simplified = simplified.replace(/(\d+)米/g, (match: string, num: string): string => {
const n = parseInt(num);
if (n >=... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left simplifyText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | private simplifyText(text: string): string {
// 移除"约"、"左右"等模糊词
let simplified = text
.replace(/约/g, '')
.replace(/左右/g, '')
.replace(/大约/g, '');
// 简化数字
simplified = simplified.replace(/(\d+)米/g, (match: string, num: string): string => {
const n = parseInt(num);
if (n >=... | https://github.com/LJ666-ui/harmony-health-care | 8f78d0dcc40a9e0445e2b24ee59e075a89801507 | github |
Countly/countly-sdk-hos | library/src/ohosTest/ets/test/Consent.test.ets | arkts | <arrow> | CrashesApi | async (): Promise<void> => { h.instance.crashes.addCrashBreadcrumb('post_halt_breadcrumb'); }, | AST#program#Left AST#ERROR#Left AST#arrow_function#Left AST#async#Left async AST#async#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_type#Left AST#type_identifier#Left Promise AST#type_identifi... | async (): Promise<void> => { h.instance.crashes.addCrashBreadcrumb('post_halt_breadcrumb'); }, | https://github.com/Countly/countly-sdk-hos | 38a555d3b9492cbf55fd3bd6463fe7cec5476dfd | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/utils/BackgroundImageUtil.ets | arkts | disableBackgroundImage | 禁用背景图
同时清除本地缓存文件和内存缓存 | async disableBackgroundImage(): Promise<void> {
await this.setBackgroundImageType(BackgroundImageType.NONE);
this.cachedUrl = '';
this.isLoaded = true;
this.cachedImageData = null;
// 删除本地缓存文件,防止下次启动时仍然显示旧图片
await this.clearLocalCache();
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left disableBackgroundImage 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 A... | async disableBackgroundImage(): Promise<void> {
await this.setBackgroundImageType(BackgroundImageType.NONE);
this.cachedUrl = '';
this.isLoaded = true;
this.cachedImageData = null;
// 删除本地缓存文件,防止下次启动时仍然显示旧图片
await this.clearLocalCache();
} | https://github.com/AlkaidLab/moonlight-harmony | 467b1109f612f096af3f8b3685d474096a5800b1 | github |
Joker-x-dev/CoolMallArkTS | feature/auth/src/main/ets/viewmodel/AccountLoginViewModel.ets | arkts | updateAccount | 更新账号输入
@param {string} value - 账号值
@returns {void} 无返回值 | updateAccount(value: string): void {
this.account = value;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateAccount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) ... | updateAccount(value: string): void {
this.account = value;
} | https://github.com/Joker-x-dev/CoolMallArkTS | a30dcadb2a25cf3780017804bbccee35ff7b99f6 | github |
zmuxuny/ai-guardian-star | entry/src/main/ets/common/CloudService.ets | arkts | postJson | ── 核心请求工具 ────────────────────────────────────────────── | async function postJson(path: string, body: Object): Promise<CloudResult> {
const req = http.createHttp();
try {
const bodyStr = JSON.stringify(body);
console.info('[CloudService]: POST', path, 'body:', bodyStr);
const resp = await req.request(ECS_BASE_URL + path, {
method: http.RequestMethod.POST... | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left postJson AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left path AST#identifier#Right AST#type_annot... | async function postJson(path: string, body: Object): Promise<CloudResult> {
const req = http.createHttp();
try {
const bodyStr = JSON.stringify(body);
console.info('[CloudService]: POST', path, 'body:', bodyStr);
const resp = await req.request(ECS_BASE_URL + path, {
method: http.RequestMethod.POST... | https://github.com/zmuxuny/ai-guardian-star/blob/87ab023d8b9aab4303a9fc1e97508e1f8ee01e07/entry/src/main/ets/common/CloudService.ets#L72-L102 | 7778431701b11040f08ca4ab349686b4a22aec0f | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | constructor | Creates an Uint8Array from FixedArray<number>
@param { FixedArray<number> } numbers - data initializer
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public constructor(numbers: FixedArray<number>) {
this(numbers.length)
for (let i: int = 0; i < this.lengthInt; ++i) {
this.setUnsafe(i, Uint8Array.doubleToInt(numbers[i]))
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left numbers AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_exp... | public constructor(numbers: FixedArray<number>) {
this(numbers.length)
for (let i: int = 0; i < this.lengthInt; ++i) {
this.setUnsafe(i, Uint8Array.doubleToInt(numbers[i]))
}
} | https://gitcode.com/iop123123/arkts-static-skills | 535ec7b8b63ffbd7928f4583be227acad94258b2 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Box.ets | arkts | get | Gets the double value wrapped in this DoubleBox.
@returns { double } The double value wrapped in this DoubleBox
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public get(): double {
return this.value;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left get 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#:#Right... | public get(): double {
return this.value;
} | https://gitcode.com/iop123123/arkts-static-skills | a4e180918d86a9c38e91b94cb320bbccf5239018 | gitcode |
Joker-x-dev/CoolMallArkTS | feature/auth/src/main/ets/view/RegisterPage.ets | arkts | build | 构建注册页面
@returns {void} 无返回值 | build(): void {
AppNavDestination({
pageBackgroundColor: $r("app.color.bg_white"),
titleOptions: { backgroundColor: $r("app.color.bg_white") },
viewModel: this.vm
}) {
this.RegisterContent();
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#... | build(): void {
AppNavDestination({
pageBackgroundColor: $r("app.color.bg_white"),
titleOptions: { backgroundColor: $r("app.color.bg_white") },
viewModel: this.vm
}) {
this.RegisterContent();
}
} | https://github.com/Joker-x-dev/CoolMallArkTS | 6e050bda3cae61687238f6e737625d4480323a66 | github |
openharmony/applications_calendar_data | datamanager/src/main/ets/processor/alerts/AlertsProcessor.ets | arkts | isEventSameWithAlertCreator | 检查待插入的 alert 与 event 表中相同 event_id 的元组是否拥有相同的 creator
@param rdbStore rdb数据库
@param values 插入操作的数据
@return true 相同 false 不相同 | async function isEventSameWithAlertCreator(rdbStore: data_rdb.RdbStore, values: ValuesBucket): Promise<boolean> {
Log.debug(TAG, 'isEventSameWithAlertCreator start');
const calendarAlertCreator = values[CalendarsColumns.CREATOR];
let resultSet = await queryEventIdAndCreatorByAlert(rdbStore, values);
if (resultS... | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left isEventSameWithAlertCreator AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left rdbStore AST#identifi... | async function isEventSameWithAlertCreator(rdbStore: data_rdb.RdbStore, values: ValuesBucket): Promise<boolean> {
Log.debug(TAG, 'isEventSameWithAlertCreator start');
const calendarAlertCreator = values[CalendarsColumns.CREATOR];
let resultSet = await queryEventIdAndCreatorByAlert(rdbStore, values);
if (resultS... | https://gitee.com/openharmony/applications_calendar_data.git | e0cf6aa0b4bef9eeddac1cffc68d60f4bde6d3e0 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | constructor | Creates an Int16Array with respect to buf.
@param buf data initializer | public constructor(buf: Buffer) {
this(buf, 0, buf.getByteLength() / Int16Array.BYTES_PER_ELEMENT)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Buffe... | public constructor(buf: Buffer) {
this(buf, 0, buf.getByteLength() / Int16Array.BYTES_PER_ELEMENT)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 93fb72748351b6ab4848beb89943ac90ed3c50d4 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelDictRuleManager.ets | arkts | loadRulesFromStorage | 从数据库加载规则 | private async loadRulesFromStorage(): Promise<void> {
try {
const dataManager = getNovelDataManager();
const store = dataManager.getStore();
const rs = await store.querySql(
'SELECT * FROM novel_dict_rule ORDER BY sortNumber ASC'
);
this.rules.clear();
if (rs.goT... | 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 loadRulesFromStorage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Ri... | private async loadRulesFromStorage(): Promise<void> {
try {
const dataManager = getNovelDataManager();
const store = dataManager.getStore();
const rs = await store.querySql(
'SELECT * FROM novel_dict_rule ORDER BY sortNumber ASC'
);
this.rules.clear();
if (rs.goT... | https://github.com/DaLongZhuaZi/manxia | 6259ef80d91460178a5e73f3b8c69e518b7f9b15 | github |
Joker-x-dev/CoolMallArkTS | core/base/src/main/ets/viewmodel/BaseNetWorkViewModel.ets | arkts | onRequestStart | 请求开始前回调
@returns {void} 无返回值 | protected onRequestStart(): void {
this.setLoadingState();
} | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left onRequestStart 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 AS... | protected onRequestStart(): void {
this.setLoadingState();
} | https://github.com/Joker-x-dev/CoolMallArkTS | f6eca5af248229fe4ef5ba26e63300d25328c05d | github |
2763981847/Clock-Alarm | entry/src/main/ets/common/util/GlobalContext.ets | arkts | setObject | 设置指定键对应的对象。
@param key 对象的键
@param objectClass 要设置的对象 | setObject(key: string, objectClass: Object): void {
this._objects.set(key, objectClass);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setObject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#... | setObject(key: string, objectClass: Object): void {
this._objects.set(key, objectClass);
} | https://github.com/2763981847/Clock-Alarm | 930deb3d98de64849ca7f03ab1773c3443b417dc | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ThemeManager.ets | arkts | getLightModeGlassShadowColor | 获取浅色玻璃投影颜色 | public getLightModeGlassShadowColor(): string {
return this.getGlassShadowColorForLevel(GlassLevel.CARD);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLightModeGlassShadowColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Le... | public getLightModeGlassShadowColor(): string {
return this.getGlassShadowColorForLevel(GlassLevel.CARD);
} | https://github.com/DaLongZhuaZi/manxia | 69516ea3f547bbd0fdebf21580c8acc5b6083c96 | github |
openharmony/applications_call | entry/src/main/ets/common/components/BottomBtn.ets | arkts | imgSizes | Image size | imgSizes(type) {
if (type == 'keyboard') {
return 30;
}
if (type == 'speakerphone') {
return 30;
}
if (type == 'hangUP') {
return 56;
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left imgSizes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left type AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression... | imgSizes(type) {
if (type == 'keyboard') {
return 30;
}
if (type == 'speakerphone') {
return 30;
}
if (type == 'hangUP') {
return 56;
}
} | https://gitee.com/openharmony/applications_call.git | 651ca1923446fd2115d40a5a1c25e1b868f034bf | gitee |
ibestservices/ibest-ui | library/src/main/ets/components/switch/index.ets | arkts | getTransDistance | 获取移动距离 | getTransDistance(){
return this.realWidth - this.switchBarSize
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getTransDistance 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... | getTransDistance(){
return this.realWidth - this.switchBarSize
} | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/switch/index.ets#L149-L151 | 47d1b091140b042a70f293f085c737521deda449 | github |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/components/search-box/TnSearchBox.ets | arkts | if | 搜索按钮(内部右侧) | if (this.searchButton) {
this.SearchButton();
} | AST#program#Left AST#if_statement#Left AST#if#Left if AST#if#Right AST#parenthesized_expression#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#this#Left this AST#this#Right AST#.#Left . AST#.#Right AST#property_identifier#Left searchButton AST#property_identifier#Right AST#member_expression#Right AST#)#Le... | if (this.searchButton) {
this.SearchButton();
} | https://github.com/codelably/tuniao-ui | 1b6179d74ae098e1ac3db362544f69509599b6b8 | github |
Explore-In-HMOS-Wearable/event-calendar | entry/src/main/ets/services/PermissionHandler.ets | arkts | openPermissionsSetting | The permission setting dialog box is displayed. | private openPermissionsSetting(): void {
let atManager = abilityAccessCtrl.createAtManager();
atManager.requestPermissionOnSetting(
this.context,
CALENDAR_PERMISSIONS
)
.then((data: Array<abilityAccessCtrl.GrantStatus>) => {
console.info('Permission Granted')
})
.catc... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left openPermissionsSetting 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 vo... | private openPermissionsSetting(): void {
let atManager = abilityAccessCtrl.createAtManager();
atManager.requestPermissionOnSetting(
this.context,
CALENDAR_PERMISSIONS
)
.then((data: Array<abilityAccessCtrl.GrantStatus>) => {
console.info('Permission Granted')
})
.catc... | https://github.com/Explore-In-HMOS-Wearable/event-calendar | 4051ab4eadf6bd3f55ee5d9c802ab269f0a478ae | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/SettingsService.ets | arkts | getNumber | 获取数值设置 | private async getNumber(key: string, defaultValue: number): Promise<number> {
const value = await PreferencesUtil.get<number | string>(key, defaultValue.toString());
if (typeof value === 'number') {
return Number.isFinite(value) ? value : defaultValue;
}
const trimmedValue = value.trim();
if... | 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 getNumber AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:... | private async getNumber(key: string, defaultValue: number): Promise<number> {
const value = await PreferencesUtil.get<number | string>(key, defaultValue.toString());
if (typeof value === 'number') {
return Number.isFinite(value) ? value : defaultValue;
}
const trimmedValue = value.trim();
if... | https://github.com/AlkaidLab/moonlight-harmony | 65c0450b3299c18507e0661f48d6f24ab92e6104 | github |
openharmony/applications_call | entry/src/main/ets/model/CallManager.ets | arkts | updateCallTimeList | update call time list | updateCallTimeList() {
if (!this.mCallDataManager.hasActiveCall()) {
LogUtils.i(TAG, 'no active calls to update');
return;
}
this.callTimeList = AppStorage.Get('CallTimeList');
this.callTimeList.forEach((item, i) => {
if (this.mCallDataManager.isActiveCall(item.callId)) {
it... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateCallTimeList 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... | updateCallTimeList() {
if (!this.mCallDataManager.hasActiveCall()) {
LogUtils.i(TAG, 'no active calls to update');
return;
}
this.callTimeList = AppStorage.Get('CallTimeList');
this.callTimeList.forEach((item, i) => {
if (this.mCallDataManager.isActiveCall(item.callId)) {
it... | https://gitee.com/openharmony/applications_call.git | 54c70ba2277b6537aa0ebf98277ac9f76705e711 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/String.ets | arkts | createFromJSONValue | Creates a String instance based on JSONValue
@param json: JSONValue - a JSON representation
@throws JSONTypeError if json does not encode a valid String
@returns String - string value decoded from JSON | static createFromJSONValue(json: JSONValue): String {
if (json instanceof JSONString) {
return (json as JSONString).value
}
throw new JSONTypeError("Cannot create String from JSON", json)
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createFromJSONValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left json AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | static createFromJSONValue(json: JSONValue): String {
if (json instanceof JSONString) {
return (json as JSONString).value
}
throw new JSONTypeError("Cannot create String from JSON", json)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 15a3e8bbe4e9b7da4ca6152ce75731357c8953c1 | gitee |
OHPG/FinMusic | entry/src/main/ets/prefer/AppPrefer.ets | arkts | isCastEnabled | ─── 投屏相关 ────────────────────────────────────────────────────────────── | public isCastEnabled(): boolean {
return this.preference.getSync(AppPrefer.KEY_CAST_ENABLED, true) as boolean
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isCastEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST... | public isCastEnabled(): boolean {
return this.preference.getSync(AppPrefer.KEY_CAST_ENABLED, true) as boolean
} | https://github.com/OHPG/FinMusic | 29912753e4f5cc58a72d82283eb1edcd07986343 | github |
openharmony/arkui_ace_engine | advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.SubHeaderV2.ets | arkts | getNumberByResource | get resource size
@Param resourceName resource id
@returns resource size | public static getNumberByResource(resourceId: long, defaultNumber: number): number {
try {
let resourceNumber: number = resourceManager.getSysResourceManager().getDouble(resourceId);
if (resourceNumber === 0) {
return defaultNumber;
} else {
return resourceNumber;
}
} c... | 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 getNumberByResource AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left resourceId AST#identifier#Right AST#ERROR#Left AST... | public static getNumberByResource(resourceId: long, defaultNumber: number): number {
try {
let resourceNumber: number = resourceManager.getSysResourceManager().getDouble(resourceId);
if (resourceNumber === 0) {
return defaultNumber;
} else {
return resourceNumber;
}
} c... | https://gitcode.com/openharmony/arkui_ace_engine | d237d22e25a8cf0b1bbde5f444527d8144be0837 | gitcode |
CPF-ApplicationTPC/openharmony_tpc_samples | SwipeMenuListView/library/src/main/ets/utils/SwipeStateController.ets | arkts | smoothCloseMenu | 关闭当前打开的菜单 | public smoothCloseMenu(): void {
if (this._currentOpenPosition !== -1) {
const controller = this._itemControllers.get(this._currentOpenPosition);
if (controller) {
controller.closeMenu();
this.set(-1);
}
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left smoothCloseMenu 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#expres... | public smoothCloseMenu(): void {
if (this._currentOpenPosition !== -1) {
const controller = this._itemControllers.get(this._currentOpenPosition);
if (controller) {
controller.closeMenu();
this.set(-1);
}
}
} | https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples | f5ae56406b5f46deef6fba54b362bdfcffd5d93a | gitcode |
Cool_foolisher1/ArkTSRepository | GuardianAssistant/entry/src/main/ets/manager/CleanerManager.ets | arkts | getAssets | 获取所有图片/视频 | async getAssets() {
try {
if (canIUse('SystemCapability.FileManagement.PhotoAccessHelper.Core')) {
// 1. 建立检索条件,用于获取图片资源。
const context: Context = new UIContext().getHostContext() as Context
const phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context)
const predicat... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAssets AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Righ... | async getAssets() {
try {
if (canIUse('SystemCapability.FileManagement.PhotoAccessHelper.Core')) {
// 1. 建立检索条件,用于获取图片资源。
const context: Context = new UIContext().getHostContext() as Context
const phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context)
const predicat... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | e23852bb4df0ec97a674cbef51c390b3e23d8908 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | reduceRight | Calls the specified callback function for all the elements in an array, in descending order.
The return value of the callback function is the accumulated result,
and is provided as an argument in the next call to the callback function.
@param { function } callbackfn - A function that accepts four arguments.
The reduceR... | public reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: int, array: Uint8ClampedArray) => number): number {
if (this.lengthInt == 0) {
throw new TypeError("Reduce of empty array with no initial value")
}
let accumulatedValue: number = this.$_ge... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left reduceRight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#L... | public reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: int, array: Uint8ClampedArray) => number): number {
if (this.lengthInt == 0) {
throw new TypeError("Reduce of empty array with no initial value")
}
let accumulatedValue: number = this.$_ge... | https://gitcode.com/iop123123/arkts-static-skills | f41b54d9535237d03879e3c311dcab3727434a2f | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Search/SearchIntentParser.ets | arkts | parse | 解析用户输入的搜索查询
@param rawQuery 原始输入
@param sourceUrlPattern 图源URL模式配置(可选)
@returns 解析后的搜索意图 | static parse(rawQuery: string, sourceUrlPattern?: SourceUrlPattern): SearchIntent {
const trimmed = rawQuery.trim();
if (!trimmed) {
const result: SearchIntent = {
type: SearchIntentType.KEYWORD,
rawQuery: rawQuery
};
return result;
}
// 1. 优先检测URL
if (SearchInt... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left parse AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left rawQuery AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST... | static parse(rawQuery: string, sourceUrlPattern?: SourceUrlPattern): SearchIntent {
const trimmed = rawQuery.trim();
if (!trimmed) {
const result: SearchIntent = {
type: SearchIntentType.KEYWORD,
rawQuery: rawQuery
};
return result;
}
// 1. 优先检测URL
if (SearchInt... | https://github.com/DaLongZhuaZi/manxia | 00b4475768dbe832656736838f6b248a93f6fca3 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets | arkts | getSeconds | Returns the seconds in the specified date according to local time.
@returns { int } An integer number, between 0 and 59
representing the seconds in the given date according to local time.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public getSeconds(): int {
let localTime = this.ms - this.TZOffset * 60 * msPerSecond;
return ecmaSecFromTime(localTime);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getSeconds 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 int AST#ide... | public getSeconds(): int {
let localTime = this.ms - this.TZOffset * 60 * msPerSecond;
return ecmaSecFromTime(localTime);
} | https://gitcode.com/iop123123/arkts-static-skills | 9530400b9eefbc20aa41926471e45de2f779df97 | gitcode |
Kira-Yagami-Light/Kira-Projects | TodoTask/entry/src/main/ets/data/database/CategoryDao.ets | arkts | queryByName | 根据名称查询分类
@param name 分类名称
@returns Promise<Array<Record<string, any>>> 分类记录数组 | async queryByName(name: string): Promise<Array<Record<string, number | string>>> {
const store = this.dbHelper.getRdbStore();
if (!store) {
Logger.error(this.LOG_TAG, 'RdbStore is null');
return [];
}
try {
const predicates = new relationalStore.RdbPredicates(this.tableName);
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left queryByName AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left name AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST... | async queryByName(name: string): Promise<Array<Record<string, number | string>>> {
const store = this.dbHelper.getRdbStore();
if (!store) {
Logger.error(this.LOG_TAG, 'RdbStore is null');
return [];
}
try {
const predicates = new relationalStore.RdbPredicates(this.tableName);
... | https://github.com/Kira-Yagami-Light/Kira-Projects | 498c8f6b00606d80f83bd1b19430df2c42d2cebe | github |
openharmony/update_update_app | feature/ota/src/main/ets/UpgradeAdapter.ets | arkts | getPageInstance | 取支持的升级类型以及UX实例
@return 支持的升级类型以及UX实例 | getPageInstance(): IPage {
if (!this._page) {
this._page = new OtaPage();
}
return this._page;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPageInstance 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 IPage AST#identifier#Right AST#ERROR#Right AST... | getPageInstance(): IPage {
if (!this._page) {
this._page = new OtaPage();
}
return this._page;
} | https://gitee.com/openharmony/update_update_app.git | 5ce4ba0d71e1b297b4b51c7f8cf55a5bfcc20448 | gitee |
Cool_foolisher1/ArkTSRepository | GraphicalCode/commons/src/main/ets/util/WindowUtil.ets | arkts | resetWindowSize | 重置窗口大小 | private static resetWindowSize(): void {
if (canIUse('SystemCapability.Window.SessionManager')) {
try {
const windowSize: display.Display = display.getDefaultDisplaySync()
const appWidth: number = windowSize.width * 9 / 10
const appHeight: number = windowSize.height * 7 / 8
c... | 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 resetWindowSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ... | private static resetWindowSize(): void {
if (canIUse('SystemCapability.Window.SessionManager')) {
try {
const windowSize: display.Display = display.getDefaultDisplaySync()
const appWidth: number = windowSize.width * 9 / 10
const appHeight: number = windowSize.height * 7 / 8
c... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 7da59f7e2187eee0ef27d86e58afc42133fcfaa5 | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.TreeSet.ets | arkts | add | Add a new element into the TreeSet
@param value: the value to be added into the TreeSet
@returns true if the element is successfully added into the TreeSet | add(value: T): boolean {
if (this.has(value)) {
return false;
} else {
this.treeMap.set(value, value)
return true;
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left add AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#Right AST#ERROR#Right AST#)#Left ) AST#)#Right AST... | add(value: T): boolean {
if (this.has(value)) {
return false;
} else {
this.treeMap.set(value, value)
return true;
}
} | https://gitcode.com/iop123123/arkts-static-skills | 7801d84fa750da50789416c57bab8bd21d2f32f9 | gitcode |
LJ666-ui/harmony-health-care | entry/src/main/ets/core/DataCollector.ets | arkts | getCollectionInterval | 获取采集间隔 | public getCollectionInterval(): number {
return this.collectionInterval;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getCollectionInterval 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 numb... | public getCollectionInterval(): number {
return this.collectionInterval;
} | https://github.com/LJ666-ui/harmony-health-care | 15821a1d464125ccb86f00211b368be44288c1e0 | github |
youyeyejie/ZhiXing_ActHub | entry/src/main/ets/core/security/HashUtils.ets | arkts | bytesToHex | 组件功能简介:
- 将字节数组转为十六进制字符串。
可传入项:
- `data`: 需要转换的字节数组。
返回行为:
- 返回对应十六进制编码结果。
副作用:
- 无。 | private static bytesToHex(data: Uint8Array): string {
let result: string = '';
for (let index = 0; index < data.length; index++) {
result += data[index].toString(16).padStart(2, '0');
}
return result;
} | 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 bytesToHex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AS... | private static bytesToHex(data: Uint8Array): string {
let result: string = '';
for (let index = 0; index < data.length; index++) {
result += data[index].toString(16).padStart(2, '0');
}
return result;
} | https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/core/security/HashUtils.ets#L57-L63 | 659a09458452a840386196f6a8ce9afdef215eb5 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test47_original_index.ets | arkts | minOfArray | --- Math.min/max with manual spread --- | function minOfArray(arr: number[]): number {
let min: number = arr[0];
for (let i: number = 1; i < arr.length; i++) {
if (arr[i] < min) {
min = arr[i];
}
}
return min;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left minOfArray AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arr AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right ... | function minOfArray(arr: number[]): number {
let min: number = arr[0];
for (let i: number = 1; i < arr.length; i++) {
if (arr[i] < min) {
min = arr[i];
}
}
return min;
} | https://github.com/miaochiahao/ark-ghidra | c8163242c7e98a27052eb4d3fd5e01fc28fd42b3 | github |
Cool_foolisher1/ArkTSRepository | GraphicalCode/commons/src/main/ets/util/BreakpointSystemUtil.ets | arkts | updateWidthBp | 更新断点宽度
@param window window.Window | public updateWidthBp(window: window.Window): void {
try {
const mainWindow: window.WindowProperties = window.getWindowProperties()
const windowWidth: number = mainWindow.windowRect.width
const windowWidthVp = window.getUIContext().px2vp(windowWidth)
const deviceType = deviceInfo.productSer... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left updateWidthBp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left window AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expressio... | public updateWidthBp(window: window.Window): void {
try {
const mainWindow: window.WindowProperties = window.getWindowProperties()
const windowWidth: number = mainWindow.windowRect.width
const windowWidthVp = window.getUIContext().px2vp(windowWidth)
const deviceType = deviceInfo.productSer... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 9526fa76a1d53cdedb020353093a0168a8dfa10d | gitcode |
Tencent-RTC/TUIKit_Harmony | call/src/main/ets/common/utils/TimerUtil.ets | arkts | secondToHMSString | Format seconds → "MM:SS" or "H:MM:SS" when ≥ 1h. | static secondToHMSString(seconds: number): string {
const total = Math.max(0, Math.floor(seconds));
const h = Math.floor(total / 3600);
const m = Math.floor((total % 3600) / 60);
const s = total % 60;
const mm = m < 10 ? `0${m}` : `${m}`;
const ss = s < 10 ? `0${s}` : `${s}`;
if (h > 0) {
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left secondToHMSString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left seconds AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#numb... | static secondToHMSString(seconds: number): string {
const total = Math.max(0, Math.floor(seconds));
const h = Math.floor(total / 3600);
const m = Math.floor((total % 3600) / 60);
const s = total % 60;
const mm = m < 10 ? `0${m}` : `${m}`;
const ss = s < 10 ? `0${s}` : `${s}`;
if (h > 0) {
... | https://github.com/Tencent-RTC/TUIKit_Harmony | 3b411bdd9a2e68f6dee8ed353dcbb943b59426ab | github |
SMAT-Lab/PhantomRendering | Harmoney_Next-Tiktok/entry/src/main/ets/utils/ThemeManager.ets | arkts | initTheme | 初始化主题 | initTheme() {
try {
const currentTheme = this.getCurrentTheme()
AppStorage.setOrCreate('current_theme', currentTheme)
} catch (error) {
// 初始化失败时使用默认主题
AppStorage.setOrCreate('current_theme', ThemeMode.LIGHT)
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initTheme 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 AST... | initTheme() {
try {
const currentTheme = this.getCurrentTheme()
AppStorage.setOrCreate('current_theme', currentTheme)
} catch (error) {
// 初始化失败时使用默认主题
AppStorage.setOrCreate('current_theme', ThemeMode.LIGHT)
}
} | https://github.com/SMAT-Lab/PhantomRendering | cbd15e2be53a714e4bb0040f8c2317e8e8eb44f2 | github |
huaiminqin/TankWar-Master-with-Many-Tasks | game/src/main/ets/actors/actor/DecryptPoint.ets | arkts | checkPlayer | 检查玩家是否在范围内并静止 | checkPlayer(player: PlayerTank): boolean {
if (this.isDecrypted || !this.isVisible()) {
return false;
}
const inRange = this.collidesWithSprite(player);
const currentX = player.getX();
const currentY = player.getY();
const now = Date.now();
if (inRange) {
// 检查玩家是否静止(允许微小移动)
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left checkPlayer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left player AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left PlayerTank AST#identifier#Right AST#)#Left... | checkPlayer(player: PlayerTank): boolean {
if (this.isDecrypted || !this.isVisible()) {
return false;
}
const inRange = this.collidesWithSprite(player);
const currentX = player.getX();
const currentY = player.getY();
const now = Date.now();
if (inRange) {
// 检查玩家是否静止(允许微小移动)
... | https://github.com/huaiminqin/TankWar-Master-with-Many-Tasks | 96f6153157ee547dbcb7c6b7f41a7de83b221d53 | github |
HarmonyOS_Samples/BestPracticeSnippets | SegmentedPhotograph/entry/src/main/ets/mode/CameraService.ets | arkts | sessionFlowFn | Session Process | async sessionFlowFn(cameraManager: camera.CameraManager, cameraInput: camera.CameraInput,
previewOutput: camera.PreviewOutput, photoOutput: camera.PhotoOutput | undefined): Promise<void> {
try {
// Creating a CaptureSession Instance
if (this.curSceneMode === camera.SceneMode.NORMAL_PHOTO) {
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left sessionFlowFn AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left cameraManager AST#identifier#Right AST#type_annotation#Left AST#:... | async sessionFlowFn(cameraManager: camera.CameraManager, cameraInput: camera.CameraInput,
previewOutput: camera.PreviewOutput, photoOutput: camera.PhotoOutput | undefined): Promise<void> {
try {
// Creating a CaptureSession Instance
if (this.curSceneMode === camera.SceneMode.NORMAL_PHOTO) {
... | https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets | 679a13f70b7becadec9bf47537be260e340582fb | gitcode |
anhao0226/harmony-music-player | entry/src/main/ets/components/LyricComponent.ets | arkts | handleSongLyric | 27646198 | handleSongLyric(songId: number) {
console.log(`handleSongLyric === ${songId.toString()}`);
fetchSongLyric(songId).then((value: string) => {
//
let lyrics: LyricInterface[] = [];
value.split('\n').forEach((str: string) => {
const regValue = this.matchLyric(str);
if (regValue) ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handleSongLyric AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left songId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#R... | handleSongLyric(songId: number) {
console.log(`handleSongLyric === ${songId.toString()}`);
fetchSongLyric(songId).then((value: string) => {
//
let lyrics: LyricInterface[] = [];
value.split('\n').forEach((str: string) => {
const regValue = this.matchLyric(str);
if (regValue) ... | https://github.com/anhao0226/harmony-music-player | d79c9286d386ee154478c161e6415cc77df49aa6 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets | arkts | blink | The blink() method creates a string that embeds a string in a <blink> element (<blink>str</blink>),
which causes a string to be displayed in a big font.
@returns { String }
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public blink(): String{
return this.CreateHTMLString('blink', '')
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left blink 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 blink(): String{
return this.CreateHTMLString('blink', '')
} | https://gitcode.com/iop123123/arkts-static-skills | b45fa59c9e22fba0229055e82979857d527eebce | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Lifecycle/CancellablePromise.ets | arkts | then | then 方法 | then<TResult1 = T, TResult2 = never>(
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
onrejected?: ((reason: ESObject) => TResult2 | PromiseLike<TResult2>) | null
): CancellablePromise<TResult1 | TResult2> {
return new CancellablePromise<TResult1 | TResult2>((resolve, reject, sign... | AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#identifier#Left then AST#identifier#Right AST#<#Left < AST#<#Right AST#assignment_expression#Left AST#identifier#Left TResult1 AST#identifier#Right AST#=#Left = AST#=#Right AST#identifier#Left T AST#identifier#Rig... | then<TResult1 = T, TResult2 = never>(
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
onrejected?: ((reason: ESObject) => TResult2 | PromiseLike<TResult2>) | null
): CancellablePromise<TResult1 | TResult2> {
return new CancellablePromise<TResult1 | TResult2>((resolve, reject, sign... | https://github.com/DaLongZhuaZi/manxia | 0530991b476a3466de92c3ef4b98629342d1fc72 | github |
cpdd5201314/harmonyOS-music-app | products/phone/src/main/ets/pages/MusicPlayerService.ets | arkts | waitForState | 等待播放器达到指定状态 | private waitForState(targetState: string, timeout: number): Promise<void> {
return new Promise<void>((resolve, reject) => {
if (this.currentState === targetState) {
resolve();
return;
}
const startTime = Date.now();
const checkInterval = setInterval(() => {
if (thi... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left waitForState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left targetState AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st... | private waitForState(targetState: string, timeout: number): Promise<void> {
return new Promise<void>((resolve, reject) => {
if (this.currentState === targetState) {
resolve();
return;
}
const startTime = Date.now();
const checkInterval = setInterval(() => {
if (thi... | https://github.com/cpdd5201314/harmonyOS-music-app | 762dc20e318009812fd38b6cbfd7f2b2b6c09c0e | github |
openharmony/codelabs | ETSUI/MemoTime/entry/src/main/ets/pages/ScheduleEditPage.ets | arkts | openStartTimePicker | 打开开始时间选择器 | openStartTimePicker(): void {
const date = new Date(this.scheduleStartTime)
this.tempHour = date.getHours()
this.tempMinute = date.getMinutes()
this.showStartTimePicker = true
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left openStartTimePicker AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statemen... | openStartTimePicker(): void {
const date = new Date(this.scheduleStartTime)
this.tempHour = date.getHours()
this.tempMinute = date.getMinutes()
this.showStartTimePicker = true
} | https://gitcode.com/openharmony/codelabs | 2c7e32a38607c0539f21226fe922a3f2fee8d3e3 | gitcode |
cpdd5201314/harmonyOS-music-app | products/phone/src/main/ets/pages/Home.ets | arkts | build | private handleSelectPlaylist(item: PlaylistItem): void {
// const params: MusicInfo = {
// id: item.id,
// name: item.author,
// albumName:
// }
const params: GeneratedTypeLiteralInterface_1 = {
playlistId: item.id,
playlistName: item.name,
};
router.pushUrl({
url: 'pages/PlaylistDetailPage',
params,
});
} | build() {
Scroll() {
Column() {
Column() {
// 搜索栏
Row() {
Image($r('app.media.ic_search'))
.width(20)
.height(20)
.fillColor('#999999')
.margin({ left: 15, right: 10 })
TextInput({ placeholder: '搜索音乐、... | 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() {
Scroll() {
Column() {
Column() {
// 搜索栏
Row() {
Image($r('app.media.ic_search'))
.width(20)
.height(20)
.fillColor('#999999')
.margin({ left: 15, right: 10 })
TextInput({ placeholder: '搜索音乐、... | https://github.com/cpdd5201314/harmonyOS-music-app | d5a080081339d31a59801cefd2d2a810950f299d | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/LinkedBlockingQueue.ets | arkts | constructor | Constructs a default LinkedBlockingQueue. | constructor() {
this.actualCapacity = Int.MAX_VALUE;
this.head = new ListNode<T>();
this.tail = this.head;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A... | constructor() {
this.actualCapacity = Int.MAX_VALUE;
this.head = new ListNode<T>();
this.tail = this.head;
} | https://gitcode.com/iop123123/arkts-static-skills | 0b2870af3ef4720b1f59e2526b0c92205d25bf4d | gitcode |
openharmony-sig/earth | hpauditor/tests/issues/expected/issue25.ets.audit.ets | arkts | method | HPAudit: Explicitly declare return types of functions and methods : hp-specs-explicit-return-types : 1 : 38 : issue25.ets | method(): boolean {
return f;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left method AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement_bl... | method(): boolean {
return f;
} | https://gitee.com/openharmony-sig/earth.git | 06ffb6da93a20d034e88ae30a1ad437177655c01 | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/WaterfallDataSet.ets | arkts | setDotsColors | 设置所有高亮点的颜色。
@param color - 要设置的颜色,可以是数字或字符串。 | public setDotsColors(color: number | string): void {
this.mEntries?.dataSource.forEach((value: BarEntry) => {
(value as WaterfallEntry).getHighlights().forEach((highlight: WaterfallHighlight) => {
highlight.setColor(color);
})
})
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDotsColors AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression... | public setDotsColors(color: number | string): void {
this.mEntries?.dataSource.forEach((value: BarEntry) => {
(value as WaterfallEntry).getHighlights().forEach((highlight: WaterfallHighlight) => {
highlight.setColor(color);
})
})
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 0b13309283c9bc8649331a88ea3c4c1bd8c4f924 | gitee |
offlinecat-dev/OCNetORM | src/main/ets/core/EntityMetadata.ets | arkts | getColumnByName | 根据列名获取列元数据
@param columnName 数据库列名
@returns 列元数据,如果不存在返回 null | getColumnByName(columnName: string): ColumnMetadata | null {
for (let i = 0; i < this.columns.length; i++) {
const col = this.columns[i]
if (col.columnName === columnName) {
return col
}
}
return null
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getColumnByName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left columnName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#s... | getColumnByName(columnName: string): ColumnMetadata | null {
for (let i = 0; i < this.columns.length; i++) {
const col = this.columns[i]
if (col.columnName === columnName) {
return col
}
}
return null
} | https://github.com/offlinecat-dev/OCNetORM | 17e43e2462de353914685fd00709a7e7dfbfeed9 | github |
openharmony-sig/qr-code-generator | library/src/main/ets/components/MainPage/qrcodegen.ets | arkts | applyMask | XORs the codeword modules in this QR Code with the given mask pattern.
The function modules must be marked and the codeword bits must be drawn
before masking. Due to the arithmetic of XOR, calling applyMask() with
the same mask value a second time will undo the mask. A final well-formed
QR Code needs exactly one (not z... | private applyMask(mask: int): void {
if (mask < 0 || mask > 7)
throw new Error("Mask value out of range");
for (let y = 0; y < this.size; y++) {
for (let x = 0; x < this.size; x++) {
let invert: boolean;
switch (mask) {
case 0:
invert = (x + y)... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left applyMask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left mask AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#... | private applyMask(mask: int): void {
if (mask < 0 || mask > 7)
throw new Error("Mask value out of range");
for (let y = 0; y < this.size; y++) {
for (let x = 0; x < this.size; x++) {
let invert: boolean;
switch (mask) {
case 0:
invert = (x + y)... | https://gitee.com/openharmony-sig/qr-code-generator.git | 53b0aed367b3b03e725bf36c679db0c6764d262d | gitee |
Delsin-Yu/JustPDF | entry/src/main/ets/components/PageInfo.ets | arkts | markPageChanged | Marks the page at the given global page index as changed.
This is used by PageInfo when it needs to notify the data source of changes.
@param globalPageIndex The global page index | public markPageChanged(globalPageIndex: number): void {
if (globalPageIndex < 0 || globalPageIndex >= this.pages.length) {
return;
}
this.listeners.forEach(listener => listener.onDataChange(globalPageIndex));
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left markPageChanged AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left globalPageIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AS... | public markPageChanged(globalPageIndex: number): void {
if (globalPageIndex < 0 || globalPageIndex >= this.pages.length) {
return;
}
this.listeners.forEach(listener => listener.onDataChange(globalPageIndex));
} | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/components/PageInfo.ets#L1370-L1375 | c707400330d5ad5fbf77f206450d6858e7dfc91f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/SourceUpdateManager.ets | arkts | fetchRemoteIndex | 获取远程索引文件 | private async fetchRemoteIndex(url: string): Promise<SourceRepoIndex | null> {
try {
const httpRequest = http.createHttp();
const response = await httpRequest.request(url, {
method: http.RequestMethod.GET,
header: {
'Content-Type': 'application/json'
},
connec... | 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 fetchRemoteIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left ... | private async fetchRemoteIndex(url: string): Promise<SourceRepoIndex | null> {
try {
const httpRequest = http.createHttp();
const response = await httpRequest.request(url, {
method: http.RequestMethod.GET,
header: {
'Content-Type': 'application/json'
},
connec... | https://github.com/DaLongZhuaZi/manxia | edc3a1728b56cf6ce018218fe8ee68ebd029989e | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/renderer/XAxisRenderer.ets | arkts | drawLabels | draws the x-labels on the specified y-position
@param pos | protected drawLabels(c: CanvasRenderingContext2D, pos: number, anchor: MPPointF, isHorizontalFlip: boolean): void {
if (!this.mXAxis) {
return;
}
let labelRotationAngleDegrees = this.mXAxis.getLabelRotationAngle();
let centeringEnabled = this.mXAxis.isCenterAxisLabelsEnabled();
let position... | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left drawLabels AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left c AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | protected drawLabels(c: CanvasRenderingContext2D, pos: number, anchor: MPPointF, isHorizontalFlip: boolean): void {
if (!this.mXAxis) {
return;
}
let labelRotationAngleDegrees = this.mXAxis.getLabelRotationAngle();
let centeringEnabled = this.mXAxis.isCenterAxisLabelsEnabled();
let position... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | d0a8b37705f770d05d46dba040a63934e0c50f14 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/WeakSet.ets | arkts | constructor | The WeakSet() constructor creates WeakSet objects
@param { Iterable<K> } elements - An iterable object whose elements will be added to the new WeakSet
@syscap SystemCapability.Utils.Lang | constructor(elements: Iterable<K>) {
iteratorForEach<K>(elements.$_iterator(), (elem: K) => {
this.add(elem)
})
} | 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 elements AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identif... | constructor(elements: Iterable<K>) {
iteratorForEach<K>(elements.$_iterator(), (elem: K) => {
this.add(elem)
})
} | https://gitcode.com/iop123123/arkts-static-skills | 96c82aa1845d37951d080f881f27e43714c85cc2 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/InvisibleWebViewComponent.ets | arkts | aboutToDisappear | 组件即将消失 | aboutToDisappear() {
logger.info(TAG, `不可见WebView组件销毁, 源ID: ${this.config.sourceId}`);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToDisappear 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... | aboutToDisappear() {
logger.info(TAG, `不可见WebView组件销毁, 源ID: ${this.config.sourceId}`);
} | https://github.com/DaLongZhuaZi/manxia | db9194218f2918b9247bc198d28d1fcf68fb17d8 | github |
openharmony/arkui_advanced_ui_component | atomicserviceweb/source/atomicserviceweb.ets | arkts | loadAtomicBasicEngine | 初始化加载atomicbasicengine | function loadAtomicBasicEngine(): void {
try {
import('@hms.atomicservicedistribution.atomicbasicengine').then((ns: ESObject) => {
console.log('AtomicServiceWeb loadAtomicBasicEngine success');
atomicBasicEngine = ns;
}).catch((err: BusinessError) => {
console.error('AtomicServiceWeb loadAto... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left loadAtomicBasicEngine 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#prede... | function loadAtomicBasicEngine(): void {
try {
import('@hms.atomicservicedistribution.atomicbasicengine').then((ns: ESObject) => {
console.log('AtomicServiceWeb loadAtomicBasicEngine success');
atomicBasicEngine = ns;
}).catch((err: BusinessError) => {
console.error('AtomicServiceWeb loadAto... | https://gitee.com/openharmony/arkui_advanced_ui_component.git | dcbadd3295153f038fff562e309675a0f1bdd083 | gitee |
YANGZX22/Voot | entry/src/main/ets/workers/NonStreamingAsrWithVadWorker.ets | arkts | createOfflineRecognizerFromRawfile | -------- recognizer init from rawfile -------- | function createOfflineRecognizerFromRawfile(): OfflineRecognizer {
const cfg = new OfflineRecognizerConfig();
// Feature config
cfg.featConfig.sampleRate = 16000;
cfg.featConfig.featureDim = 80;
// Base path inside rawfile/
// Make sure this folder name matches exactly your folder under rawfile/
const b... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left createOfflineRecognizerFromRawfile 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#:#Ri... | function createOfflineRecognizerFromRawfile(): OfflineRecognizer {
const cfg = new OfflineRecognizerConfig();
// Feature config
cfg.featConfig.sampleRate = 16000;
cfg.featConfig.featureDim = 80;
// Base path inside rawfile/
// Make sure this folder name matches exactly your folder under rawfile/
const b... | https://github.com/YANGZX22/Voot | 3d09dcff687d1732f6941ecf9815ae3d98cd1905 | github |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/services/CloudStore.ets | arkts | getStore | 暴露 RDB 实例 (供 DataCrypto 使用) | getStore(): relationalStore.RdbStore | null {
return this.store;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getStore AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#member_expression#Left AST#identifier#Left... | getStore(): relationalStore.RdbStore | null {
return this.store;
} | https://github.com/Mydstiny/RemoteDeskHarmonyOS | c4df46d5a084db3f1bc71b1d4075c74c3cc7446c | github |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/views/pages/TrustLevelPage.ets | arkts | build | ── Build ── | build() {
HdsNavDestination() {
Stack({ alignContent: Alignment.TopStart }) {
// 隐藏 WebView(处理 CF challenge + SSO 重定向 + 加载目标页面)
// 如果需要用户交互验证则显示
Web({ src: this.loadUrl, controller: this.controller })
.width('100%')
.height('100%')
.javaScriptAccess(true... | 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() {
HdsNavDestination() {
Stack({ alignContent: Alignment.TopStart }) {
// 隐藏 WebView(处理 CF challenge + SSO 重定向 + 加载目标页面)
// 如果需要用户交互验证则显示
Web({ src: this.loadUrl, controller: this.controller })
.width('100%')
.height('100%')
.javaScriptAccess(true... | https://github.com/Amaz1ny/HarmonyDO-public | c62e75b02b675fc0c091e8c171e7b3880111e114 | github |
Kira-Yagami-Light/Kira-Projects | TodoTask/entry/src/main/ets/data/database/TaskDao.ets | arkts | queryByCategory | 根据分类查询任务
@param categoryId 分类 ID
@returns Promise<Array<Record<string, any>>> 任务记录数组 | async queryByCategory(categoryId: number): Promise<Array<Record<string, number | string | boolean>>> {
const store = this.dbHelper.getRdbStore();
if (!store) {
Logger.error(this.LOG_TAG, 'RdbStore is null');
return [];
}
try {
const predicates = new relationalStore.RdbPredicates(thi... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left queryByCategory AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left categoryId AST#identifier#Right AST#type_annotation#Left AST#:#... | async queryByCategory(categoryId: number): Promise<Array<Record<string, number | string | boolean>>> {
const store = this.dbHelper.getRdbStore();
if (!store) {
Logger.error(this.LOG_TAG, 'RdbStore is null');
return [];
}
try {
const predicates = new relationalStore.RdbPredicates(thi... | https://github.com/Kira-Yagami-Light/Kira-Projects | 3e682f7d7898eb5356c8293ff2f0409fa69724fb | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/DataView.ets | arkts | getInt16 | === Int16 ===
Read bytes as they represent given type
@param { int } byteOffset zero index to read
@returns { int } return byteOffset's Int16 value
@throws { RangeError } - Input parameter error.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public getInt16(byteOffset: int): int {
return this.getInt16Big(byteOffset)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getInt16 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifie... | public getInt16(byteOffset: int): int {
return this.getInt16Big(byteOffset)
} | https://gitcode.com/iop123123/arkts-static-skills | 296daeeb5c25d4ee2f5eabe2ab207fbd441707dd | gitcode |
codelably/HCompass | entry/src/main/ets/entryability/AppInterceptors.ets | arkts | safeStringify | 安全序列化 | private safeStringify(value: Unknown, pretty: boolean = false): string {
if (value === undefined) {
return "undefined";
}
if (typeof value === "string") {
return value;
}
try {
const result: string | undefined = JSON.stringify(value, null, pretty ? 2 : undefined);
return re... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left safeStringify 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#Lef... | private safeStringify(value: Unknown, pretty: boolean = false): string {
if (value === undefined) {
return "undefined";
}
if (typeof value === "string") {
return value;
}
try {
const result: string | undefined = JSON.stringify(value, null, pretty ? 2 : undefined);
return re... | https://github.com/codelably/HCompass | b1cf5690817f50d6059c06a2e2fc8d6ec721dc55 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/customkey/CustomKeyStore.ets | arkts | getActiveProfileName | 获取当前活跃配置名称 | static async getActiveProfileName(): Promise<string> {
await CustomKeyStore.ensureInit();
return CustomKeyStore.activeProfileName;
} | 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 getActiveProfileName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right... | static async getActiveProfileName(): Promise<string> {
await CustomKeyStore.ensureInit();
return CustomKeyStore.activeProfileName;
} | https://github.com/AlkaidLab/moonlight-harmony | c577425ae816134bdb98c46db06c6dad9bff1904 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/ResponsiveLayout.ets | arkts | getContentPadding | 获取内容区域内边距 | public static getContentPadding(): number {
return ResponsiveLayoutHelper.getLayoutParams().contentPadding;
} | 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 getContentPadding AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A... | public static getContentPadding(): number {
return ResponsiveLayoutHelper.getLayoutParams().contentPadding;
} | https://github.com/DaLongZhuaZi/manxia | 2b4c8b1ecb36a5bf3949bebe37693039365e067e | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ancientimage/ImageRestorationEngine.ets | arkts | calculateImprovement | 计算改善程度 | private calculateImprovement(input: number, output: number): number {
if (input === 0) return 0;
return Math.round(((output - input) / input) * 100);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left calculateImprovement AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif... | private calculateImprovement(input: number, output: number): number {
if (input === 0) return 0;
return Math.round(((output - input) / input) * 100);
} | https://github.com/LJ666-ui/harmony-health-care | eccd750fc11f0ec6a28ba0652f919f6bfe8d1b6e | github |
Cool_foolisher1/ArkTSRepository | GuardianAssistant/entry/src/main/ets/entryability/EntryAbility.ets | arkts | onDestroy | Ability 销毁 | onDestroy(): void {
hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy')
errorManager.off('error', observerId)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onDestroy 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#Le... | onDestroy(): void {
hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy')
errorManager.off('error', observerId)
} | https://gitcode.com/Cool_foolisher1/ArkTSRepository | c289bfe7d1da56791d8248ca94e56212a989dea8 | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.LinkedList.ets | arkts | length | Gets the number of elements in the list. | public get length(): int {
return this.elementNum;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left length AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AS... | public get length(): int {
return this.elementNum;
} | https://gitcode.com/iop123123/arkts-static-skills | 2babc889bf111235cddfd9dedd30f2f40c590aeb | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | slice | Creates a slice of current Int8 with all elements.
@returns a new Int8Array with elements of current Int8Array | public slice(): Int8Array {
return new Int8Array(this)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left slice 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 slice(): Int8Array {
return new Int8Array(this)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 1189e6d69adcea5112588127b78d61d631f0b53f | gitee |
HuolalaTech/sophon_harmony | sophon/src/main/ets/components/window/SophonWindowParam.ets | arkts | constructor | x: 默认在屏幕正中间, y: 默认在屏幕正中间 | constructor(x: number, y: number, width: number, height: number, isExpand: boolean) {
this.ballX = x
this.ballY = y
this.lastBallX = x
this.lastBallY = y
this.windowW = width
this.windowH = height
this.isExpand = isExpand
} | 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 x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#... | constructor(x: number, y: number, width: number, height: number, isExpand: boolean) {
this.ballX = x
this.ballY = y
this.lastBallX = x
this.lastBallY = y
this.windowW = width
this.windowH = height
this.isExpand = isExpand
} | https://github.com/HuolalaTech/sophon_harmony | 02b0d3909b8f03dce828e479f60cf4ad52bc269b | github |
openharmony/applications_contacts | entry/src/main/ets/presenter/favorite/EditFavoriteListPresenter.ets | arkts | cancelEditFavorite | Cancel Editing | cancelEditFavorite() {
AppStorage.SetOrCreate('cancelEditFavorite', 2);
router.back();
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left cancelEditFavorite 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... | cancelEditFavorite() {
AppStorage.SetOrCreate('cancelEditFavorite', 2);
router.back();
} | https://gitee.com/openharmony/applications_contacts.git | 65f3b269c22e309646e6db944c21ed2ff211dac1 | gitee |
openharmony/codelabs | ETSUI/MediaReview/entry/src/main/ets/utils/RdbUtil.ets | arkts | openStore | 打开数据库并确保表结构存在 | private static async openStore(context: Context): Promise<relationalStore.RdbStore | null> {
try {
const config: relationalStore.StoreConfig = {
name: RdbUtil.DB_NAME,
securityLevel: relationalStore.SecurityLevel.S1
}
const store: relationalStore.RdbStore = await relationalStore.... | 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 openStore AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left conte... | private static async openStore(context: Context): Promise<relationalStore.RdbStore | null> {
try {
const config: relationalStore.StoreConfig = {
name: RdbUtil.DB_NAME,
securityLevel: relationalStore.SecurityLevel.S1
}
const store: relationalStore.RdbStore = await relationalStore.... | https://gitcode.com/openharmony/codelabs | 40e8f1dc5bf477a18c0cbbd04f34a58e6be4263f | gitcode |
openharmony/codelabs | Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets | arkts | onFixedRatioChange | Fix ratio canvas refresh.
@param ratio | onFixedRatioChange(ratio: CropRatioType): void {
Logger.debug(TAG, `onFixedRatioChange: ratio[${ratio}]`);
if (this.isWaitingRefresh) {
this.clearDelayRefresh();
this.cropShow.enlargeCropArea();
}
this.cropRatio = ratio;
this.cropShow.setRatio(ratio);
this.endImageDrag();
this.... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onFixedRatioChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ratio AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CropRatioType AST#identifier#Right A... | onFixedRatioChange(ratio: CropRatioType): void {
Logger.debug(TAG, `onFixedRatioChange: ratio[${ratio}]`);
if (this.isWaitingRefresh) {
this.clearDelayRefresh();
this.cropShow.enlargeCropArea();
}
this.cropRatio = ratio;
this.cropShow.setRatio(ratio);
this.endImageDrag();
this.... | https://gitee.com/openharmony/codelabs.git | e7e6cc046117245e049d1e1b8d5bc4cd718e9271 | gitee |
2763981847/Clock-Alarm | entry/src/main/ets/pages/StopwatchPage.ets | arkts | reset | 重置计时器和标记点 | reset() {
this.state = 0;
this.flags = [];
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left reset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST#a... | reset() {
this.state = 0;
this.flags = [];
} | https://github.com/2763981847/Clock-Alarm | cc68dfa4b554b3837558fde48dfa608e30a2be34 | github |
niuhuan/daisy-ohos | entry/src/main/ets/pages/components/MangaCard.ets | arkts | timestampToDate | 方法一:使用JavaScript内置的Date对象进行时间戳转日期的实现 | function timestampToDate(timestamp: number) {
let date = new Date(timestamp * 1000);
let year = date.getFullYear();
let month = date.getMonth() + 1; // 月份从0开始,需要加1
let day = date.getDate();
let hours = date.getHours();
let minutes = date.getMinutes();
let seconds = date.getSeconds();
return `${year}-${m... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left timestampToDate AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left timestamp AST#identifier#Right AST#type_annotation#Left AST#:#Left : A... | function timestampToDate(timestamp: number) {
let date = new Date(timestamp * 1000);
let year = date.getFullYear();
let month = date.getMonth() + 1; // 月份从0开始,需要加1
let day = date.getDate();
let hours = date.getHours();
let minutes = date.getMinutes();
let seconds = date.getSeconds();
return `${year}-${m... | https://github.com/niuhuan/daisy-ohos | 782f15ae28b373a31c47523b2e7d99389710e0a9 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Adapters/UnifiedContentAdapter.ets | arkts | getOriginalEBook | 从统一内容获取原始电子书数据 | static getOriginalEBook(unifiedContent: UnifiedContent): EBook | null {
if (unifiedContent.originalType !== UnifiedContentType.EBOOK) {
logger.warn(TAG, '尝试从非电子书内容获取电子书数据');
return null;
}
return unifiedContent.originalData as EBook;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getOriginalEBook AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left unifiedContent AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident... | static getOriginalEBook(unifiedContent: UnifiedContent): EBook | null {
if (unifiedContent.originalType !== UnifiedContentType.EBOOK) {
logger.warn(TAG, '尝试从非电子书内容获取电子书数据');
return null;
}
return unifiedContent.originalData as EBook;
} | https://github.com/DaLongZhuaZi/manxia | b496146ad481822220addaf80c8acbbe4e667514 | github |
encorexin/WordPressCMS | harmonyos/entry/src/main/ets/services/http/RetryService.ets | arkts | isRetryableError | 检查错误是否可重试 | function isRetryableError(error: Error | string | null, retryableErrors: string[]): boolean {
if (error === null || error === undefined) {
return false
}
const errorString = typeof error === 'string' ? error.toLowerCase() : error.message.toLowerCase()
for (let i = 0; i < retryableErrors.length; i++) {
i... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left isRetryableError AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left error AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | function isRetryableError(error: Error | string | null, retryableErrors: string[]): boolean {
if (error === null || error === undefined) {
return false
}
const errorString = typeof error === 'string' ? error.toLowerCase() : error.message.toLowerCase()
for (let i = 0; i < retryableErrors.length; i++) {
i... | https://github.com/encorexin/WordPressCMS | f87b1b7b41b99a05d69358ea4f9dc8a268d7a142 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.