nwo stringclasses 449
values | path stringlengths 9 173 | language stringclasses 1
value | identifier stringlengths 1 53 | docstring stringlengths 5 4.13k | function stringlengths 10 87.2k | ast_function stringlengths 351 354k | obf_function stringlengths 10 87.2k | url stringlengths 30 175 | function_sha stringlengths 40 40 | source stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | enableBluetooth | Open bluetooth | public enableBluetooth() {
//TODO
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left enableBluetooth 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 enableBluetooth() {
//TODO
} | https://gitee.com/openharmony-sig/FastBle.git | 24dd44f95211b75564bd543769a587a2c5773ecc | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ArrayBuffer.ets | arkts | fromObject | Creates a new ArrayBuffer from an object.
@param { Object } obj Source object (string or ArrayBuffer).
@param { int | string } byteOffsetOrEncoding Byte offset or encoding string.
@param { int } length Length to copy.
@returns { ArrayBuffer } The new ArrayBuffer.
@throws { Error } Throws if arguments are incorrect.
@st... | public static fromObject(obj: Object, byteOffsetOrEncoding: int | string, length: int): ArrayBuffer {
if (obj instanceof string) {
const resolvedEncoding: string = byteOffsetOrEncoding instanceof string ? byteOffsetOrEncoding as string : "utf8";
const resolvedbyteOffset: int = byteOf... | 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 fromObject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#... | public static fromObject(obj: Object, byteOffsetOrEncoding: int | string, length: int): ArrayBuffer {
if (obj instanceof string) {
const resolvedEncoding: string = byteOffsetOrEncoding instanceof string ? byteOffsetOrEncoding as string : "utf8";
const resolvedbyteOffset: int = byteOf... | https://gitcode.com/iop123123/arkts-static-skills | 787c2e32e233dd64612441857ad00d68725b7995 | gitcode |
openharmony-sig/applications_clock | common/src/main/ets/manager/BreakpointManager.ets | arkts | getScreen | Do not modify the folding method | private getScreen() {
let callback: Callback<display.FoldStatus> = (data: display.FoldStatus) => {
const getfoldAbleScreen = display.getFoldStatus();
this.foldAbleScreen = getfoldAbleScreen
AppStorage.SetOrCreate<number>('currentAbleScreen', this.foldAbleScreen);
};
try {
display.o... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getScreen AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { ... | private getScreen() {
let callback: Callback<display.FoldStatus> = (data: display.FoldStatus) => {
const getfoldAbleScreen = display.getFoldStatus();
this.foldAbleScreen = getfoldAbleScreen
AppStorage.SetOrCreate<number>('currentAbleScreen', this.foldAbleScreen);
};
try {
display.o... | https://gitee.com/openharmony-sig/applications_clock.git | ce1f24a76bb19b91aebb10a3cfbee1115492f193 | gitee |
offlinecat-dev/OCNetORM | src/main/ets/query/AggregateResult.ets | arkts | toObject | 转换为普通对象
@returns 键值对对象 | toObject(): Record<string, ValueType> {
const obj: Record<string, ValueType> = {}
this.data.forEach((value, key) => {
obj[key] = value
})
return obj
} | AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left toObject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left :... | toObject(): Record<string, ValueType> {
const obj: Record<string, ValueType> = {}
this.data.forEach((value, key) => {
obj[key] = value
})
return obj
} | https://github.com/offlinecat-dev/OCNetORM | 82a9ff057e849a6e2330ab6d90feeb6f25200709 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/ModelCapabilityMatcher.ets | arkts | selectBestLogoProvider | 为 family 选择最佳的 logo 供应商
优先级:供应商 key 与 family 精确匹配 > 包含关系 > 专注度最高的原厂 > fallback | private selectBestLogoProvider(
family: string,
providers: string[],
providerFamilies: Map<string, Set<string>>
): string {
const familyLower = family.toLowerCase()
// 1. 精确匹配:供应商 key == family(如 family=deepseek, provider=deepseek)
for (let i = 0; i < providers.length; i++) {
if (prov... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left selectBestLogoProvider AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left family AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#iden... | private selectBestLogoProvider(
family: string,
providers: string[],
providerFamilies: Map<string, Set<string>>
): string {
const familyLower = family.toLowerCase()
// 1. 精确匹配:供应商 key == family(如 family=deepseek, provider=deepseek)
for (let i = 0; i < providers.length; i++) {
if (prov... | https://github.com/LongLiveY96/chatcube | 8043715cbba81bc44f35412f340bdd5bbacbcbe2 | github |
HarmonyCandies/image_cropper | image_cropper/src/main/ets/model/Geometry.ets | arkts | negate | Unary negation operator | negate(): Offset {
return new Offset(-this.dx, -this.dy);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left negate 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 Offset AST#identifier#Right AST#ERROR#Right AST#stateme... | negate(): Offset {
return new Offset(-this.dx, -this.dy);
} | https://github.com/HarmonyCandies/image_cropper/blob/dd3664946b413166307b736a5763f998084364e1/image_cropper/src/main/ets/model/Geometry.ets#L113-L115 | 10b68afa068ead010984af1df08577e662e438a2 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Class.ets | arkts | getStaticMethod | Look up a static method among the methods declared in the class.
@param { string } name The method name to search for.
@param { FixedArray<Class> | undefined } [ signature ] Array of parameter classes defining the method signature.
@returns { reflect.StaticMethod | undefined } the found static method, or undefined if n... | public getStaticMethod(name: string, signature?: FixedArray<Class>): reflect.StaticMethod | undefined {
let methods = this.getStaticMethods()
if (methods.length == 0) {
return undefined
}
if (signature == undefined) {
return Class.findStaticMethodByNameUncheck... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getStaticMethod AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | public getStaticMethod(name: string, signature?: FixedArray<Class>): reflect.StaticMethod | undefined {
let methods = this.getStaticMethods()
if (methods.length == 0) {
return undefined
}
if (signature == undefined) {
return Class.findStaticMethodByNameUncheck... | https://gitcode.com/iop123123/arkts-static-skills | cec7ac2fcc5e19c339118d5504fb8a0dd250e0ad | gitcode |
openharmony/codelabs | Media/VideoPlayer/entry/src/main/ets/controller/VideoController.ets | arkts | initProgress | Initialization progress bar.
@param time Current video playback time. | initProgress(time: number) {
let nowSeconds = Math.floor(time / CommonConstants.A_THOUSAND);
let totalSeconds = Math.floor(this.duration / CommonConstants.A_THOUSAND);
this.playerModel.currentTime = DateFormatUtil.secondToTime(nowSeconds);
this.playerModel.totalTime = DateFormatUtil.secondToTime(total... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initProgress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left time AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right ... | initProgress(time: number) {
let nowSeconds = Math.floor(time / CommonConstants.A_THOUSAND);
let totalSeconds = Math.floor(this.duration / CommonConstants.A_THOUSAND);
this.playerModel.currentTime = DateFormatUtil.secondToTime(nowSeconds);
this.playerModel.totalTime = DateFormatUtil.secondToTime(total... | https://gitee.com/openharmony/codelabs.git | 9181f9975fb128d0144654f62f774dac96b01a23 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/MessageHandler.ets | arkts | sendEmptyMessage | Send an empty message with a specific identifier
@param { int } what The message identifier
@returns { boolean } True if the message was successfully sent, false otherwise | public sendEmptyMessage(what: int): boolean {
return this.sendMessage(new concurrency.Message(what, this));
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left sendEmptyMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left what AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identif... | public sendEmptyMessage(what: int): boolean {
return this.sendMessage(new concurrency.Message(what, this));
} | https://gitcode.com/iop123123/arkts-static-skills | d31e6cb7d51352be0d51582140c8c61fe37c32a5 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/SyncPrimitives.ets | arkts | wait | Blocks current coroutine until another coroutine will fire the same event.
It can be used concurrently with other wait/fire.
It has no effect in case fire has already been caused, but guarantees happens-before. | public wait(): void {
Event.wait(this);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left wait AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Righ... | public wait(): void {
Event.wait(this);
} | https://gitcode.com/iop123123/arkts-static-skills | d69783bc59631913bddb0ffe71503bc0d44f106e | gitcode |
RedRackham-R/WanAndroidHarmoney | entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets | arkts | subscribLoginOutEvent | 订阅登出事件 | subscribLoginOutEvent(key: string, callback: (eventData: emitter.EventData) => void) {
EventBus.getInstance().regist(WanEventId.EVENT_LOGIN_OUT, key, callback);
} | AST#program#Left AST#ERROR#Left AST#identifier#Left subscribLoginOutEvent AST#identifier#Right 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#,#Right AST#call_expression#Left A... | subscribLoginOutEvent(key: string, callback: (eventData: emitter.EventData) => void) {
EventBus.getInstance().regist(WanEventId.EVENT_LOGIN_OUT, key, callback);
} | https://github.com/RedRackham-R/WanAndroidHarmoney | dfc933d6e250c824100d4686a642da05fc235291 | github |
Vincent-Leon/zotero-harmony | entry/src/main/ets/components/PdfView.ets | arkts | colorForIndex | Maps a Pick-a-colour menu index to Zotero's standard hex value. Mirrors
the swatch row in viewer.html — keep them in sync. | function colorForIndex(index?: number): string | undefined {
if (index === undefined) return undefined;
if (index === 0) return '#ffd400'; // yellow
if (index === 1) return '#ff6666'; // red
if (index === 2) return '#5fb236'; // green
if (index === 3) return '#2ea8e5'; // blue
if (index === 4) return '#a28a... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left colorForIndex AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#optional_parameter#Left AST#identifier#Left index AST#identifier#Right AST#?#Left ? AST#?#Right AST#type_annotation#... | function colorForIndex(index?: number): string | undefined {
if (index === undefined) return undefined;
if (index === 0) return '#ffd400'; // yellow
if (index === 1) return '#ff6666'; // red
if (index === 2) return '#5fb236'; // green
if (index === 3) return '#2ea8e5'; // blue
if (index === 4) return '#a28a... | https://github.com/Vincent-Leon/zotero-harmony | 143966b98506cdc967322450ccaca79b4b53ba3c | github |
openharmony/applications_mms | entry/src/main/ets/utils/MmsPreferences.ets | arkts | setValueToMap | Set key-value to map
@param key
@param value | public setValueToMap(key: string, value: string | number | boolean): void {
MmsPreferences.sMap.set(key, value);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setValueToMap 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 str... | public setValueToMap(key: string, value: string | number | boolean): void {
MmsPreferences.sMap.set(key, value);
} | https://gitee.com/openharmony/applications_mms.git | 84c3d621a357750971c2dda32a7b1b057c972acf | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | slice | Creates a slice of current BigInt64 with all elements.
@returns a new BigInt64Array with elements of current BigInt64Array | public slice(): BigInt64Array {
return new BigInt64Array(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(): BigInt64Array {
return new BigInt64Array(this)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | fdde5bff06f8463aa7bb7ae4352b1c3590b8378a | gitee |
HarmonyCandies/image_cropper | image_cropper/src/main/ets/common/ImageCropperController.ets | arkts | rotateDegrees | / Retrieves the current rotation angle of the image.
/ Defaults to 0 if no rotation has been applied. | get rotateDegrees(): number {
return this.getActionDetails().rotateDegrees ?? 0;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left rotateDegrees AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Rig... | get rotateDegrees(): number {
return this.getActionDetails().rotateDegrees ?? 0;
} | https://github.com/HarmonyCandies/image_cropper/blob/dd3664946b413166307b736a5763f998084364e1/image_cropper/src/main/ets/common/ImageCropperController.ets#L42-L44 | 645f557152fa7a02c0d8d67c85487626280b61b5 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Plugin/HSPPluginManager.ets | arkts | processUpdateQueue | 处理更新队列 | private async processUpdateQueue(): Promise<void> {
if (this.isUpdating || this.updateQueue.length === 0) {
return;
}
this.isUpdating = true;
try {
while (this.updateQueue.length > 0) {
const updateInfo = this.updateQueue.shift();
if (updateInfo) {
await... | 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 processUpdateQueue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | private async processUpdateQueue(): Promise<void> {
if (this.isUpdating || this.updateQueue.length === 0) {
return;
}
this.isUpdating = true;
try {
while (this.updateQueue.length > 0) {
const updateInfo = this.updateQueue.shift();
if (updateInfo) {
await... | https://github.com/DaLongZhuaZi/manxia | 4bfdfcadf65c0f3316652e91a763774e36f834e9 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentHashMap.ets | arkts | has | Checks if a key is in the ConcurrentHashMap
@param { K } key the key to find in the ConcurrentHashMap
@returns { boolean } true if the value is in the ConcurrentHashMap | public override has(key: K): boolean {
const buck = this.getBucket(key);
if (buck !== undefined) {
const buckSize = buck.length;
ConcurrencyHelpers.mutexLock(this.bucketsMutex);
const buckIndex = this.getBucketIndex(key);
Co... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left override AST#identifier#Right AST#identifier#Left has AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right ... | public override has(key: K): boolean {
const buck = this.getBucket(key);
if (buck !== undefined) {
const buckSize = buck.length;
ConcurrencyHelpers.mutexLock(this.bucketsMutex);
const buckIndex = this.getBucketIndex(key);
Co... | https://gitcode.com/iop123123/arkts-static-skills | 2d3701154fd202aeb7283d182438d77d22cba582 | gitcode |
openharmony-sig/applications_calculator | common/src/main/ets/util/RdbHelper.ets | arkts | isTableFull | judge table is full for max count | async isTableFull(): Promise<boolean> {
await this.getRdbStore();
if (this.rdbStore === null) {
LogUtil.error(TAG, 'rdbStore is null, isTableFull fail.');
return false;
}
try {
let resultSet: relationalStore.ResultSet = await this.rdbStore.querySql(DB.queryCount);
resultSet.goT... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left isTableFull AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_... | async isTableFull(): Promise<boolean> {
await this.getRdbStore();
if (this.rdbStore === null) {
LogUtil.error(TAG, 'rdbStore is null, isTableFull fail.');
return false;
}
try {
let resultSet: relationalStore.ResultSet = await this.rdbStore.querySql(DB.queryCount);
resultSet.goT... | https://gitee.com/openharmony-sig/applications_calculator.git | 88909425df08acb7f3af403c7d19a026ab347bf4 | gitee |
zmuxuny/ai-guardian-star | entry/src/main/ets/common/CloudService.ets | arkts | sendVerificationCode | 发送验证码到手机或邮箱 | async sendVerificationCode(target: string, type: string, username: string): Promise<CloudResult> {
const body: SendCodeRequest = { target: target, type: type, username: username };
return postJson('/api/sendCode', body);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left sendVerificationCode AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left target AST#identifier#Right AST#type_annotation#Left AST#:... | async sendVerificationCode(target: string, type: string, username: string): Promise<CloudResult> {
const body: SendCodeRequest = { target: target, type: type, username: username };
return postJson('/api/sendCode', body);
} | https://github.com/zmuxuny/ai-guardian-star/blob/87ab023d8b9aab4303a9fc1e97508e1f8ee01e07/entry/src/main/ets/common/CloudService.ets#L133-L136 | b0c770b33ba2e03d7fb7f71d60baba439affdde5 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/RDPPerformanceManager.ets | arkts | addFrame | 添加帧到缓存 | addFrame(frame: FrameCacheItem): void {
// 检查缓存大小
if (this.currentCacheSize + frame.data.byteLength > this.maxCacheSize) {
this.evictOldFrames()
}
this.cache.set(frame.id, frame)
this.currentCacheSize += frame.data.byteLength
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addFrame AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left frame AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left FrameCacheItem AST#identifier#Right AST#)#Left... | addFrame(frame: FrameCacheItem): void {
// 检查缓存大小
if (this.currentCacheSize + frame.data.byteLength > this.maxCacheSize) {
this.evictOldFrames()
}
this.cache.set(frame.id, frame)
this.currentCacheSize += frame.data.byteLength
} | https://github.com/AetheriumSimulator/qemu-hmos | 1c819c111dd7f4ce39cc942f3974236812331254 | github |
Countly/countly-sdk-hos | library/src/main/ets/internal/ModuleBase.ets | arkts | rejectIfHalted | Standard guard used at the top of every user-facing module mutator. If
the instance is halted, logs a single WARNING line ("[ModuleX] methodY
called after halt, ignored") so the integrator sees why their call did
nothing, and returns true so the caller can early-return.
Pattern:
if (this.rejectIfHalted('ModuleEvents', ... | protected rejectIfHalted(moduleTag: string, methodName: string): boolean {
if (this.config.halted) {
this.config.logger.w(`[${moduleTag}] ${methodName} called after halt, ignored`);
return true;
}
return false;
} | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left rejectIfHalted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left moduleTag AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string ... | protected rejectIfHalted(moduleTag: string, methodName: string): boolean {
if (this.config.halted) {
this.config.logger.w(`[${moduleTag}] ${methodName} called after halt, ignored`);
return true;
}
return false;
} | https://github.com/Countly/countly-sdk-hos | 92181ff1cedb724dba10148cd5a4a96b3357ddad | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/UrlUtils.ets | arkts | isValidUrl | 验证URL格式
@param url URL地址
@returns 是否有效 | public static isValidUrl(urlPath: string): boolean {
try {
const urlObj: url.URL = url.URL.parseURL(urlPath);
return urlObj.protocol === 'http:' || urlObj.protocol === 'https:';
} catch {
return false;
}
} | 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 isValidUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left urlPath AST#identifier#Right AST#ERROR#Left AST#:#Left : AS... | public static isValidUrl(urlPath: string): boolean {
try {
const urlObj: url.URL = url.URL.parseURL(urlPath);
return urlObj.protocol === 'http:' || urlObj.protocol === 'https:';
} catch {
return false;
}
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/UrlUtils.ets#L36-L43 | 9912c83766c597e594c4b5c8d44091ae17eec31e | github |
CPF-ApplicationTPC/imageknifepro | library/src/main/ets/ImageKnife.ets | arkts | setCacheLimit | 设置文件或者内存缓存的使用上限
该接口只设置默认文件缓存,内存缓存上限
内存缓存的最大上限为1024*1024*1024(字节),4096(图片张数),超过该范围应用最大上限值
大端文件缓存的最大上限为512*1024*1024(字节),4096(图片张数),超过该范围应用最大上限值
小端文件文件缓存的最大上限为256*1024*1024(字节), 2048(图片张数), 超过该范围应用最大上限值
@param cacheStrategy 指定需要设置的类型。CacheStrategy::FILE为设置文件缓存,其余枚举为设置内存缓存
@param maxSize 缓存的最大图片张数
@param maxUsage 最大的缓存使用量... | setCacheLimit(strategy: CacheStrategy, maxSize: number, maxUsage: number, cacheName?:string) {
nativeNode.setCacheLimit(strategy, maxSize, maxUsage, cacheName);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setCacheLimit AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left strategy AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CacheStrategy AST#ident... | setCacheLimit(strategy: CacheStrategy, maxSize: number, maxUsage: number, cacheName?:string) {
nativeNode.setCacheLimit(strategy, maxSize, maxUsage, cacheName);
} | https://gitcode.com/CPF-ApplicationTPC/imageknifepro/blob/5b2c39b2925d2e6c4a267ce62edc340b3150dcb9/library/src/main/ets/ImageKnife.ets#L282-L284 | 2f801b5e18eb396cfe6c412da3391d0b92145ca9 | gitcode |
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/OrderRepository.ets | arkts | updateOrder | 更新订单信息
@param params 更新参数
@returns 更新结果 | async updateOrder(params: Unknown): Promise<NetworkResponse<Unknown>> {
return this.networkDataSource.updateOrder(params);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateOrder AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : A... | async updateOrder(params: Unknown): Promise<NetworkResponse<Unknown>> {
return this.networkDataSource.updateOrder(params);
} | https://github.com/Joker-x-dev/CoolMallArkTS | ecd9d612e4939bf21b062c7eb29d540e9edba0b3 | github |
openharmony/applications_calendar_data | dataprovider/src/main/ets/DataShareAbilityAuthenticateProxy.ets | arkts | verifyByUri | Verify corresponding to permissions
@Param uri indicates user's input uri
@Param dataParameter indicates database operation information to be performed
@Param highPermission indicates high-level permission to be verified
@Param lowPermission indicates low-level permission to be verified | async function verifyByUri(uri: string, dataParameter: DataParameter, highPermission: Permissions,
lowPermission: Permissions, permission: Permissions, callback: Function): Promise<number> {
let bundleNameAndTokenIdFromUri: BundleNameAndTokenIdFromUri = getBundleNameAndTokenIDByUri(uri);
... | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left verifyByUri AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left uri AST#identifier#Right AST#type_ann... | async function verifyByUri(uri: string, dataParameter: DataParameter, highPermission: Permissions,
lowPermission: Permissions, permission: Permissions, callback: Function): Promise<number> {
let bundleNameAndTokenIdFromUri: BundleNameAndTokenIdFromUri = getBundleNameAndTokenIDByUri(uri);
... | https://gitee.com/openharmony/applications_calendar_data.git | f19e42376b283a1fba92c70f37e5c3aa4a0fa1db | gitee |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.collections.ets | arkts | has | Check if bit vector contains a particular bit element.
@param { int } element - Element to be contained (0 means 0, else means 1).
@param { int } fromIndex - The starting position of the index, containing the value at that index position.
@param { int } toIndex - The end of the index, containing the value at that index... | public has(element: int, fromIndex: int, toIndex: int): boolean {
this.checkRange(fromIndex, toIndex);
let fromElem = this.computeElementIdAndBitId(fromIndex);
let toElem = this.computeElementIdAndBitId(toIndex);
if (fromElem.elementId === toElem.elementId) {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left has AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left element AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#id... | public has(element: int, fromIndex: int, toIndex: int): boolean {
this.checkRange(fromIndex, toIndex);
let fromElem = this.computeElementIdAndBitId(fromIndex);
let toElem = this.computeElementIdAndBitId(toIndex);
if (fromElem.elementId === toElem.elementId) {
... | https://gitcode.com/iop123123/arkts-static-skills | 704c09a51c4e4cfbb596a24af84a621b8d37b21b | gitcode |
openharmony-sig/online_event | solution_student_challenge/基于OpenHarmony的家庭医生终端系统_韩乐/OpenHarmony_APP/Doctor/entry/src/main/ets/MainAbility/pages/index.ets | arkts | Send_Image | dataability:///media/image/3 | function Send_Image()
{
send_once("a6/"+IMG_URL);
AlertDialog.show({
message: "a6/"+IMG_URL,
})
let file1 = { filename: "test", name: "test", uri: IMG_URL, type: "jpg" };
let data = { };
let header = { };
let uploadTask;
request.upload({ url: 'http://43.142.133.176:998/wwwroot', header: header, meth... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left Send_Image AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_state... | function Send_Image()
{
send_once("a6/"+IMG_URL);
AlertDialog.show({
message: "a6/"+IMG_URL,
})
let file1 = { filename: "test", name: "test", uri: IMG_URL, type: "jpg" };
let data = { };
let header = { };
let uploadTask;
request.upload({ url: 'http://43.142.133.176:998/wwwroot', header: header, meth... | https://gitee.com/openharmony-sig/online_event.git | 5d01f8ecf6802d33b9d054d7d54bdce4f2af23d8 | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/Rect.ets | arkts | contains | Returns true if (x,y) is inside the rectangle. The left and top are
considered to be inside, while the right and bottom are not. This means
that for a x,y to be contained: left <= x < right and top <= y < bottom.
An empty rectangle never contains any point.
@param x The X coordinate of the point being tested for contai... | public contains(x: number, y: number): boolean {
return this.left < this.right && this.top < this.bottom // check for empty first
&& x >= this.left && x < this.right && y >= this.top && y < this.bottom;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left contains 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... | public contains(x: number, y: number): boolean {
return this.left < this.right && this.top < this.bottom // check for empty first
&& x >= this.left && x < this.right && y >= this.top && y < this.bottom;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 4d565aa99ce3d5ee98ce358b648675fe400b5d31 | gitee |
LZZLHY/hlib | entry/src/main/ets/viewmodel/DownloadVM.ets | arkts | openFile | ─── 文件打开 / 分享 ───────────────────────────────
用能处理该文件类型的应用打开(阅读器 / 编辑器)。
使用 ohos.want.action.viewData,系统仅展示注册了对应 MIME 类型的应用。 | static async openFile(item: DownloadHistoryItem, ctx: common.UIAbilityContext): Promise<void> {
const exists: boolean = await DownloadVM.fileExists(item.filePath);
if (!exists) {
throw new Error(I18n.ts('downloads_file_missing'));
}
const uri: string = fileUri.getUriFromPath(item.filePath);
... | 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 openFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left item AST#identifier#Right AST#:#Left : AST#:#Ri... | static async openFile(item: DownloadHistoryItem, ctx: common.UIAbilityContext): Promise<void> {
const exists: boolean = await DownloadVM.fileExists(item.filePath);
if (!exists) {
throw new Error(I18n.ts('downloads_file_missing'));
}
const uri: string = fileUri.getUriFromPath(item.filePath);
... | https://github.com/LZZLHY/hlib | 72193165df68d7568606b25965bed8bbf473ac5c | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/viewmodel/GoodsCategoryViewModel.ets | arkts | showFilters | 显示筛选面板
@returns {void} 无返回值 | showFilters(): void {
if (this.categoryDataLoaded) {
return;
}
this.loadGoodsCategory();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showFilters 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#Lef... | showFilters(): void {
if (this.categoryDataLoaded) {
return;
}
this.loadGoodsCategory();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 6f5b321c1703eb6dc2089e58ee44672bf7bb0cc9 | github |
honjow/Next2V | shared/src/main/ets/settings/CacheSettings.ets | arkts | nodeDetailRowKey | Node names are case-insensitive on V2EX; normalize so 'Go'/'go' share one cache row. | private static nodeDetailRowKey(nodeName: string): string {
return KEY_PREFIX_NODE_DETAIL + (nodeName || '').trim().toLowerCase()
} | 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 nodeDetailRowKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left nodeName AST#identifier#Right AST#ERROR#Left AST#:... | private static nodeDetailRowKey(nodeName: string): string {
return KEY_PREFIX_NODE_DETAIL + (nodeName || '').trim().toLowerCase()
} | https://github.com/honjow/Next2V | d14d78152dab6f378c71c832a491843bad53d188 | github |
HarmonyOS_Samples/sample_in_harmonyos | common/src/main/ets/storagemanager/rdb/TrackTable.ets | arkts | queryAll | query all service data from rdb.
@param callback | public async queryAll(): Promise<TrackServiceData[]> {
const trackServiceDataArray: TrackServiceData[] = [];
const resArray = await this.trackTable.query() as Array<relationalStore.ValuesBucket>;
resArray.forEach((item: relationalStore.ValuesBucket) => {
trackServiceDataArray.push(this.sealData(item... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left queryAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left ... | public async queryAll(): Promise<TrackServiceData[]> {
const trackServiceDataArray: TrackServiceData[] = [];
const resArray = await this.trackTable.query() as Array<relationalStore.ValuesBucket>;
resArray.forEach((item: relationalStore.ValuesBucket) => {
trackServiceDataArray.push(this.sealData(item... | https://gitcode.com/HarmonyOS_Samples/sample_in_harmonyos | 3c5fc005c927e6f63e37adcca8f7f6df7dad7c13 | gitcode |
HarmonyOS_Codelabs/arkts-basic-syntax-demo | entry/src/main/ets/pages/BasicPage.ets | arkts | makeMilkTeaWithoutReturnType | 推断函数返回类型为字符串 | function makeMilkTeaWithoutReturnType(flavor: string, sweetness: string) {
return `A cup of ${flavor} milk tea with ${sweetness}`;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left makeMilkTeaWithoutReturnType AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left flavor AST#identifier#Right AST#type_annotation#Left AST#... | function makeMilkTeaWithoutReturnType(flavor: string, sweetness: string) {
return `A cup of ${flavor} milk tea with ${sweetness}`;
} | https://gitcode.com/HarmonyOS_Codelabs/arkts-basic-syntax-demo | 0e6d8f9f1aaeef73d664ff5a6812bdca2cfb6b64 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Date.ets | arkts | toLocaleString | Gets a string with a language-sensitive representation of this date.
@returns a language-sensitive representation of this date. | public toLocaleString(): String {
return Date.getLocaleString("%Ex %EX", "", this.ms, false);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toLocaleString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left String ... | public toLocaleString(): String {
return Date.getLocaleString("%Ex %EX", "", this.ms, false);
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 1808e9fbda76fcb5f8ba5a32f833d43dc5c51581 | gitee |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test31_original_index.ets | arkts | testFinallyBasic | --- Finally block behavior --- | function testFinallyBasic(): string {
let result: string = 'A';
try {
result = result + 'B';
} finally {
result = result + 'C';
}
return result;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testFinallyBasic 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... | function testFinallyBasic(): string {
let result: string = 'A';
try {
result = result + 'B';
} finally {
result = result + 'C';
}
return result;
} | https://github.com/miaochiahao/ark-ghidra | 5e3e957f3e806f7cb7e9ceb7031bcc7fec4c703a | github |
openharmony/vendor_unionman | unionpi_tiger/sample_api10/app/metartc_app/entry/src/main/ets/module/db.ets | arkts | getPreferencesFromStorage | 创建用户首选项实例preference | async getPreferencesFromStorage() {
try {
preference = await dataPreferences.getPreferences(context, 'setting.db');
} catch (err) {
console.error('[PreferenceModel]', `Failed to get preferences, Cause: ${err}`);
}
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getPreferencesFromStorage 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#{#L... | async getPreferencesFromStorage() {
try {
preference = await dataPreferences.getPreferences(context, 'setting.db');
} catch (err) {
console.error('[PreferenceModel]', `Failed to get preferences, Cause: ${err}`);
}
} | https://gitee.com/openharmony/vendor_unionman.git | 0aa27dc90ed42b45baa942d281bcd38e87972ad2 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Scraper/BangumiScraper.ets | arkts | searchGame | 按类型搜索游戏 | public async searchGame(keyword: string, limit: number = 25): Promise<ScraperSearchResult> {
return this.search(keyword, BangumiSubjectType.GAME, limit);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left searchGame AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left : AST... | public async searchGame(keyword: string, limit: number = 25): Promise<ScraperSearchResult> {
return this.search(keyword, BangumiSubjectType.GAME, limit);
} | https://github.com/DaLongZhuaZi/manxia | 6eafceb894d244e29446cd7d31b34cd734ed0273 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Adapters/UnifiedContentAdapter.ets | arkts | toUnifiedContent | 将电子书数据转换为统一内容模型 | static toUnifiedContent(
ebook: EBook,
isFavorite: boolean = false
): UnifiedContent {
const chapters = ebook.chapters || [];
const currentChapterIndex = ebook.readingProgress?.currentChapterIndex || 0;
const unifiedChapters = chapters.map((chapter, index) =>
EBookAdapter.toUnifiedChapter... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left toUnifiedContent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ebook AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | static toUnifiedContent(
ebook: EBook,
isFavorite: boolean = false
): UnifiedContent {
const chapters = ebook.chapters || [];
const currentChapterIndex = ebook.readingProgress?.currentChapterIndex || 0;
const unifiedChapters = chapters.map((chapter, index) =>
EBookAdapter.toUnifiedChapter... | https://github.com/DaLongZhuaZi/manxia | d11b057efa0acd23f8abb5efe1ee5ee3b14a52e6 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/DataSet.ets | arkts | constructor | Creates a new DataSet object with the given values (entries) it represents. Also, a
label that describes the DataSet can be specified. The label can also be
used to retrieve the DataSet from a ChartData object.
@param entries
@param label | constructor(entries: JArrayList<T> | null, label: string) {
super(label);
this.mEntries = entries;
if (!this.mEntries || this.mEntries == null)
this.mEntries = new JArrayList<T>();
this.calcMinMax();
} | 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 entries AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#instantiation_e... | constructor(entries: JArrayList<T> | null, label: string) {
super(label);
this.mEntries = entries;
if (!this.mEntries || this.mEntries == null)
this.mEntries = new JArrayList<T>();
this.calcMinMax();
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | c07e75b2ea6f9be358cba752a95b798ee88f5d68 | gitee |
openharmony-sig/applications_clock | feature/worldclock/src/main/ets/utils/CityClockCardUtil.ets | arkts | getCityNameAndDate | get CityName Date hoursWests
@param cityIndex cityIndex
@returns | public static getCityNameAndDate(cityIndex: string): FaCityData {
const timezone: string = i18n.TimeZone.getTimezoneFromCity(cityIndex).getID();
const hoursWests = CityClockCardUtil.getHourWest(timezone, cityIndex);
LogUtil.info(TAG, 'getCityNameAndDate cityIndex:' + cityIndex + ', hoursWests:' + hoursWes... | 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 getCityNameAndDate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left cityIndex AST#identifier#Right AST#ERROR#Left AST#:... | public static getCityNameAndDate(cityIndex: string): FaCityData {
const timezone: string = i18n.TimeZone.getTimezoneFromCity(cityIndex).getID();
const hoursWests = CityClockCardUtil.getHourWest(timezone, cityIndex);
LogUtil.info(TAG, 'getCityNameAndDate cityIndex:' + cityIndex + ', hoursWests:' + hoursWes... | https://gitee.com/openharmony-sig/applications_clock.git | 117ae711d9001600d25fe340650ee7d07d436bce | gitee |
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | getOperateTimeout | Get operate timeout
@return | public getOperateTimeout(): number {
return this.operateTimeout;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getOperateTimeout AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number A... | public getOperateTimeout(): number {
return this.operateTimeout;
} | https://gitee.com/openharmony-sig/FastBle.git | 6114a1ef03e9d0bed70275f16b9646a33f78dcc5 | gitee |
openharmony/applications_mms | entry/src/main/ets/pages/conversation/conversationController.ets | arkts | jumpToContact | Switching to the Contacts app | jumpToContact(actionData) {
let str = commonService.commonContactParam(actionData);
globalThis.mmsContext.startAbility(str).then((data) => {
HiLog.i(TAG, 'jumpToContact, startAbility Success');
}).catch((error) => {
HiLog.e(TAG, 'jumpToContact, failed. Cause: ' + JSON.stringify(error.message))... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left jumpToContact AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left actionData AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST... | jumpToContact(actionData) {
let str = commonService.commonContactParam(actionData);
globalThis.mmsContext.startAbility(str).then((data) => {
HiLog.i(TAG, 'jumpToContact, startAbility Success');
}).catch((error) => {
HiLog.e(TAG, 'jumpToContact, failed. Cause: ' + JSON.stringify(error.message))... | https://gitee.com/openharmony/applications_mms.git | 9688e31787b298625ae162cd751d68bd3ba89df7 | gitee |
erosTeam/NextE | shared/src/main/ets/settings/CustomProfilesSettings.ets | arkts | update | Replace the profile with the same uuid (bumps lastEditTime). | static async update(context: common.UIAbilityContext, profile: CustomProfile): Promise<void> {
const state: CustomProfilesState = connectCustomProfiles()
const next: CustomProfile[] = []
state.profiles.forEach((p: CustomProfile) => {
if (p.uuid === profile.uuid) {
profile.lastEditTime = Cust... | 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 update AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#R... | static async update(context: common.UIAbilityContext, profile: CustomProfile): Promise<void> {
const state: CustomProfilesState = connectCustomProfiles()
const next: CustomProfile[] = []
state.profiles.forEach((p: CustomProfile) => {
if (p.uuid === profile.uuid) {
profile.lastEditTime = Cust... | https://github.com/erosTeam/NextE | e8a75880c24a9df066ca0281c33c1d15ceeff2f7 | github |
HarmonyOS_Samples/core-speech-kit-sample-code-ark-ts-kit-asrdemo | entry/src/main/ets/pages/AudioCapturer.ets | arkts | start | start recording | public async start() {
console.error(TAG, `AudioCapturerUtil start`);
let stateGroup = [audio.AudioState.STATE_PREPARED, audio.AudioState.STATE_PAUSED, audio.AudioState.STATE_STOPPED];
if (null === this.mAudioCapturer) {
console.error(TAG, `AudioCapturerUtil have not init`);
return;
}
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left start AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Righ... | public async start() {
console.error(TAG, `AudioCapturerUtil start`);
let stateGroup = [audio.AudioState.STATE_PREPARED, audio.AudioState.STATE_PAUSED, audio.AudioState.STATE_STOPPED];
if (null === this.mAudioCapturer) {
console.error(TAG, `AudioCapturerUtil have not init`);
return;
}
... | https://gitcode.com/HarmonyOS_Samples/core-speech-kit-sample-code-ark-ts-kit-asrdemo | 4bdd1c50f91c39bb5af7ef1b80828532d91bd5b1 | gitcode |
cpdd5201314/harmonyOS-music-app | products/phone/src/main/ets/pages/PlaylistManager.ets | arkts | getPlayMode | 获取播放模式 | getPlayMode(): PlayMode {
return this.playMode;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPlayMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left PlayMode AST#identifier#Right AST#ERROR#Right AST#... | getPlayMode(): PlayMode {
return this.playMode;
} | https://github.com/cpdd5201314/harmonyOS-music-app | 952359eb92d3f5d1a793abb68a15f0ffd63a822b | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelChapterCacheManager.ets | arkts | createDownloadTask | 创建下载任务 | createDownloadTask(
bookId: string,
bookName: string,
startIndex: number,
endIndex: number
): string {
const taskId = `download_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
const now = Date.now();
const task: NovelDownloadTask = {
id: taskId,
bookId: bookId,... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left createDownloadTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bookId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#L... | createDownloadTask(
bookId: string,
bookName: string,
startIndex: number,
endIndex: number
): string {
const taskId = `download_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
const now = Date.now();
const task: NovelDownloadTask = {
id: taskId,
bookId: bookId,... | https://github.com/DaLongZhuaZi/manxia | e75bb55195dfe974bfdd6f275af45946e5722fab | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/listener/BarLineChartTouchListener.ets | arkts | getTrans | Returns a recyclable MPPointF instance.
returns the correct translation depending on the provided x and y touch
points
@param x
@param y
@return | public getTrans(x: number, y: number): MPPointF {
let vph: ViewPortHandler = this.mChart.getViewPortHandler();
let xTrans: number = x - vph.offsetLeft();
let yTrans: number = 0;
// check if axis is inverted
if (this.inverted()) {
yTrans = -(y - vph.offsetTop());
} else {
yTrans ... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTrans 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... | public getTrans(x: number, y: number): MPPointF {
let vph: ViewPortHandler = this.mChart.getViewPortHandler();
let xTrans: number = x - vph.offsetLeft();
let yTrans: number = 0;
// check if axis is inverted
if (this.inverted()) {
yTrans = -(y - vph.offsetTop());
} else {
yTrans ... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 2d585c379e4296edbac0b5dcf1b925395ae69c94 | gitee |
XHXYT/Pixark | entry/src/main/ets/viewmodel/DownloadsViewModel.ets | arkts | refreshDisplayList | 刷新当前展示的列表数据 | refreshDisplayList() {
const statusList: (number[] | null)[] = [
null, // 0: 所有
[request.agent.State.RUNNING, request.agent.State.RETRYING], // 1: 下载中
[request.agent.State.COMPLETED], // 2: 已完成
[request.agent.State.STOPPED, request.agent.State.FAILED] // 3: 失败
];
const targetStatus... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left refreshDisplayList 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... | refreshDisplayList() {
const statusList: (number[] | null)[] = [
null, // 0: 所有
[request.agent.State.RUNNING, request.agent.State.RETRYING], // 1: 下载中
[request.agent.State.COMPLETED], // 2: 已完成
[request.agent.State.STOPPED, request.agent.State.FAILED] // 3: 失败
];
const targetStatus... | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/DownloadsViewModel.ets#L144-L156 | 0bb68bd91795b30fa3f99b365deee2f8b24a25d8 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/AsyncRWLock.ets | arkts | HasReaders | Checks if there are any waiting readers.
@param { long } state Current lock state
@returns { boolean } True if there are waiting readers, false otherwise
@syscap SystemCapability.Utils.Lang | public static HasReaders(state: long): boolean {
return (state & State.READERS_MASK) != 0;
} | 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 HasReaders AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left state AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#... | public static HasReaders(state: long): boolean {
return (state & State.READERS_MASK) != 0;
} | https://gitcode.com/iop123123/arkts-static-skills | 6b95f95e5085333de6b11291eaff3da77038b288 | gitcode |
apap6628114/nga_oh | entry/src/main/ets/store/AppStore.ets | arkts | auth | ---------- Facade: Auth ---------- | get auth(): AuthState {
return this.authStore.state
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left auth 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 AuthState AST#identifier#R... | get auth(): AuthState {
return this.authStore.state
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/store/AppStore.ets#L90-L92 | 5017daef79c0ce898deff662c8d5993822f6b175 | github |
SMAT-Lab/PhantomRendering | example/entry/src/main/ets/pages/ImageBrowsePage.ets | arkts | aboutToAppear | Used to simulate resource leaks | aboutToAppear() {
console.info('[ImageBrowse] Component aboutToAppear')
// Force stop all timers to prevent state residue from page reuse
this.stopAllTimers()
// Receive mode parameters passed from home page
const params = router.getParams() as Record<string, Object>
if (params && ty... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
console.info('[ImageBrowse] Component aboutToAppear')
// Force stop all timers to prevent state residue from page reuse
this.stopAllTimers()
// Receive mode parameters passed from home page
const params = router.getParams() as Record<string, Object>
if (params && ty... | https://github.com/SMAT-Lab/PhantomRendering | 0a40a42a3235de3ccae250aacde38e7d7008b53e | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | endNavigation | 结束导航
@historyId 历史记录ID
@completed 是否完成 | public endNavigation(historyId: string, completed: boolean = true): void {
const historyItem = this.navigationHistory.find(h => h.id === historyId);
if (historyItem) {
historyItem.endTime = Date.now();
historyItem.completed = completed;
const duration = historyItem.endTime - historyIt... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left endNavigation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left historyId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string... | public endNavigation(historyId: string, completed: boolean = true): void {
const historyItem = this.navigationHistory.find(h => h.id === historyId);
if (historyItem) {
historyItem.endTime = Date.now();
historyItem.completed = completed;
const duration = historyItem.endTime - historyIt... | https://github.com/LJ666-ui/harmony-health-care | f244d469b27182a582d19f2aa7bc971eafcad262 | github |
arkui-x/samples | CodeLab/Cases/feature/customanimationtab/src/main/ets/model/TabInfo.ets | arkts | constructor | TabInfo构造器
@param title - tab项标题
@param contentBuilder - tab项内容
@param barBuilder - tabBar | constructor(title: string, contentBuilder: WrappedBuilder<[ESObject]>,
barBuilder?: WrappedBuilder<[TabBarItemInterface]>, params?: ESObject) {
this.title = title;
this.contentbuilder = contentBuilder;
this.barBuilder = barBuilder;
this.params = params;
} | 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 title AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right ... | constructor(title: string, contentBuilder: WrappedBuilder<[ESObject]>,
barBuilder?: WrappedBuilder<[TabBarItemInterface]>, params?: ESObject) {
this.title = title;
this.contentbuilder = contentBuilder;
this.barBuilder = barBuilder;
this.params = params;
} | https://gitcode.com/arkui-x/samples | ef9e6eac97e1801aaeb4ab522a07b3719db34b6b | gitcode |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/LibFreeRDP.ets | arkts | isInBackgroundMode | ==================== Connection Stability ====================
Check if in background mode | static isInBackgroundMode(inst: number): boolean {
if (!LibFreeRDP.ensureNativeReady()) {
return false;
}
if (inst === 0) {
return false;
}
try {
return freerdpNative!.freerdpIsInBackgroundMode(inst);
} catch (e) {
console.error(`${LibFreeRDP.TAG}: isInBackgroundMode er... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isInBackgroundMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left inst AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | static isInBackgroundMode(inst: number): boolean {
if (!LibFreeRDP.ensureNativeReady()) {
return false;
}
if (inst === 0) {
return false;
}
try {
return freerdpNative!.freerdpIsInBackgroundMode(inst);
} catch (e) {
console.error(`${LibFreeRDP.TAG}: isInBackgroundMode er... | https://github.com/tangwengang-del/freerdp-harmonyos | 46f0fe73a30dedd19695ed9e54267aea0112bec0 | github |
xblLab/HarmonyProjectTemplate | commons/lib_api/src/main/ets/services/AuthorService.ets | arkts | handleRawInfo | 数据库字段转换成云侧模型
@param author
@returns | private handleRawInfo(author: BaseAuthor): AuthorResponse {
const copyItem = JSON.parse(JSON.stringify(author)) as AuthorResponse;
return copyItem;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleRawInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left author AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | private handleRawInfo(author: BaseAuthor): AuthorResponse {
const copyItem = JSON.parse(JSON.stringify(author)) as AuthorResponse;
return copyItem;
} | https://github.com/xblLab/HarmonyProjectTemplate | 5a28bac6be51767f85a217330e67f9b11ead89f8 | github |
LongLiveY96/chatcube | entry/src/main/ets/viewmodels/ChatViewModel.ets | arkts | deleteMessagesFromIndex | 批量删除消息(用于重新生成功能) | async deleteMessagesFromIndex(messageIds: string[]): Promise<void> {
await this.databaseService.deleteMessagesByIds(messageIds)
if (this.currentSession !== null) {
// 从 currentSession.messages 中移除这些消息
for (let i = 0; i < messageIds.length; i++) {
this.clearPendingAIMessageIfMatches(message... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left deleteMessagesFromIndex AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_pa... | async deleteMessagesFromIndex(messageIds: string[]): Promise<void> {
await this.databaseService.deleteMessagesByIds(messageIds)
if (this.currentSession !== null) {
// 从 currentSession.messages 中移除这些消息
for (let i = 0; i < messageIds.length; i++) {
this.clearPendingAIMessageIfMatches(message... | https://github.com/LongLiveY96/chatcube | dc1a1600a141a814e0e41f7d4ad00b27920fcf4f | github |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets | arkts | readFloat32 | Reads the next float.
@param littleEndian If the value is little endian.
@returns The value. | readFloat32(littleEndian?: boolean): number {
const value = this.getFloat32(this.mByteOffset, littleEndian)
this.mByteOffset += 4
return value
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left readFloat32 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left littleEndian AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#... | readFloat32(littleEndian?: boolean): number {
const value = this.getFloat32(this.mByteOffset, littleEndian)
this.mByteOffset += 4
return value
} | https://gitee.com/openharmony-sig/flutter_engine.git | 22c9a548f082cc6fe747dd7da981544f196160d1 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/TypeGuards.ets | arkts | hasRequiredProperties | 检查对象是否包含指定的必需属性(非null/undefined)
@param obj - 要检查的对象
@param properties - 属性名数组
@returns 是否包含所有必需属性 | static hasRequiredProperties(obj: Object, properties: Array<string>): boolean {
if (!TypeGuards.isObject(obj)) {
return false;
}
const objValue = obj as Record<string, Object>;
for (let i = 0; i < properties.length; i++) {
const prop = properties[i];
if (!Object.keys(objValue).i... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left hasRequiredProperties AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | static hasRequiredProperties(obj: Object, properties: Array<string>): boolean {
if (!TypeGuards.isObject(obj)) {
return false;
}
const objValue = obj as Record<string, Object>;
for (let i = 0; i < properties.length; i++) {
const prop = properties[i];
if (!Object.keys(objValue).i... | https://github.com/DaLongZhuaZi/manxia | a09eb56fdf3e22409dd7877ce66a23b227eb6d5e | github |
LongLiveY96/chatcube | entry/src/main/ets/services/AIApiService.ets | arkts | hasFiles | 检查是否包含文件(非图片) | hasFiles(): boolean {
return this.attachments.some(a => a.type === AttachmentType.FILE && (a.base64Data !== '' || a.parsedText !== ''))
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasFiles 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_... | hasFiles(): boolean {
return this.attachments.some(a => a.type === AttachmentType.FILE && (a.base64Data !== '' || a.parsedText !== ''))
} | https://github.com/LongLiveY96/chatcube | ee76ba2e54f30b8d8cd98a2062d6682145a3e0dd | github |
openharmony/codelabs | ETSUI/ECommerce/entry/src/main/ets/utils/RdbUtil.ets | arkts | addUser | 添加新用户 | static async addUser(user: User): Promise<number> {
user.id = RdbUtil.memUsers.length + 1;
RdbUtil.memUsers.push(user);
hilog.info(0x0000, 'RdbUtil', 'Memory: addUser success, total: %{public}d', RdbUtil.memUsers.length);
const store = await RdbUtil.getStore();
if (!store) return user.id;
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left addUser AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left user AST#identifier#Right AST#:#Left : AST#:#Rig... | static async addUser(user: User): Promise<number> {
user.id = RdbUtil.memUsers.length + 1;
RdbUtil.memUsers.push(user);
hilog.info(0x0000, 'RdbUtil', 'Memory: addUser success, total: %{public}d', RdbUtil.memUsers.length);
const store = await RdbUtil.getStore();
if (!store) return user.id;
... | https://gitcode.com/openharmony/codelabs | 9b2804990ea1f78e606dc0afc4c3bfae6f62ed2f | gitcode |
ZestBox-18/kitebook-frontend | commons/base/src/main/ets/entities/AccountBean.ets | arkts | getSubtitleText | 返回首页列表使用的账户副标题。 | getSubtitleText(): string {
if (this.isLiability()) {
return '待还账户';
}
return '资金账户';
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSubtitleText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#statem... | getSubtitleText(): string {
if (this.isLiability()) {
return '待还账户';
}
return '资金账户';
} | https://github.com/ZestBox-18/kitebook-frontend | 59a08f6266bbdb261a202805edc55871d326bdad | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Date.ets | arkts | getUTCHours | Returns the hours in the specified date according to universal time.
@returns An integer number, between 0 and 23, representing the hour for the given date according to UTC time. | public getUTCHours(): byte {
return ecmaHourFromTime(this.ms);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getUTCHours 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 byte AST#i... | public getUTCHours(): byte {
return ecmaHourFromTime(this.ms);
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | d6f9d17f0e0cc4297d879a8621e0e1c7b51a2288 | gitee |
Tencent-RTC/TUIKit_Harmony | atomic_x/src/main/ets/messagelist/config/MessageListConfig.ets | arkts | isSupportConvertToText | Disable convert to text in merged detail view | get isSupportConvertToText(): boolean {
return false;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left isSupportConvertToText 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... | get isSupportConvertToText(): boolean {
return false;
} | https://github.com/Tencent-RTC/TUIKit_Harmony | 8c2dd3bed018372d93f00074a49706227f637d05 | github |
HarmonyOS_Samples/sample_in_harmonyos | features/devpractices/src/main/ets/model/ImageModel.ets | arkts | evaluateOffsetRange | Calculate the range of the picture boundary. | evaluateOffsetRange(): void {
// Calculate the actual display size of the scaled image.
let scaledImageWidth = this.imageWidth * this.curScale;
let scaledImageHeight = this.imageHeight * this.curScale;
// Calculation of X-axis boundaries
if (scaledImageWidth > this.componentWidth) {
// If t... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left evaluateOffsetRange 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... | evaluateOffsetRange(): void {
// Calculate the actual display size of the scaled image.
let scaledImageWidth = this.imageWidth * this.curScale;
let scaledImageHeight = this.imageHeight * this.curScale;
// Calculation of X-axis boundaries
if (scaledImageWidth > this.componentWidth) {
// If t... | https://gitcode.com/HarmonyOS_Samples/sample_in_harmonyos | 6e0b122a08f1ef61b19e2c95fab1d3bdad1700e9 | gitcode |
DaLongZhuaZi/NGF | ngf_framework/src/main/ets/utils/PerformanceMonitor.ets | arkts | reportToHilog | 输出启动耗时报告到 hilog | reportToHilog(): void {
for (let index = 0; index < this.measures.length; index++) {
const m = this.measures[index];
hilog.info(0x0000, TAG, '[Perf] ' + m.name + ': ' + m.durationMs + 'ms (' + m.startMark + ' -> ' + m.endMark + ')');
}
if (this.memorySnapshots.length > 0) {
const last = ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left reportToHilog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | reportToHilog(): void {
for (let index = 0; index < this.measures.length; index++) {
const m = this.measures[index];
hilog.info(0x0000, TAG, '[Perf] ' + m.name + ': ' + m.durationMs + 'ms (' + m.startMark + ' -> ' + m.endMark + ')');
}
if (this.memorySnapshots.length > 0) {
const last = ... | https://github.com/DaLongZhuaZi/NGF | 0aadf436ef202ae0a16ad59444dddc2463a5f5c2 | github |
webabcd/HarmonyDemo | entry/src/main/ets/entryability/EntryAbility.ets | arkts | startErrorManager | 开始监听未处理异常 | startErrorManager() {
/*
* errorManager.on("error") - 开始监听未处理异常,返回此监听器的标识
* onUnhandledException() - 监听到未处理异常后的回调
* errMsg - 返回一个 string 信息
* onException() - 监听到未处理异常后的回调
* errObject - 返回一个 Error 对象
* name - 异常的名称
* message - 异常的信息
* stack - 异常... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startErrorManager 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#... | startErrorManager() {
/*
* errorManager.on("error") - 开始监听未处理异常,返回此监听器的标识
* onUnhandledException() - 监听到未处理异常后的回调
* errMsg - 返回一个 string 信息
* onException() - 监听到未处理异常后的回调
* errObject - 返回一个 Error 对象
* name - 异常的名称
* message - 异常的信息
* stack - 异常... | https://github.com/webabcd/HarmonyDemo | 7d5b1a1f02be30d5e642ff97c6733c5dcad63fb3 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/CheatManager.ets | arkts | refreshOnlineCheats | 刷新在线金手指:删除缓存后重新请求 | async refreshOnlineCheats(gameCode: string, checksum: string): Promise<GameCheats | null> {
const cachePath = this.getOnlineCachePath(gameCode, checksum);
try {
fileIo.unlinkSync(cachePath);
} catch (_e) { /* 文件不存在也没关系 */ }
return this.fetchOnlineCheats(gameCode, checksum);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left refreshOnlineCheats AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left gameCode AST#identifier#Right AST#type_annotation#Left AST#... | async refreshOnlineCheats(gameCode: string, checksum: string): Promise<GameCheats | null> {
const cachePath = this.getOnlineCachePath(gameCode, checksum);
try {
fileIo.unlinkSync(cachePath);
} catch (_e) { /* 文件不存在也没关系 */ }
return this.fetchOnlineCheats(gameCode, checksum);
} | https://github.com/richshaw2015/nds | 4cab5e49fb5a8b9a7be8c268cf52040a60761fed | github |
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/AuthRepository.ets | arkts | loginByWxApp | 微信 APP 授权登录
@param {Record<string, string>} params - 微信授权参数
@returns {Promise<NetworkResponse<Auth>>} 认证结果 | async loginByWxApp(params: Record<string, string>): Promise<NetworkResponse<Auth>> {
return this.networkDataSource.loginByWxApp(params);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left loginByWxApp AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : ... | async loginByWxApp(params: Record<string, string>): Promise<NetworkResponse<Auth>> {
return this.networkDataSource.loginByWxApp(params);
} | https://github.com/Joker-x-dev/CoolMallArkTS | e265cae10b6e733bcd2ef4024eba24a6e0d4c68a | github |
Explore-In-HMOS-Wearable/expense-splitter | entry/src/main/ets/database/RDBBuilder.ets | arkts | validateMigrations | Validates passed migrations. | private validateMigrations() {
const targetVersion = this.version; // e.g., 4
// No need for any migration, skip any migrations
if (targetVersion === 0 || targetVersion === 1) {
return;
}
if (!this.migrations || this.migrations.length === 0) {
throw new Error('No migrations provided.'... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left validateMigrations 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#... | private validateMigrations() {
const targetVersion = this.version; // e.g., 4
// No need for any migration, skip any migrations
if (targetVersion === 0 || targetVersion === 1) {
return;
}
if (!this.migrations || this.migrations.length === 0) {
throw new Error('No migrations provided.'... | https://github.com/Explore-In-HMOS-Wearable/expense-splitter | 1f4968348f324c6cb457dbca653354d52969e255 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Utils/SafeUtils.ets | arkts | parseObj | 安全解析JSON字符串为对象。解析失败返回空对象 {}。 | static parseObj<T>(jsonStr: string | undefined | null): T {
let emptyObj: Record<string, Object> = {};
if (!jsonStr || jsonStr.trim() === '') {
return emptyObj as T;
}
try {
return JSON.parse(jsonStr) as T;
} catch (error) {
logger.error(TAG, `JSON parse error (Obj): ${String(err... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#ERROR#Right AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left parseObj AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AS... | static parseObj<T>(jsonStr: string | undefined | null): T {
let emptyObj: Record<string, Object> = {};
if (!jsonStr || jsonStr.trim() === '') {
return emptyObj as T;
}
try {
return JSON.parse(jsonStr) as T;
} catch (error) {
logger.error(TAG, `JSON parse error (Obj): ${String(err... | https://github.com/DaLongZhuaZi/manxia | edd97ff4cc9fe620b424cfea9ecc43baa52a90fb | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/WebViewDataCacheManager.ets | arkts | updateConfig | 更新缓存配置 | updateConfig(config: CacheConfig): void {
// 手动更新配置属性
const newConfig: CacheConfig = {
mangaDetailTTL: config.mangaDetailTTL,
chapterListTTL: config.chapterListTTL,
maxEntries: config.maxEntries
};
this.config = newConfig;
logger.info(TAG, `缓存配置已更新: ${JSON.stringify(this.config)}... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CacheConfig AST#identifier#Right AST#)#Le... | updateConfig(config: CacheConfig): void {
// 手动更新配置属性
const newConfig: CacheConfig = {
mangaDetailTTL: config.mangaDetailTTL,
chapterListTTL: config.chapterListTTL,
maxEntries: config.maxEntries
};
this.config = newConfig;
logger.info(TAG, `缓存配置已更新: ${JSON.stringify(this.config)}... | https://github.com/DaLongZhuaZi/manxia | 0f9eb6eb8431c34a63b7d4b73e7b036f32c1e30a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/components/BookOpenTransition.ets | arkts | isReaderReady | 获取阅读器是否就绪 | public isReaderReady(): boolean {
return this.pendingReaderReady;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isReaderReady 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 isReaderReady(): boolean {
return this.pendingReaderReady;
} | https://github.com/DaLongZhuaZi/manxia | bebe7618c4fceea4f542f9e481970867545847b7 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.HashMap.ets | arkts | setAll | Sets all entries from another HashMap into this HashMap
@param map the HashMap to copy entries from | setAll(map: HashMap<K, V>): void {
map.forEach((value: V, key: K) => {
this.buckets.set(key, value);
});
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left map AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#Left HashMap AST#iden... | setAll(map: HashMap<K, V>): void {
map.forEach((value: V, key: K) => {
this.buckets.set(key, value);
});
} | https://gitcode.com/iop123123/arkts-static-skills | 277618570c5f457211a178eb23646d9b32defb5d | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | set | Copies all elements of arr to the current Float64Array starting from insertPos.
@param arr array to copy data from
@param insertPos start index where data from arr will be inserted
{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set} | public set(arr: number[], insertPos1: number): void {
const insertPos = insertPos1 as int
if (insertPos < 0 || insertPos + arr.length > this.length) {
throw new RangeError("set(insertPos: int, arr: double[]): size of arr is greater than Float64Array.length")
}
for (let i ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | public set(arr: number[], insertPos1: number): void {
const insertPos = insertPos1 as int
if (insertPos < 0 || insertPos + arr.length > this.length) {
throw new RangeError("set(insertPos: int, arr: double[]): size of arr is greater than Float64Array.length")
}
for (let i ... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | f202c41c15e30e7915cada559ee389a93fd49cb7 | gitee |
openharmony/codelabs | ETSUI/Habit/entry/src/main/ets/model/repository/HabitRepository.ets | arkts | insert | 1. 检查 INSERT:存的时候带上 categoryId 了吗? | insert(habit: Habit): Promise<number> {
const store = RdbHelper.getRdbStore();
if (!store) {
return Promise.reject('数据库未初始化');
}
const valueBucket: relationalStore.ValuesBucket = {
name: habit.name,
color: habit.color,
targetCount: habit.targetCount,
categoryId: habit.ca... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left insert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left habit AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Habit ... | insert(habit: Habit): Promise<number> {
const store = RdbHelper.getRdbStore();
if (!store) {
return Promise.reject('数据库未初始化');
}
const valueBucket: relationalStore.ValuesBucket = {
name: habit.name,
color: habit.color,
targetCount: habit.targetCount,
categoryId: habit.ca... | https://gitcode.com/openharmony/codelabs | 806fbb466d313c933daefe745c2ed9bc80816fb9 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/repository/BatchInsertResult.ets | arkts | createFailure | 创建失败的批量插入结果
@param errorMessage 错误信息
@param failedIndexes 失败的索引列表
@returns BatchInsertResult 实例 | static createFailure(errorMessage: string, failedIndexes: Array<number> = []): BatchInsertResult {
const result = new BatchInsertResult()
result.success = false
result.errorMessage = errorMessage
result.failedIndexes = failedIndexes
return result
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createFailure AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left errorMessage AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str... | static createFailure(errorMessage: string, failedIndexes: Array<number> = []): BatchInsertResult {
const result = new BatchInsertResult()
result.success = false
result.errorMessage = errorMessage
result.failedIndexes = failedIndexes
return result
} | https://github.com/offlinecat-dev/OCNetORM | b5a73caba0cd8561e1332b442bf204ff53a67698 | github |
RoooyHe/toona-ohos | toona/src/main/ets/utils/ToastUtils.ets | arkts | short | 短 Toast(约 1s) | static short(message: string): void {
WdkitToast.shortToast(message);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left short AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#... | static short(message: string): void {
WdkitToast.shortToast(message);
} | https://github.com/RoooyHe/toona-ohos | d35ab0ac78d02ed38002bf871ceaaaa6ab837136 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/OCRRecognitionDAO.ets | arkts | getUnused | 查询未使用的识别记录 | static async getUnused(userId: number, limit: number = 20): Promise<OCRRecognitionRecord[]> {
try {
const store = DatabaseManager.getDatabase();
const sql = `
SELECT *
FROM ${OCRRecognitionRecord.tableName}
WHERE user_id = ?
AND is_used = 0
AND recognition_s... | 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 getUnused AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : AST#:... | static async getUnused(userId: number, limit: number = 20): Promise<OCRRecognitionRecord[]> {
try {
const store = DatabaseManager.getDatabase();
const sql = `
SELECT *
FROM ${OCRRecognitionRecord.tableName}
WHERE user_id = ?
AND is_used = 0
AND recognition_s... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 37d9bd9e20611621c85c92c146e5e4496b8ec554 | github |
openharmony/applications_app_samples | code/BasicFeature/Ability/AbilityRuntime/entry/src/main/ets/abilitylifecyclecallback/AbilityLifecycleCallback.ets | arkts | onAbilityWillForeground | 注册监听应用上下文的生命周期后,在UIAbility的[onForeground]触发前回调。 | onAbilityWillForeground(ability) {
hilog.info(DOMAIN, TAG, 'AbilityLifecycleCallback onAbilityWillForeground');
}, | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onAbilityWillForeground AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ability AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Ri... | onAbilityWillForeground(ability) {
hilog.info(DOMAIN, TAG, 'AbilityLifecycleCallback onAbilityWillForeground');
}, | https://github.com/openharmony/applications_app_samples | ba71007ddcb57cdd7236e0af65ad255e951eec99 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.buffer.ets | arkts | lastIndexOf | Returns the last index where `value` is found in the buffer.
@param {string | int | double | long | Buffer | Uint8Array} value - The value to search for
@param {int} [byteOffset=buffer length] - The byte position to start searching from (backwards).
- If negative, it is counted from the end of the buffer (`len + byteOf... | public lastIndexOf(value: string | int | double | long | Buffer | Uint8Array, byteOffset?: int , encoding?: BufferEncoding): int {
const searchBuffer = this.normalizeValueToBuffer(value, encoding ?? "utf8");
const searchLen = searchBuffer.length;
const len = this.length;
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left lastIndexOf 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#binary_expression#L... | public lastIndexOf(value: string | int | double | long | Buffer | Uint8Array, byteOffset?: int , encoding?: BufferEncoding): int {
const searchBuffer = this.normalizeValueToBuffer(value, encoding ?? "utf8");
const searchLen = searchBuffer.length;
const len = this.length;
... | https://gitcode.com/iop123123/arkts-static-skills | e47f537b2876cae7dda3b1cefb6f6e8080cfd312 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Database/DatabaseManager.ets | arkts | createTables | 创建数据库表 | private async createTables(): Promise<void> {
const store = this.getStore();
// 按顺序创建表,避免外键依赖问题
const tableNames = [
'COMIC_SOURCE',
'TEMP_MANGA_INFO',
'COMIC_INFO',
'CHAPTER',
'CHAPTER_INDEX',
'PAGE',
'PAGE_INDEX',
'FAVORITE',
'READ_HISTORY',
... | 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 createTables AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#... | private async createTables(): Promise<void> {
const store = this.getStore();
// 按顺序创建表,避免外键依赖问题
const tableNames = [
'COMIC_SOURCE',
'TEMP_MANGA_INFO',
'COMIC_INFO',
'CHAPTER',
'CHAPTER_INDEX',
'PAGE',
'PAGE_INDEX',
'FAVORITE',
'READ_HISTORY',
... | https://github.com/DaLongZhuaZi/manxia | 4615324757b4c331aa2d7ad8d8062a0a53b63908 | github |
openharmony-sig/online_event | solution_student_challenge/基于OpenHarmony的OpenGit_潘骏翔/OpenGit/entry/src/main/ets/MainAbility/common/viewmodels/implements/repo/PullRequestViewModel.ets | arkts | initPullRequests | 初始化该页面的pr数据 | initPullRequests() {
console.info('PullRequestViewModel: initPullRequests')
//通过网络请求获取数据
Request.getInstance()
.getRequest(this, PullRequestAPI.GetPullRequests(this.ownerPath, this.repoPath), [{
key: 'state', ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initPullRequests 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... | initPullRequests() {
console.info('PullRequestViewModel: initPullRequests')
//通过网络请求获取数据
Request.getInstance()
.getRequest(this, PullRequestAPI.GetPullRequests(this.ownerPath, this.repoPath), [{
key: 'state', ... | https://gitee.com/openharmony-sig/online_event.git | 2929f51eec7c1dccfa140ccec23385c5da46a219 | gitee |
openharmony-sig/commons-cli | library/src/main/ets/components/cli/OptionGroup.ets | arkts | getNames | @return the names of the options in this group as a {@code Collection} | public getNames(): JList<string> {
// the key set is the collection of names
let val = this.optionMap.keys();
let arr: JList<string> = new JList();
for (let option of val) {
arr.insert(option);
}
return arr;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getNames 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_st... | public getNames(): JList<string> {
// the key set is the collection of names
let val = this.optionMap.keys();
let arr: JList<string> = new JList();
for (let option of val) {
arr.insert(option);
}
return arr;
} | https://gitee.com/openharmony-sig/commons-cli.git | de1fd6b9efa732b6940af8c3c8983ec6d0d4b1f6 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/WebViewDataCacheManager.ets | arkts | warmup | 预热缓存(可选) | async warmup(sourceId: number, mangaIds: string[]): Promise<void> {
logger.info(TAG, `开始预热缓存: sourceId=${sourceId}, 漫画数=${mangaIds.length}`);
// 预热逻辑可以在需要时实现
} | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left warmup AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left AST#:#Le... | async warmup(sourceId: number, mangaIds: string[]): Promise<void> {
logger.info(TAG, `开始预热缓存: sourceId=${sourceId}, 漫画数=${mangaIds.length}`);
// 预热逻辑可以在需要时实现
} | https://github.com/DaLongZhuaZi/manxia | ca0584da8a6a4d0ea33a63c88705495135fc2232 | github |
openharmony-tpc/ohos_coap | libcoap/src/main/ets/components/mainpage/CoapClient.ets | arkts | setNativeLogOpen | 打开native层log
@param token 初始令牌 | static setNativeLogOpen(isOpen: boolean) {
coap.setNativeLogOpen(isOpen);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setNativeLogOpen AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left isOpen AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | static setNativeLogOpen(isOpen: boolean) {
coap.setNativeLogOpen(isOpen);
} | https://gitee.com/openharmony-tpc/ohos_coap.git | 59e97c554e7f98e72d090a86755c41605bd48313 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Utils/ComicInfoParser.ets | arkts | parseBooleanField | 解析布尔字段
@param value 字符串值
@returns 解析后的布尔值或undefined | private parseBooleanField(value: string): boolean | undefined {
try {
const lowerValue = value.toLowerCase();
if (lowerValue === 'true' || lowerValue === 'yes' || lowerValue === '1') {
return true;
} else if (lowerValue === 'false' || lowerValue === 'no' || lowerValue === '0') {
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseBooleanField 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... | private parseBooleanField(value: string): boolean | undefined {
try {
const lowerValue = value.toLowerCase();
if (lowerValue === 'true' || lowerValue === 'yes' || lowerValue === '1') {
return true;
} else if (lowerValue === 'false' || lowerValue === 'no' || lowerValue === '0') {
... | https://github.com/DaLongZhuaZi/manxia | c5ec6644f4f01e3bcb0dcacdf1738e0c3bd192af | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ChangelogManager.ets | arkts | getCurrentVersion | 获取当前版本号(字符串) | getCurrentVersion(): string {
return this.currentVersion;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCurrentVersion AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#stat... | getCurrentVersion(): string {
return this.currentVersion;
} | https://github.com/DaLongZhuaZi/manxia | 1ca10f065a32578a0434e34ec8e2f039dbb1ef73 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets | arkts | restoreCustomFonts | 恢复自定义字体文件
[修复] 增强日志和错误处理 | private async restoreCustomFonts(fontsDir: string): Promise<void> {
logger.info(TAG, `========== 开始恢复自定义字体 ==========`);
logger.info(TAG, `字体源目录: ${fontsDir}`);
const filesDir = this.sandboxManager.getDirectory('files');
const targetDir = `${filesDir}/custom_fonts`;
logger.info(TAG, `字体目... | 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 restoreCustomFonts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left fontsDir AST#identifier#Right AST#ERROR#Left AST#... | private async restoreCustomFonts(fontsDir: string): Promise<void> {
logger.info(TAG, `========== 开始恢复自定义字体 ==========`);
logger.info(TAG, `字体源目录: ${fontsDir}`);
const filesDir = this.sandboxManager.getDirectory('files');
const targetDir = `${filesDir}/custom_fonts`;
logger.info(TAG, `字体目... | https://github.com/DaLongZhuaZi/manxia | bb2835a4cf5e7c67cba7a738c778ac2dcfb72f21 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets | arkts | equals | Checks for equality this instance with provided object, treated as a InterfaceType
@param {Type} other type to be checked against
@returns {boolean} true if object also has InterfaceType and
their names are the same
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public override equals(other: Type): boolean {
// Must compare classes, as descriptors might be equal between classes from different contexts
return other instanceof InterfaceType && this.cls == (other as InterfaceType).cls
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left equals AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left other AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#... | public override equals(other: Type): boolean {
// Must compare classes, as descriptors might be equal between classes from different contexts
return other instanceof InterfaceType && this.cls == (other as InterfaceType).cls
} | https://gitcode.com/iop123123/arkts-static-skills | 214c6e3d4c8f9d0e3ef369239081d414fd3fcbae | gitcode |
openharmony/arkui_ace_engine | examples/Accessibility/AccessibilityCapi/entry/src/main/ets/pages/Index.ets | arkts | loadScenarios | 从C++加载可用场景列表 | loadScenarios(): void {
try {
console.info('Index: Start loading scenarios from C++');
const scenarios: ScenarioData[] = nativerender.scenarioManager.getAvailableScenarios();
this.loadedScenarios = scenarios;
console.info(`Index: Loaded ${scenarios.length} scenarios from C++`);
// 定... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadScenarios AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | loadScenarios(): void {
try {
console.info('Index: Start loading scenarios from C++');
const scenarios: ScenarioData[] = nativerender.scenarioManager.getAvailableScenarios();
this.loadedScenarios = scenarios;
console.info(`Index: Loaded ${scenarios.length} scenarios from C++`);
// 定... | https://gitcode.com/openharmony/arkui_ace_engine | 18f0e064b87c277f87fedeeae40926820a228ca1 | gitcode |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test16_original_index.ets | arkts | binarySearch | === Round 16: Binary search, Bubble sort, Memoization, Matrix transpose,
Two-pointer palindrome, Unary operators (+x, -x, !!x),
Chained static methods ===
--- Binary search --- | function binarySearch(arr: number[], target: number): number {
let lo: number = 0;
let hi: number = arr.length - 1;
while (lo <= hi) {
let mid: number = lo + (hi - lo) / 2;
mid = Math.floor(mid);
let val: number = arr[mid];
if (val === target) {
return mid;
}
if (val < target) {
... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left binarySearch 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#:#Righ... | function binarySearch(arr: number[], target: number): number {
let lo: number = 0;
let hi: number = arr.length - 1;
while (lo <= hi) {
let mid: number = lo + (hi - lo) / 2;
mid = Math.floor(mid);
let val: number = arr[mid];
if (val === target) {
return mid;
}
if (val < target) {
... | https://github.com/miaochiahao/ark-ghidra | 49e38ee9cfd1ca459d6741e1c1244210e163d43b | github |
YDYm233/EasyRandom_HarmonyNextApp | common/SystemUtils/src/main/ets/utils/VibratorManager.ets | arkts | vibrateDramatic | 戏剧性振动 — 逐渐增强的悬念感,适合揭晓重大结果 | static vibrateDramatic(): void {
VibratorManager.logExecution('vibrateDramatic');
VibratorManager.vibratePattern([60, 60, 100, 60, 200, 60, 400], 1, VibrationUsage.PHYSICAL_FEEDBACK);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left vibrateDramatic 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... | static vibrateDramatic(): void {
VibratorManager.logExecution('vibrateDramatic');
VibratorManager.vibratePattern([60, 60, 100, 60, 200, 60, 400], 1, VibrationUsage.PHYSICAL_FEEDBACK);
} | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | 597739275dc5e7d1b4ff1eb3b315485143e6247b | github |
seagazer/cclyric | lib/src/main/ets/CcLyricController.ets | arkts | setFadeEnable | Show the fade edge of the lyric view or not.
@param enable | public setFadeEnable(enable: boolean): CcLyricController {
this._fadeEnable = enable
this.invalidate()
return this
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setFadeEnable AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enable AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | public setFadeEnable(enable: boolean): CcLyricController {
this._fadeEnable = enable
this.invalidate()
return this
} | https://github.com/seagazer/cclyric | afd8a257a0a8a24ac8cc439840694ce0a214a418 | github |
kumaleap/ArkSwipeDeck | library/src/main/ets/utils/AnimationUtils.ets | arkts | interpolate | 插值计算
@param from - 起始值
@param to - 结束值
@param progress - 进度(0-1)
@returns 插值结果 | static interpolate(from: number, to: number, progress: number): number {
return from + (to - from) * progress;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left interpolate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left from AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left numb... | static interpolate(from: number, to: number, progress: number): number {
return from + (to - from) * progress;
} | https://github.com/kumaleap/ArkSwipeDeck | 7907939528d8e2391dbdd6c50cd9ed6cb5403531 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | from | Creates an array from an array of the same up to the signess type.
@param { Int32Array } arr - An array to convert to a new array.
@returns { Uint32Array } - A new Uint32Array
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static from(arr: Int32Array): Uint32Array {
let result = new Uint32Array(arr.length)
result.set(arr)
return result
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Righ... | public static from(arr: Int32Array): Uint32Array {
let result = new Uint32Array(arr.length)
result.set(arr)
return result
} | https://gitcode.com/iop123123/arkts-static-skills | 954889d12c9428436f9cfc8ccfa40215543fa730 | gitcode |
HarmonyOS_Samples/hmosworld | HMOSWorld/Application/features/discover/src/main/ets/components/SearchHistory.ets | arkts | quickSearchGroupHeader | Common list item header | @Builder
function quickSearchGroupHeader(groupName: Resource, onClickIcon?: () => void) {
Row() {
Text(groupName)
.fontSize($r('app.float.default_font_size'))
.fontWeight(FontWeight.Bold)
.fontColor($r('sys.color.ohos_id_color_text_secondary'))
if (onClickIcon) {
SymbolGlyph($r('sys.sy... | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left quickSearchGroupHeader AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Righ... | @Builder
function quickSearchGroupHeader(groupName: Resource, onClickIcon?: () => void) {
Row() {
Text(groupName)
.fontSize($r('app.float.default_font_size'))
.fontWeight(FontWeight.Bold)
.fontColor($r('sys.color.ohos_id_color_text_secondary'))
if (onClickIcon) {
SymbolGlyph($r('sys.sy... | https://gitcode.com/HarmonyOS_Samples/hmosworld | bc271d85afd796985af002f540f7bba72511d1d6 | gitcode |
Cool_foolisher1/ArkTSRepository | GraphicalCode/features/settings/src/main/ets/viewmodel/AboutViewModel.ets | arkts | getInstance | 获取AboutViewModel实例
@returns AboutViewModel | public static getInstance(): AboutViewModel {
if (!AboutViewModel.instance) {
AboutViewModel.instance = new AboutViewModel()
}
return AboutViewModel.instance
} | 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 getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L... | public static getInstance(): AboutViewModel {
if (!AboutViewModel.instance) {
AboutViewModel.instance = new AboutViewModel()
}
return AboutViewModel.instance
} | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 69ea0bf8eaff47d5482a086fa824a1ac94f5be5d | gitcode |
openharmony/applications_mms | entry/src/main/ets/pages/conversationlist/conversationListController.ets | arkts | conversationLongPress | Touch and hold a list to display the selection and deletion functions. | conversationLongPress(index : number) {
if (this.messageList[index]) {
// Check whether the left slide button exists. If yes, the button cannot be clicked.
if (this.messageList[index]?.isDelShow != null && this.messageList[index].isDelShow) {
return;
}
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left conversationLongPress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identif... | conversationLongPress(index : number) {
if (this.messageList[index]) {
// Check whether the left slide button exists. If yes, the button cannot be clicked.
if (this.messageList[index]?.isDelShow != null && this.messageList[index].isDelShow) {
return;
}
... | https://gitee.com/openharmony/applications_mms.git | e38c3b82790b7c043228b6c36965fef9b6d91bf6 | gitee |
openharmony-sig/applications_clock | feature/alarmclock/src/main/ets/manager/AlarmServiceManager.ets | arkts | cancelCallStateChange | cancel call state Change | private cancelCallStateChange(): void {
observer.off('callStateChange', value => {
LogUtil.info(TAG, 'on cancel CallStateChange');
});
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left cancelCallStateChange 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 A... | private cancelCallStateChange(): void {
observer.off('callStateChange', value => {
LogUtil.info(TAG, 'on cancel CallStateChange');
});
} | https://gitee.com/openharmony-sig/applications_clock.git | 33bc3df877fac72ae7b440c4beb10ea6a2ee1d6f | gitee |
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | getMultipleBluetoothController | Get the multiple Bluetooth Controller
@return | public getMultipleBluetoothController(): MultipleBluetoothController | null {
return this.multipleBluetoothController;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getMultipleBluetoothController 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_... | public getMultipleBluetoothController(): MultipleBluetoothController | null {
return this.multipleBluetoothController;
} | https://gitee.com/openharmony-sig/FastBle.git | 634027fd29c3b743068bacaa3cb3927915b73f36 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.