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 |
|---|---|---|---|---|---|---|---|---|---|---|
terryma2024/happyword | harmonyos/entry/src/main/ets/services/BattleResultEnricher.ets | arkts | resetModeToNormal | Review mode is always a single-battle affordance — reset the stored
GameConfig back to 'normal' so the next HomePage launch doesn't
accidentally start another review session. Done even when we weren't in
review mode so a stale flag from a crashed previous session gets cleaned
up on any battle end. | function resetModeToNormal(ctx: common.UIAbilityContext): void {
const storedCfg: GameConfig | undefined =
AppStorage.get<GameConfig>(GAME_CONFIG_STORAGE_KEY);
if (storedCfg === undefined) {
return;
}
if (storedCfg.mode === GAME_MODE_NORMAL) {
return;
}
const next: GameConfig = cloneGameConfig(s... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left resetModeToNormal AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left ctx AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | function resetModeToNormal(ctx: common.UIAbilityContext): void {
const storedCfg: GameConfig | undefined =
AppStorage.get<GameConfig>(GAME_CONFIG_STORAGE_KEY);
if (storedCfg === undefined) {
return;
}
if (storedCfg.mode === GAME_MODE_NORMAL) {
return;
}
const next: GameConfig = cloneGameConfig(s... | https://github.com/terryma2024/happyword | 8b133a6854b8df387ac2eb34cd2b7c5b2f23ba5e | github |
openharmony/codelabs | ETSUI/PositioningDemo/entry/src/main/ets/pages/PlanDetailPage.ets | arkts | isDurationCompleted | 时长是否达成(durationTarget 以分钟为单位,durationCompleted 以毫秒为单位) | isDurationCompleted(targetMinutes: number, completedMs: number): boolean {
if (targetMinutes <= 0) {
return false;
}
const targetMs = targetMinutes * 60 * 1000;
return completedMs >= targetMs;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isDurationCompleted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left targetMinutes AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#L... | isDurationCompleted(targetMinutes: number, completedMs: number): boolean {
if (targetMinutes <= 0) {
return false;
}
const targetMs = targetMinutes * 60 * 1000;
return completedMs >= targetMs;
} | https://gitcode.com/openharmony/codelabs | e410c0a07df59bbd055527a045effe822f0909e5 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/FinalizationRegistry.ets | arkts | register | Registers an object with specific callback's argument and
optional token - an object used to remove the entry from the registry.
@see unregister
After the object is garbage collected, runtime will call the callback
with the specific argument.
@param object a tracking object
@param callbackArg callback argument for call... | public register(object: Object, callbackArg: T, token?: Object): void {
return this.registerImpl(object, callbackArg, token);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left register AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left object AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Objec... | public register(object: Object, callbackArg: T, token?: Object): void {
return this.registerImpl(object, callbackArg, token);
} | https://gitcode.com/iop123123/arkts-static-skills | dc53c80e2bf7bf67152a06ae261edb2827ee3e92 | gitcode |
openharmony-tpc/ohos_coap | libcoap/src/main/ets/components/mainpage/CoapClient.ets | arkts | setToken | 客户端设置初始token
@param token:Uint8Array数组,数组内容是0-255的数字,数组长度8位 | setToken(token: Uint8Array) {
if (token.length > 8 || token.length < 3) {
console.log("libcoap 请传入正确3~8位长度的token");
return;
}
this.coapClient.setToken(token, this.classId);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left token AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Uint8Array AST#identifier#Right... | setToken(token: Uint8Array) {
if (token.length > 8 || token.length < 3) {
console.log("libcoap 请传入正确3~8位长度的token");
return;
}
this.coapClient.setToken(token, this.classId);
} | https://gitee.com/openharmony-tpc/ohos_coap.git | 9410faa9247efc5b66d2abd749d4690f98d97e04 | gitee |
richshaw2015/nds | ohos/entry/src/test/SyncToNativeProperty.test.ets | arkts | generateInvalidKey | Generate a string that is NOT a valid setting key.
Strategy: random strings + mutations of valid keys. | function generateInvalidKey(rng: PRNG): string {
const strategy = rng.nextInt(0, 3);
let candidate: string;
switch (strategy) {
case 0:
// Completely random string
candidate = rng.nextString(rng.nextInt(1, 30));
break;
case 1: {
// Mutate a valid key by appending random suffix
... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left generateInvalidKey AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left rng AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | function generateInvalidKey(rng: PRNG): string {
const strategy = rng.nextInt(0, 3);
let candidate: string;
switch (strategy) {
case 0:
// Completely random string
candidate = rng.nextString(rng.nextInt(1, 30));
break;
case 1: {
// Mutate a valid key by appending random suffix
... | https://github.com/richshaw2015/nds | faee80c13c84c569da0fa574a9b71e2110408a99 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/bitwise_and/bitwise_and_ubyte.ets | arkts | main | ---
desc: check bitwise AND operation for unsigned byte operands
--- | function main(): void {
const a: ubyte = {{v.left}}
const b: ubyte = {{v.right}}
assert (a & b) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A... | function main(): void {
const a: ubyte = {{v.left}}
const b: ubyte = {{v.right}}
assert (a & b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | d859a287113ea69bb3ce0748a78dfeb092948b6b | gitee |
HarmonyOS_Samples/guide-snippets | ArkGraphics3D/entry/src/main/ets/material/pbr_basic.ets | arkts | setBaseColorChannel | Update a single baseColor channel | setBaseColorChannel(idx: number, value: number) {
if (this.material) {
const color: Vec4 = (this.material as MetallicRoughnessMaterial).baseColor.factor;
if (idx === 0) { color.x = value; }
if (idx === 1) { color.y = value; }
if (idx === 2) { color.z = value; }
if (idx === 3) { color... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setBaseColorChannel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left idx AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#... | setBaseColorChannel(idx: number, value: number) {
if (this.material) {
const color: Vec4 = (this.material as MetallicRoughnessMaterial).baseColor.factor;
if (idx === 0) { color.x = value; }
if (idx === 1) { color.y = value; }
if (idx === 2) { color.z = value; }
if (idx === 3) { color... | https://gitcode.com/HarmonyOS_Samples/guide-snippets | 2e5d056ec3ba665e0f904dbc599e1393ac1d26f6 | gitcode |
Tlntin/home-cloud-shield | entry/src/main/ets/serviceextability/MyVpnExtAbility.ets | arkts | dnsCaptureRouteIps | The full, de-duplicated list of resolver IPs to capture via host routes:
the built-in public resolvers plus the underlying network's current DNS
servers. Our own tun/DNS addresses and loopback are excluded. | private dnsCaptureRouteIps(underlyingDnsIps: string[]): string[] {
const skip: string[] = [DNS_SERVER_IP, DNS_SERVER_IPV6, TUN_ADDRESS_IP, TUN_ADDRESS_IPV6];
const out: string[] = [];
const consider = (raw: string): void => {
const ip: string = raw.trim();
if (ip.length === 0 || skip.includes(... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left dnsCaptureRouteIps AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left underlyingDnsIps AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left st... | private dnsCaptureRouteIps(underlyingDnsIps: string[]): string[] {
const skip: string[] = [DNS_SERVER_IP, DNS_SERVER_IPV6, TUN_ADDRESS_IP, TUN_ADDRESS_IPV6];
const out: string[] = [];
const consider = (raw: string): void => {
const ip: string = raw.trim();
if (ip.length === 0 || skip.includes(... | https://github.com/Tlntin/home-cloud-shield/blob/bfd8d549ccb3e55bdfc30fa7687b31d52e4c1cc0/entry/src/main/ets/serviceextability/MyVpnExtAbility.ets#L616-L635 | 9b25b6b687ec18d8874d2e3421d15c1a4c86f462 | github |
2763981847/Clock-Alarm | entry/src/main/ets/pages/StopwatchPage.ets | arkts | onStateChange | 监听计时器状态变化 | onStateChange() {
switch (this.state) {
case 0:
this.textTimerController.reset();
this.startOrPauseImage = $r('app.media.ic_play');
break;
case 1:
this.textTimerController.start();
this.startOrPauseImage = $r('app.media.ic_pause');
this.resetOrFlagImage ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onStateChange 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... | onStateChange() {
switch (this.state) {
case 0:
this.textTimerController.reset();
this.startOrPauseImage = $r('app.media.ic_play');
break;
case 1:
this.textTimerController.start();
this.startOrPauseImage = $r('app.media.ic_pause');
this.resetOrFlagImage ... | https://github.com/2763981847/Clock-Alarm | 0087d7011724a3484b812db3fefb097c8c30e433 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/DataView.ets | arkts | getUint32 | Read bytes as they represent given type
@param { int } byteOffset zero index to read
@param { boolean } [ littleEndian ] read as little or big endian
@returns { number }
@throws { RangeError } - Input parameter error.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public getUint32(byteOffset: int, littleEndian?: boolean): number {
if (littleEndian !== undefined && littleEndian.valueOf() == true) {
return this.getUint32Little(byteOffset)
} else {
return this.getUint32Big(byteOffset)
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getUint32 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifi... | public getUint32(byteOffset: int, littleEndian?: boolean): number {
if (littleEndian !== undefined && littleEndian.valueOf() == true) {
return this.getUint32Little(byteOffset)
} else {
return this.getUint32Big(byteOffset)
}
} | https://gitcode.com/iop123123/arkts-static-skills | 070d061877ba7cf2948a36b85f7ca1c2ac0fafda | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets | arkts | restoreOnlineData | 恢复在线数据 | private async restoreOnlineData(data: OnlineDataBackupSection): Promise<void> {
const comics = data.comics as OnlineComicBackup[] | undefined;
const readHistory = data.readHistory as OnlineReadHistoryBackup[] | undefined;
const failures: string[] = [];
logger.info(TAG, `Restoring online data: ${comic... | 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 restoreOnlineData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Lef... | private async restoreOnlineData(data: OnlineDataBackupSection): Promise<void> {
const comics = data.comics as OnlineComicBackup[] | undefined;
const readHistory = data.readHistory as OnlineReadHistoryBackup[] | undefined;
const failures: string[] = [];
logger.info(TAG, `Restoring online data: ${comic... | https://github.com/DaLongZhuaZi/manxia | f852ca1531ee8d697a782ccdb5e43bb45badc39a | github |
hefengbao/jingmo-for-HarmonyOS | features/bookmark/src/main/ets/model/Bookmark.ets | arkts | parse | @throws | function parse(resultSet: relationalStore.ResultSet): Bookmark {
return new Bookmark(
resultSet.getLong(resultSet.getColumnIndex('id')),
resultSet.getLong(resultSet.getColumnIndex('bookmarkable_id')),
resultSet.getString(resultSet.getColumnIndex('bookmarkable_model')),
)
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left parse AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left resultSet AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right... | function parse(resultSet: relationalStore.ResultSet): Bookmark {
return new Bookmark(
resultSet.getLong(resultSet.getColumnIndex('id')),
resultSet.getLong(resultSet.getColumnIndex('bookmarkable_id')),
resultSet.getString(resultSet.getColumnIndex('bookmarkable_model')),
)
} | https://github.com/hefengbao/jingmo-for-HarmonyOS | 00e64a8af6e1f2f74671126eb83075628298456c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebDAV/WebDAVClient.ets | arkts | stat | 获取文件/目录信息 | async stat(remotePath: string): Promise<WebDAVFile | null> {
try {
const url = this.getFullUrl(remotePath);
logger.info(TAG, `获取文件信息: ${url}`);
const result = await this.sendRequest('HEAD', url);
if (result.statusCode !== 200 && result.statusCode !== 207) {
return nul... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left stat AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left remotePath AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | async stat(remotePath: string): Promise<WebDAVFile | null> {
try {
const url = this.getFullUrl(remotePath);
logger.info(TAG, `获取文件信息: ${url}`);
const result = await this.sendRequest('HEAD', url);
if (result.statusCode !== 200 && result.statusCode !== 207) {
return nul... | https://github.com/DaLongZhuaZi/manxia | d037d3f492f5944f7ccb1266aa9b8d6bb63cf83f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Workflow/WorkflowExecutor.ets | arkts | executeTransformStep | 执行转换步骤 | private executeTransformStep(
step: WorkflowStep,
context: WorkflowContext,
inputData: Object
): Object {
let result = inputData;
// 应用简繁转换能力
if (this.capabilities.hasCapabilityInContext(context, 'chineseConverter')) {
result = this.capabilities.applyChineseConverter(result as Record<... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left executeTransformStep AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left step AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi... | private executeTransformStep(
step: WorkflowStep,
context: WorkflowContext,
inputData: Object
): Object {
let result = inputData;
// 应用简繁转换能力
if (this.capabilities.hasCapabilityInContext(context, 'chineseConverter')) {
result = this.capabilities.applyChineseConverter(result as Record<... | https://github.com/DaLongZhuaZi/manxia | bfa4239b237d8bcf1653b1d968339b1a15386e0c | github |
openharmony/codelabs | ETSUI/PassNote/entry/src/main/ets/common/ScheduleData.ets | arkts | init | 初始化管理器
@param context 应用上下文 | static init(context: common.UIAbilityContext): void {
if (!context) {
console.error('ScheduleManager: Context is null during init.');
return;
}
ScheduleManager.context = context;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left init AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#E... | static init(context: common.UIAbilityContext): void {
if (!context) {
console.error('ScheduleManager: Context is null during init.');
return;
}
ScheduleManager.context = context;
} | https://gitcode.com/openharmony/codelabs | 51ba1232d129ea39becd79e87ce3ba1cdc76f3dc | gitcode |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test23_original_index.ets | arkts | testRethrow | --- Re-throw pattern --- | function testRethrow(): string {
try {
try {
throw new AppError('fail', 500);
} catch (e) {
let appErr: AppError = e as AppError;
if (appErr.code >= 500) {
throw appErr;
}
return 'handled';
}
} catch (e) {
let appErr: AppError = e as AppError;
return appErr.... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testRethrow AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type... | function testRethrow(): string {
try {
try {
throw new AppError('fail', 500);
} catch (e) {
let appErr: AppError = e as AppError;
if (appErr.code >= 500) {
throw appErr;
}
return 'handled';
}
} catch (e) {
let appErr: AppError = e as AppError;
return appErr.... | https://github.com/miaochiahao/ark-ghidra | 93cb12ea99c4620980758e82ea163824d5a803f5 | github |
aimilin6688/KeePassHO | entry/src/main/ets/storage/ftp/FTPStorage.ets | arkts | listDir | 获取目录内容 | public async listDir(path: string): Promise<Array<FileInfo>> {
try {
const handler = await this.ensureConnected();
const fullPath = this.getFullPath(path);
const files = await handler.listDir(fullPath);
const result = new Array<FileInfo>();
for (const file of files) {
result... | 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 listDir AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Rig... | public async listDir(path: string): Promise<Array<FileInfo>> {
try {
const handler = await this.ensureConnected();
const fullPath = this.getFullPath(path);
const files = await handler.listDir(fullPath);
const result = new Array<FileInfo>();
for (const file of files) {
result... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/ftp/FTPStorage.ets#L257-L283 | 1e94eb8ab355cbf2cdcfd4e81716642f334aa699 | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/TemplateFactory.ets | arkts | applyTemplateManually | 手动应用模板(回退方案) | private applyTemplateManually(
builder: TemplateBuilder,
template: ITemplate,
options: TemplateApplyOptions
): KdbxEntry {
// 应用标准字段
if (template.standardFields) {
builder.withStandardFields(template.standardFields);
}
// 应用自定义字段
if (template.customFields && template.customFie... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left applyTemplateManually AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left builder AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#iden... | private applyTemplateManually(
builder: TemplateBuilder,
template: ITemplate,
options: TemplateApplyOptions
): KdbxEntry {
// 应用标准字段
if (template.standardFields) {
builder.withStandardFields(template.standardFields);
}
// 应用自定义字段
if (template.customFields && template.customFie... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateFactory.ets#L105-L136 | 479972013064c8926d1492412b5034a24a726635 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | internal | Creates a slice of current BigUint64Array using range [begin, end)
@param begin start index to be taken into slice
@param end last index to be taken into slice
@returns a new BigUint64Array with elements of current BigUint64Array[begin;end) where end index is excluded
@link https://developer.mozilla.org/en-US/docs/Web/... | /* public */ internal slice(begin: int, end: int): BigUint64Array
{
if (begin < -this.length) {
begin = 0
}
if (begin < 0) {
begin = this.length + begin
}
if (begin >= this.length) {
return new BigUint64Array(new ArrayBuffer(0))
... | AST#program#Left AST#comment#Left /* public */ AST#comment#Right AST#ERROR#Left AST#call_expression#Left AST#identifier#Left internal AST#identifier#Right AST#ERROR#Left AST#identifier#Left slice AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left begin AST#identifier#Ri... | /* public */ internal slice(begin: int, end: int): BigUint64Array
{
if (begin < -this.length) {
begin = 0
}
if (begin < 0) {
begin = this.length + begin
}
if (begin >= this.length) {
return new BigUint64Array(new ArrayBuffer(0))
... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | ec8d124ea3aea6c3ff96f5cfd072a814925e0abf | gitee |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/mouse/MouseCursorPlugin.ets | arkts | destroy | Detaches the text input plugin from the platform views controller;
<p> The MouseCursorPlugin instance should not be used after call this. | destroy(): void {
this.mouseCursorChannel.setMethodHandler(null);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left destroy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left... | destroy(): void {
this.mouseCursorChannel.setMethodHandler(null);
} | https://gitee.com/openharmony-sig/flutter_engine.git | 68a7b6978009baaeed163033b54aedbf6afdaaf0 | gitee |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnFormViewModel.ets | arkts | setFuncValue | 设置函数校验值
@param value 输入值 | setFuncValue(value: string): void {
this.customRuleForm.funcValue = value;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setFuncValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) A... | setFuncValue(value: string): void {
this.customRuleForm.funcValue = value;
} | https://github.com/codelably/tuniao-ui | 3e5a3c469d93be2acc6045da6570a2e7a27fa8ef | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/BookshelfCategoryManager.ets | arkts | updateCategoryCounts | 更新所有分类的内容数量 | async updateCategoryCounts(): Promise<void> {
// 重置所有分类的计数
this.categories.forEach(c => {
c.itemCount = 0;
});
// 统计每个分类的内容数量
this.itemCategoryMap.forEach((item) => {
const category = this.categories.find(c => c.id === item.categoryId);
if (category) {
category.itemCount... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateCategoryCounts AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST... | async updateCategoryCounts(): Promise<void> {
// 重置所有分类的计数
this.categories.forEach(c => {
c.itemCount = 0;
});
// 统计每个分类的内容数量
this.itemCategoryMap.forEach((item) => {
const category = this.categories.find(c => c.id === item.categoryId);
if (category) {
category.itemCount... | https://github.com/DaLongZhuaZi/manxia | 48b05a19f6d56dbfab602fdef331ed15c7a5ccc0 | github |
openharmony-sig/arkui_composite_component | source/TreeView/TreeView.ets | arkts | on | Event registration and processing.
The event will not be destroyed after being processed.
@param type Registered Events.
@param callback Event callback.
@since 10 | public on(type: TreeListenType, callback: (callbackParam: CallbackParam) => void) {
if (Array.isArray(type)) {
for (let i = 0, l = type.length; i < l; i++) {
this.on(type[i], callback)
}
} else {
(this._events[type] || (this._events[type] = [])).push(callback)
}
... | AST#program#Left AST#ERROR#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left on AST#identifier#Right AST#ERROR#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TreeListenType AST... | public on(type: TreeListenType, callback: (callbackParam: CallbackParam) => void) {
if (Array.isArray(type)) {
for (let i = 0, l = type.length; i < l; i++) {
this.on(type[i], callback)
}
} else {
(this._events[type] || (this._events[type] = [])).push(callback)
}
... | https://gitee.com/openharmony-sig/arkui_composite_component.git | e421f5658f6925384df7d600cf9298991d98f44c | gitee |
Delsin-Yu/JustPDF | entry/src/main/ets/pages/pdfview/PDFAnnotationController.ets | arkts | loadDrawPreferences | 从 stagePersistence 恢复绘制色 / 自定义色槽(在 PDFView 注入 preferences 之后调用)。 | loadDrawPreferences(): void {
const prefs: preferences.Preferences | undefined = this.dependencies.getPreferences();
if (!prefs) {
return;
}
try {
const customRaw: number | string | boolean =
prefs.getSync(AnnotationPrefCustomPdfKey, DefaultCustomAnnotationColor.pdfColor) as number... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadDrawPreferences 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... | loadDrawPreferences(): void {
const prefs: preferences.Preferences | undefined = this.dependencies.getPreferences();
if (!prefs) {
return;
}
try {
const customRaw: number | string | boolean =
prefs.getSync(AnnotationPrefCustomPdfKey, DefaultCustomAnnotationColor.pdfColor) as number... | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/pages/pdfview/PDFAnnotationController.ets#L101-L124 | 979046c7d2377639a2f8918d0e9e943027851214 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/BiosValidator.ets | arkts | validateDsiDirectory | 验证 DSi BIOS 目录 | static validateDsiDirectory(dirPath: string): BiosValidationResult {
if (!dirPath) {
return { consoleType: 'dsi', status: BiosValidationStatus.UNSET, files: [] };
}
return BiosValidator.validateDirectory('dsi', dirPath, BiosValidator.DSI_REQUIRED_FILES);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left validateDsiDirectory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left dirPath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#s... | static validateDsiDirectory(dirPath: string): BiosValidationResult {
if (!dirPath) {
return { consoleType: 'dsi', status: BiosValidationStatus.UNSET, files: [] };
}
return BiosValidator.validateDirectory('dsi', dirPath, BiosValidator.DSI_REQUIRED_FILES);
} | https://github.com/richshaw2015/nds | 9ab6f8202e0cbd5746263475cde8c0a92007f777 | github |
IoTAccessControl/ArkTSAnalysis | TestApps1/1.AccountKit_Codelab_QuickLogin_Clientdemo_ArkTS/entry/src/main/ets/pages/UserInfo.ets | arkts | build | 持卡人姓名 | build() {
Scroll() {
Column() {
// 标题
Text('个人信息登记表')
.fontSize(24)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
.width('100%')
.textAlign(TextAlign.Center)
// 基础信息组
Row() {
// 使用Flex布局确保标签顶格
Text(... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Scroll() {
Column() {
// 标题
Text('个人信息登记表')
.fontSize(24)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
.width('100%')
.textAlign(TextAlign.Center)
// 基础信息组
Row() {
// 使用Flex布局确保标签顶格
Text(... | https://github.com/IoTAccessControl/ArkTSAnalysis | 506c70653fabd7eabe112093dedbff498537c355 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/LocalImageCacheManager.ets | arkts | cancelPreload | 取消指定页面的预加载 | public cancelPreload(pageId: string): void {
const index = this.preloadQueue.findIndex(t => t.pageId === pageId);
if (index >= 0) {
this.preloadQueue.splice(index, 1);
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left cancelPreload AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pageId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | public cancelPreload(pageId: string): void {
const index = this.preloadQueue.findIndex(t => t.pageId === pageId);
if (index >= 0) {
this.preloadQueue.splice(index, 1);
}
} | https://github.com/DaLongZhuaZi/manxia | 4527894f1f50ec27e2a19c87c47ccc98b7b73983 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | subarray | Creates a Int16Array with the same ArrayBuffer
@returns new Int16Array with the same ArrayBuffer | public subarray(): Int16Array {
return this.subarray(0, this.length)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left subarray 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 Int16Array AS... | public subarray(): Int16Array {
return this.subarray(0, this.length)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | b17dc7a6f099d1798ec1de08a3de627300f075b4 | gitee |
arkui-x/samples | CodeLab/Cases/feature/foldablescreencases/src/main/ets/viewmodel/MusicPlayViewModel.ets | arkts | release | 释放播放器资源
@returns {void} | release(): void {
this.avplayerModel.releaseAVPlayer();
this.avsessionModel!.stopContinuousTask();
this.avsessionModel!.destroySession();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left release AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left... | release(): void {
this.avplayerModel.releaseAVPlayer();
this.avsessionModel!.stopContinuousTask();
this.avsessionModel!.destroySession();
} | https://gitcode.com/arkui-x/samples | 3cfb3a9629558e5d27c88674e8491796457fc52d | gitcode |
richshaw2015/nds | ohos/entry/src/test/ThemeManager.test.ets | arkts | generateInvalidThemeId | 生成随机无效主题 ID
@returns 随机的无效主题 ID 字符串 | function generateInvalidThemeId(): string {
const invalidIds = [
'invalid_theme',
'unknown',
'platinum',
'silver',
'PLATINUM_SILVER',
'PlatinumSilver',
'platinum-silver',
'theme_123',
'null',
'undefined',
... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left generateInvalidThemeId 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#pred... | function generateInvalidThemeId(): string {
const invalidIds = [
'invalid_theme',
'unknown',
'platinum',
'silver',
'PLATINUM_SILVER',
'PlatinumSilver',
'platinum-silver',
'theme_123',
'null',
'undefined',
... | https://github.com/richshaw2015/nds | 9642b084fbdac120a05e309c8e26cd8aafddfe35 | github |
Countly/countly-sdk-hos | library/src/main/ets/internal/modules/ModulePush.ets | arkts | clearPushNotificationToken | Unregister the device on the server by sending an empty token. The stored
token is cleared so a later consent grant doesn't resend it. | public async clearPushNotificationToken(): Promise<void> {
if (!this.core.consentModule.hasConsent(CountlyFeature.PUSH) && !this.sendTokenAlways) {
this.config.logger.v('[ModulePush] clearPushNotificationToken, no push consent, skipped');
return;
}
// Send empty token_session to unregister.
... | 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 clearPushNotificationToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression... | public async clearPushNotificationToken(): Promise<void> {
if (!this.core.consentModule.hasConsent(CountlyFeature.PUSH) && !this.sendTokenAlways) {
this.config.logger.v('[ModulePush] clearPushNotificationToken, no push consent, skipped');
return;
}
// Send empty token_session to unregister.
... | https://github.com/Countly/countly-sdk-hos | c7964dbc458d6e1307f468bf8f8f9cf422902d4c | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/DeviceSensorService.ets | arkts | getCurrentRotation | 获取当前屏幕旋转角度(用于测试/调试展示) | getCurrentRotation(): number {
return this.getDeviceRotation();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCurrentRotation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#sta... | getCurrentRotation(): number {
return this.getDeviceRotation();
} | https://github.com/AlkaidLab/moonlight-harmony | 36c29746effe46a22535eaf172d8ce6f2193e7b4 | github |
CLMC2025/Vignette | entry/src/main/ets/context/OfflineContext.ets | arkts | hasWord | 检查词汇是否在数据库中 | hasWord(word: string): boolean {
return this.wordDatabase.has(word.toLowerCase());
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasWord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left word AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)#R... | hasWord(word: string): boolean {
return this.wordDatabase.has(word.toLowerCase());
} | https://github.com/CLMC2025/Vignette | 00b1b6ec95d87e1b9351b0feb8e8568f46fb8a69 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Database/DatabaseManager.ets | arkts | createGenericRecordFromResultSet | 创建通用记录对象(用于原生SQL查询) | private async createGenericRecordFromResultSet(resultSet: relationalStore.ResultSet): Promise<DatabaseRecord> {
// 创建一个GenericQueryRecord对象,动态填充所有列
const record: GenericQueryRecord = {};
// 直接从ResultSet填充GenericQueryRecord,不使用fillRecordFromResultSet
const columnNames = resultSet.columnNames;
... | 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 createGenericRecordFromResultSet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identi... | private async createGenericRecordFromResultSet(resultSet: relationalStore.ResultSet): Promise<DatabaseRecord> {
// 创建一个GenericQueryRecord对象,动态填充所有列
const record: GenericQueryRecord = {};
// 直接从ResultSet填充GenericQueryRecord,不使用fillRecordFromResultSet
const columnNames = resultSet.columnNames;
... | https://github.com/DaLongZhuaZi/manxia | 2bfc1cbd372b836e98241834326a8159ba5ddb01 | github |
openharmony-sig/applications_inputmethod | entry/src/main/ets/model/InputHandler.ets | arkts | deleteBackward | 删除事件处理 | public deleteBackward(length: number) {
this.addLog('deleteBackward')
console.log('may--->delete222:'+this.selStr.length)
if (this.curFenciPy.length > 0) {
console.log('may--->delete111:'+this.selStr.length)
//删除末尾字符处理
this.selStr = this.selStr.substr(0,this.selStr.length - length)
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left deleteBackward AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left length AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | public deleteBackward(length: number) {
this.addLog('deleteBackward')
console.log('may--->delete222:'+this.selStr.length)
if (this.curFenciPy.length > 0) {
console.log('may--->delete111:'+this.selStr.length)
//删除末尾字符处理
this.selStr = this.selStr.substr(0,this.selStr.length - length)
... | https://gitee.com/openharmony-sig/applications_inputmethod.git | 946cd332f7de92ab12a801934e42fca2d7a0b198 | gitee |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/info/AccessibilityInfo.ets | arkts | getClickInfo | 获取点击是的无障碍播报内容,优先通过clickTextMap获取,如果没有则通过getButtonInfo 获取
@param { string } 默认需要播报的字符.
@return { string } 转换后的无障碍字符串. | public getClickInfo(info?: string): string {
let playStr: string = '';
let playText: Resource | undefined = AccessibilityInfo.clickTextMap.get(this.keyCode as CalcKeyCode);
if (playText !== null && playText !== undefined) {
playStr = AccessibilityInfo.getStrByResource(playText);
} else {
p... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getClickInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left info AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Righ... | public getClickInfo(info?: string): string {
let playStr: string = '';
let playText: Resource | undefined = AccessibilityInfo.clickTextMap.get(this.keyCode as CalcKeyCode);
if (playText !== null && playText !== undefined) {
playStr = AccessibilityInfo.getStrByResource(playText);
} else {
p... | https://gitee.com/openharmony-sig/applications_calculator.git | 5eae32cf9320798f5533cf0b26309cc1439c16d3 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets | arkts | of | -----
Returns Type of value
@param {FixedArray<Object>} v value
@returns {Type} Type instance of this value
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static of(v: FixedArray<Object>): Type {
return ArrayType.getInstance(Class.of(v))
} | 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#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#... | public static of(v: FixedArray<Object>): Type {
return ArrayType.getInstance(Class.of(v))
} | https://gitcode.com/iop123123/arkts-static-skills | e57e0000ad91a708f710193a721d985d801bffd8 | gitcode |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/services/auth/AuthService.ets | arkts | getCookies | 获取 Cookies | getCookies(): string {
return CookieStore.getInstance().getCookieHeader();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCookies AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#statement_b... | getCookies(): string {
return CookieStore.getInstance().getCookieHeader();
} | https://github.com/Amaz1ny/HarmonyDO-public | 02d5aef724dee6cc1eed636f7ecb9ee270bb0921 | github |
iichen-bycode/ArkTsWanandroid | entry/src/main/ets/pages/auth/LoginPage.ets | arkts | build | $r('app.float.size_12') | build() {
Column() {
CommonTopBar({title:"登录"})
Column() {
Image($r('app.media.app_icon'))
.width($r('app.float.size_150'))
.margin({bottom: $r('app.float.size_20')})
TextInput({placeholder:"输入用户名称"})
.margin({bottom: $r('app.float.size_12')})
.... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
CommonTopBar({title:"登录"})
Column() {
Image($r('app.media.app_icon'))
.width($r('app.float.size_150'))
.margin({bottom: $r('app.float.size_20')})
TextInput({placeholder:"输入用户名称"})
.margin({bottom: $r('app.float.size_12')})
.... | https://github.com/iichen-bycode/ArkTsWanandroid | 4fe736ebc548e818577dc4adc668e0057abf63b8 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/renderer/AxisRenderer.ets | arkts | getPaintAxisLabels | Returns the Paint object used for drawing the axis (labels).
@return | public getPaintAxisLabels(): Paint {
return this.mAxisLabelPaint;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getPaintAxisLabels 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 Pai... | public getPaintAxisLabels(): Paint {
return this.mAxisLabelPaint;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 003827e0716ab348d62ad79287014d0a8ba40ab0 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | internal | Checks if specified argument is in BigUint64Array
@param e search element
@param fromIndex start index to search from
@returns true if e is in BigUint64Array, false otherwise
public | /* public */ internal includes(e: BigInt, fromIndex: int): boolean {
for (let i = fromIndex; i < this.length; ++i) {
if (this.at(i) == e) {
return true
}
}
return false
} | AST#program#Left AST#comment#Left /* public */ AST#comment#Right AST#ERROR#Left AST#identifier#Left internal AST#identifier#Right AST#call_expression#Left AST#identifier#Left includes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left e AST#identifier#Right AST#:#Left : ... | /* public */ internal includes(e: BigInt, fromIndex: int): boolean {
for (let i = fromIndex; i < this.length; ++i) {
if (this.at(i) == e) {
return true
}
}
return false
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 32d7240ac69f0a69cf1b5af72ec70da53c553b53 | gitee |
openharmony/applications_permission_manager | permissionmanager/src/main/ets/PermissionSheet/GlobalSwitchSheetDialog.ets | arkts | grantUserGrantedPermission | Grant permissions to the app
@param {Number} accessTokenId
@param {String} permission permission name
@param {Number} index Array index to modify permission status | grantUserGrantedPermission(accessTokenId: number, permission: Permissions, resolve: (value: number) => void) {
abilityAccessCtrl.createAtManager().grantUserGrantedPermission(accessTokenId, permission, Constants.PERMISSION_FLAG)
.then(() => {
resolve(0);
}).catch((error: BusinessError) => {
... | AST#program#Left AST#ERROR#Left AST#identifier#Left grantUserGrantedPermission AST#identifier#Right AST#(#Left ( AST#(#Right AST#identifier#Left accessTokenId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , AST#,#Right AST#ERROR#Left AST#... | grantUserGrantedPermission(accessTokenId: number, permission: Permissions, resolve: (value: number) => void) {
abilityAccessCtrl.createAtManager().grantUserGrantedPermission(accessTokenId, permission, Constants.PERMISSION_FLAG)
.then(() => {
resolve(0);
}).catch((error: BusinessError) => {
... | https://gitee.com/openharmony/applications_permission_manager.git | 13312421264052bb6830970f590c3ebf24164949 | gitee |
IoTAccessControl/ArkTSAnalysis | TestApps1/1.AccountKit_Codelab_QuickLogin_Clientdemo_ArkTS/entry/src/main/ets/pages/PermissionsPage.ets | arkts | stopAVRecording | 停止AVRecorder录制 | stopAVRecording() {
if (!this.avRecorder || !this.isAVRecording) {
return;
}
try {
// 停止录制
this.avRecorder.stop();
this.showToast('录制已停止并保存');
console.info(`${this.logTag}: AVRecording stopped`);
this.isAVRecording = false;
// 释放资源
this.avRecorder.releas... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left stopAVRecording AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Le... | stopAVRecording() {
if (!this.avRecorder || !this.isAVRecording) {
return;
}
try {
// 停止录制
this.avRecorder.stop();
this.showToast('录制已停止并保存');
console.info(`${this.logTag}: AVRecording stopped`);
this.isAVRecording = false;
// 释放资源
this.avRecorder.releas... | https://github.com/IoTAccessControl/ArkTSAnalysis | d5df40607bdd9efbf62ad5de38d3bebd7d3504b7 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/RegExp.ets | arkts | toString | Returns a string representing the regular expression.
@returns { String } The string representation of the regular expression.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public override toString(): String {
return "/" + this.source + "/" + this.flags
} | 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 toString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Le... | public override toString(): String {
return "/" + this.source + "/" + this.flags
} | https://gitcode.com/iop123123/arkts-static-skills | 2fba71a3957e84d895273931c85cf042459afc20 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/json.ets | arkts | stringify | Converts an object to a JavaScript Object Notation (JSON) string.
@param obj: Object An object to be converted.
@returns String - JSON representation of Object | public static stringify(obj: Any): String {
if (obj === undefined) {
return ''
}
if (obj instanceof Function) {
return ''
}
if (obj instanceof JSValue) {
return JSON.stringifyJSValue(obj)
}
return new JSONWriter().writeFast(... | 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 stringify AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#R... | public static stringify(obj: Any): String {
if (obj === undefined) {
return ''
}
if (obj instanceof Function) {
return ''
}
if (obj instanceof JSValue) {
return JSON.stringifyJSValue(obj)
}
return new JSONWriter().writeFast(... | https://gitcode.com/iop123123/arkts-static-skills | 65ca7b4579aededb1b314372830a0f1a822ae658 | gitcode |
Tlntin/home-cloud-shield | entry/src/main/ets/serviceextability/MyVpnExtAbility.ets | arkts | checkNotifyConfigReload | Detect live edits to notify.json (toggle / interval / language) and apply
them: turning the feature off cancels the notification; any other change
forces an immediate refresh so new labels/interval show without a restart. | private checkNotifyConfigReload(): void {
const signature: string = this.notifyConfigSignature();
if (signature === this.lastNotifyConfigSignature) {
return;
}
this.lastNotifyConfigSignature = signature;
this.loadNotifyConfig();
this.appendDebugLog(`==/vpn_ext/notify_config_reload/ enabl... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left checkNotifyConfigReload 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 v... | private checkNotifyConfigReload(): void {
const signature: string = this.notifyConfigSignature();
if (signature === this.lastNotifyConfigSignature) {
return;
}
this.lastNotifyConfigSignature = signature;
this.loadNotifyConfig();
this.appendDebugLog(`==/vpn_ext/notify_config_reload/ enabl... | https://github.com/Tlntin/home-cloud-shield/blob/bfd8d549ccb3e55bdfc30fa7687b31d52e4c1cc0/entry/src/main/ets/serviceextability/MyVpnExtAbility.ets#L1021-L1036 | aeecf15bca450b8f44af731334397e6121c0ce0d | github |
xblLab/HarmonyProjectTemplate | commons/lib_common/src/main/ets/utils/PhoneNumberUtils.ets | arkts | isPhoneNumberValid | 手机号格式是否正确
@param phone
@returns | public static isPhoneNumberValid(phone: string): boolean {
const PHONE_REG = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
return PHONE_REG.test(phone);
} | 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 isPhoneNumberValid AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left phone AST#identifier#Right AST#:#Lef... | public static isPhoneNumberValid(phone: string): boolean {
const PHONE_REG = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
return PHONE_REG.test(phone);
} | https://github.com/xblLab/HarmonyProjectTemplate | 8e311af8303e23b837308f3327df5541303021ce | github |
openharmony-tpc/openharmony_tpc_samples | GSYVideoPlayer-filters/library/src/main/ets/components/mainpage/AvPlayerControl.ets | arkts | bindState | AVPlayer binding event. | async bindState() {
if (this.avPlayer === null) {
return;
}
this.avPlayer.on(Events.STATE_CHANGE, async (state: media.AVPlayerState) => {
let avPlayerStatus: string = state;
if (this.avPlayer === null) {
return;
}
switch (avPlayerStatus) {
case AvPlayerStatu... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left bindState AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Righ... | async bindState() {
if (this.avPlayer === null) {
return;
}
this.avPlayer.on(Events.STATE_CHANGE, async (state: media.AVPlayerState) => {
let avPlayerStatus: string = state;
if (this.avPlayer === null) {
return;
}
switch (avPlayerStatus) {
case AvPlayerStatu... | https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git | 91958ad4314aa3001bfaaf07f4895539693f6f69 | gitee |
openharmony-tpc/VCard | library/src/main/ets/components/VCardParserImpl_V30.ets | arkts | getBase64 | This is only called from handlePropertyValue(), which has already
read the first line of this property. With v3.0, the getNonEmptyLine()
routine has already concatenated all following continuation lines.
The routine is implemented in the V21 parser to concatenate v2.1 style
data blocks, but is unnecessary here. | protected getBase64(firstString:string):string{
return firstString;
} | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left getBase64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left firstString AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST... | protected getBase64(firstString:string):string{
return firstString;
} | https://gitee.com/openharmony-tpc/VCard.git | d6e9e881bb362e574f094ffb8aa538dfd9abfaef | gitee |
richshaw2015/nds | ohos/entry/src/main/ets/utils/NdsRomCache.ets | arkts | getCacheSize | 获取当前缓存大小
Requirements: 2.5, 2.6 | getCacheSize(): SizeUnit {
return this.calculateCacheSize();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCacheSize 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 SizeUnit AST#identifier#Right AST#ERROR#Right AST... | getCacheSize(): SizeUnit {
return this.calculateCacheSize();
} | https://github.com/richshaw2015/nds | 6f5ac90d7d3400634cffad219791263afb857edd | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/SettingsService.ets | arkts | parseScreenCombinationMode | 解析屏幕组合模式 | private parseScreenCombinationMode(modeStr: string): ScreenCombinationMode {
switch (modeStr) {
case '主机默认':
return ScreenCombinationMode.HOST_DEFAULT;
case '不修改':
return ScreenCombinationMode.NO_OPERATION;
case '确保开启':
return ScreenCombinationMode.ENSURE_ACTIVE;
ca... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseScreenCombinationMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left modeStr AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left str... | private parseScreenCombinationMode(modeStr: string): ScreenCombinationMode {
switch (modeStr) {
case '主机默认':
return ScreenCombinationMode.HOST_DEFAULT;
case '不修改':
return ScreenCombinationMode.NO_OPERATION;
case '确保开启':
return ScreenCombinationMode.ENSURE_ACTIVE;
ca... | https://github.com/AlkaidLab/moonlight-harmony | d4906f040afdccf8fe620f1a4da53b0e27e6f878 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/ChartModel.ets | arkts | getCenterOffsets | Returns a recyclable MPPointF instance.
Returns the center of the chart taking offsets under consideration.
(returns the center of the content rectangle)
@return | public getCenterOffsets(): MPPointF | null {
return this.mViewPortHandler.getContentCenter();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getCenterOffsets AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Lef... | public getCenterOffsets(): MPPointF | null {
return this.mViewPortHandler.getContentCenter();
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 2f5a2a36881bf17aea04ea9e9c499dbac683d923 | gitee |
richshaw2015/nds | ohos/entry/src/main/ets/utils/InputProcessor.ets | arkts | resetAxisStates | 重置所有轴状态为中立位置
在手柄断开连接时调用 | resetAxisStates(): void {
this.axisStates.clear()
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left resetAxisStates 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_bl... | resetAxisStates(): void {
this.axisStates.clear()
} | https://github.com/richshaw2015/nds | 54a7f03da352e7d4f63cbb73ca65747203a74928 | github |
wly5556/S1-Orange | entry/src/main/ets/common/component/ImageViewer.ets | arkts | selfScrollFirst | @param directionX 手势是否沿X轴正向
@returns true,当图片的滑动手势需要优先响应(而不是swiper的左右切换) | selfScrollFirst(directionX: boolean) {
const centerX = imgContainerSize.w / 2 + this.translate.X * this.scaleRatio
const width = this.width * this.scaleRatio
const leftTopX = centerX - width / 2
if (width > imgContainerSize.w) {
const minX = imgContainerSize.w - width
if ((leftTopX - minX)... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left selfScrollFirst AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left directionX AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Ri... | selfScrollFirst(directionX: boolean) {
const centerX = imgContainerSize.w / 2 + this.translate.X * this.scaleRatio
const width = this.width * this.scaleRatio
const leftTopX = centerX - width / 2
if (width > imgContainerSize.w) {
const minX = imgContainerSize.w - width
if ((leftTopX - minX)... | https://github.com/wly5556/S1-Orange | 86bcd085616dc0e5946de020b06829eb9c90be6b | github |
openharmony/applications_mms | entry/src/main/ets/pages/settings/settingsController.ets | arkts | advancedSetting | Advanced page redirection | advancedSetting() {
HiLog.i(TAG, 'advancedSetting')
router.push({
uri: 'pages/settings/advancedSettings/advancedSettings'
});
}; | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left advancedSetting AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Le... | advancedSetting() {
HiLog.i(TAG, 'advancedSetting')
router.push({
uri: 'pages/settings/advancedSettings/advancedSettings'
});
}; | https://gitee.com/openharmony/applications_mms.git | ca54c6ed7c2b6102a4689c8bfce264788cd4628c | gitee |
electronicminer/Harmony-Markdown-Editor | entry/src/main/ets/pages/CloudDocsPage.ets | arkts | confirmDeleteDocument | #8 删除文档添加二次确认(CustomDialogController) | confirmDeleteDocument(doc: UserDocument): void {
this.deleteTargetDoc = doc;
this.deleteTargetTitle = doc.getDisplayTitle();
this.deleteConfirmController.open();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left confirmDeleteDocument AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left doc AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left UserDocument AST#identifier#Right A... | confirmDeleteDocument(doc: UserDocument): void {
this.deleteTargetDoc = doc;
this.deleteTargetTitle = doc.getDisplayTitle();
this.deleteConfirmController.open();
} | https://github.com/electronicminer/Harmony-Markdown-Editor | 2af710fa43d270a1d3db51bdf18bde4725654f78 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/Atomics.ets | arkts | fetchSub | Atomically subtracts the given value from the current value and returns the previous value.
This operation is performed as a single atomic action that cannot be interrupted by other threads.
@param { float } val - The value to subtract from the current atomic float value
@returns { float } The previous value before the... | public fetchSub(val: float): float {
let current: float = this.load();
let expected: float = 0;
do {
expected = current;
current = this.compareAndSwap(expected, expected - val);
} while(current != expected)
return expected;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left fetchSub AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left val AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left float AS... | public fetchSub(val: float): float {
let current: float = this.load();
let expected: float = 0;
do {
expected = current;
current = this.compareAndSwap(expected, expected - val);
} while(current != expected)
return expected;
} | https://gitcode.com/iop123123/arkts-static-skills | a75de02323a41daf5a81f5df9be496c2043c4e89 | gitcode |
2763981847/Clock-Alarm | entry/src/main/ets/pages/WorldClockPage.ets | arkts | aboutToDisappear | 在页面即将消失之前调用的方法 | aboutToDisappear() {
// 清除定时器以停止更新当前时间
clearInterval(this.timeInterval);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToDisappear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#L... | aboutToDisappear() {
// 清除定时器以停止更新当前时间
clearInterval(this.timeInterval);
} | https://github.com/2763981847/Clock-Alarm | f1fcd2634b800e695a899475026c7caa8c8d9dc0 | github |
youyeyejie/ZhiXing_ActHub | entry/src/main/ets/app/AppStates.ets | arkts | currentUser | 应用主题偏好。 | get currentUser(): User | null {
return this.currentUserValue;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left currentUser AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#identifi... | get currentUser(): User | null {
return this.currentUserValue;
} | https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/app/AppStates.ets#L171-L173 | 10f8fe5d55535b65f14ae05848d8ffe0cb74c120 | github |
openharmony-sig/commons-cli | library/src/main/ets/components/cli/DefaultParser.ets | arkts | handleUnknownToken | Handles an unknown token. If the token starts with a dash an UnrecognizedOptionException is thrown. Otherwise the
token is added to the arguments of the command line. If the stopAtNonOption flag is set, this stops the parsing and
the remaining tokens are added as-is in the arguments of the command line.
@param token th... | private handleUnknownToken(token: string): void {
if (token.indexOf("-") == 0 && token.length > 1 && !this.stopAtNonOption) {
throw new Error("Unrecognized option: " + token);
}
this.cmd.addArg(token);
if (this.stopAtNonOption) {
this.skipParsing = true;
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleUnknownToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left token AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie... | private handleUnknownToken(token: string): void {
if (token.indexOf("-") == 0 && token.length > 1 && !this.stopAtNonOption) {
throw new Error("Unrecognized option: " + token);
}
this.cmd.addArg(token);
if (this.stopAtNonOption) {
this.skipParsing = true;
}
} | https://gitee.com/openharmony-sig/commons-cli.git | f47c3ff914e59614b60cd5415311d306b8307a2a | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentHashMap.ets | arkts | size | Returns number of Entries with unique keys in the ConcurrentHashMap
@returns { number } number of Entries with unique keys in the ConcurrentHashMap | public override get size(): int {
return this.sizeVal.get();
} | 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#get#Left get AST#get#Right AST#identifier#Left size AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) ... | public override get size(): int {
return this.sizeVal.get();
} | https://gitcode.com/iop123123/arkts-static-skills | 5d1a81198bc5d1ad66cf5727d6c98413966ae16c | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ReadingAnalyticsManager.ets | arkts | setEbookGoal | 设置电子书阅读目标 | public async setEbookGoal(minutes: number): Promise<void> {
this.goalsSettings.ebookGoalMinutes = Math.max(0, minutes);
await this.saveGoalsSettings();
logger.info(TAG, `电子书阅读目标已设置为: ${minutes}分钟`);
} | 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 setEbookGoal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left minutes AST#identifier#Right AST#ERROR#Left AST#:#Left : A... | public async setEbookGoal(minutes: number): Promise<void> {
this.goalsSettings.ebookGoalMinutes = Math.max(0, minutes);
await this.saveGoalsSettings();
logger.info(TAG, `电子书阅读目标已设置为: ${minutes}分钟`);
} | https://github.com/DaLongZhuaZi/manxia | d6267ed44bab3a8e169de6c1c68a8e10544299ba | github |
imperson123/- | Harmonyos-Application/entry/src/main/ets/pages/ChatStore.ets | arkts | messages | 获取消息列表(供LazyForEach使用) | get messages() {
return this.messages;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left messages AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right A... | get messages() {
return this.messages;
} | https://github.com/imperson123/- | 2947fba15337cccf53b22d0b08b3caac55331d61 | github |
David8Idira/AI-OA | packages/harmonyos/commons/src/main/ets/services/KnowledgeService.ets | arkts | deleteDocument | 删除文档
@param documentId 文档ID | async deleteDocument(documentId: string): Promise<ApiResponse<any>> {
return this.client.delete<any>(`/api/v1/knowledge/documents/${documentId}`)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteDocument AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left documentId AST#identifier#Right AST#type_annotation#Left AST#:#L... | async deleteDocument(documentId: string): Promise<ApiResponse<any>> {
return this.client.delete<any>(`/api/v1/knowledge/documents/${documentId}`)
} | https://github.com/David8Idira/AI-OA | f24623dd90b17c0e8459c774e45148ac961811d5 | github |
erosTeam/NextE | shared/src/main/ets/settings/GalleryReadProgressSettings.ets | arkts | flush | Force-persist now (reader exit) so a pending debounced write isn't lost. | static flush(context: common.UIAbilityContext): void {
if (GalleryReadProgressSettings.flushTimer >= 0) {
clearTimeout(GalleryReadProgressSettings.flushTimer)
GalleryReadProgressSettings.flushTimer = -1
}
GalleryReadProgressSettings.persist(context)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left flush AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#... | static flush(context: common.UIAbilityContext): void {
if (GalleryReadProgressSettings.flushTimer >= 0) {
clearTimeout(GalleryReadProgressSettings.flushTimer)
GalleryReadProgressSettings.flushTimer = -1
}
GalleryReadProgressSettings.persist(context)
} | https://github.com/erosTeam/NextE | e2804c1838fb4518a2c0af89ceec6b8442281f3c | github |
openharmony/applications_mms | entry/src/main/ets/service/SettingService.ets | arkts | calculateChecked | Calculate Selected Values
@param mmsList
@param isAllSelect | calculateChecked(simMessageList, isAllSelect) {
let count = 0;
let checkedList = [];
let result: LooseObject = {};
let switchOff = false;
for (let item of simMessageList) {
// If you select all
if (isAllSelect || item.isCbChecked) {
swi... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left calculateChecked AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left simMessageList AST#identifier#Right AST#,#Left , AST#,#Right AST#identifier#Left isAllSelect AST#identifier#Right AST#)#Left )... | calculateChecked(simMessageList, isAllSelect) {
let count = 0;
let checkedList = [];
let result: LooseObject = {};
let switchOff = false;
for (let item of simMessageList) {
// If you select all
if (isAllSelect || item.isCbChecked) {
swi... | https://gitee.com/openharmony/applications_mms.git | 0791d2a94a4ecfc43038c031ce6f14dc0fdf8e47 | gitee |
Joker-x-dev/CoolMallArkTS | core/ui/src/main/ets/component/navdestination/AppNavDestination.ets | arkts | aboutToDisappear | 页面隐藏时的生命周期回调
@returns {void} 无返回值 | aboutToDisappear(): void {
this.viewModel.aboutToDisappear();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToDisappear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | aboutToDisappear(): void {
this.viewModel.aboutToDisappear();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 1220aec97d7b80d1d366b6cf53f2ef18e30322d1 | github |
LongLiveY96/chatcube | entry/src/main/ets/state/AppSettingsStore.ets | arkts | setAssistants | ============================================================================
Assistant —— state 刷新 helpers
============================================================================ | private setAssistants(next: Assistant[]): void {
const state = getAppSettingsState()
state.assistants = next
state.assistantsVersion = state.assistantsVersion + 1
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left setAssistants AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left next AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expre... | private setAssistants(next: Assistant[]): void {
const state = getAppSettingsState()
state.assistants = next
state.assistantsVersion = state.assistantsVersion + 1
} | https://github.com/LongLiveY96/chatcube | 3143618a7b1c69879dc488c2c0e38085641dd557 | github |
aimilin6688/KeePassHO | entry/src/main/ets/storage/onedrive/OneDriveStorage.ets | arkts | read | 读取文件内容
@param path 文件路径
@returns Promise<ArrayBuffer> 文件内容
@throws StorageError | public async read(path: string): Promise<ArrayBuffer> {
if (!this.client) {
hilog.error(DOMAIN, TAG, 'OneDrive not init:%{public}s', JSON.stringify(this.config));
return Promise.reject(new StorageError(StorageErrorCodes.CLIENT_UNDEFINED, 'OneDrive not initialized'));
}
// 检查令牌是否过期
if (thi... | 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 read AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right ... | public async read(path: string): Promise<ArrayBuffer> {
if (!this.client) {
hilog.error(DOMAIN, TAG, 'OneDrive not init:%{public}s', JSON.stringify(this.config));
return Promise.reject(new StorageError(StorageErrorCodes.CLIENT_UNDEFINED, 'OneDrive not initialized'));
}
// 检查令牌是否过期
if (thi... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/onedrive/OneDriveStorage.ets#L160-L181 | 2bf7d535c937d6efba98307d08aced1017fa1306 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceSearchService.ets | arkts | getCachedResults | 获取缓存的搜索结果
@param keyword 搜索关键词
@param author 作者(可选)
@returns 缓存的结果,如果缓存不存在或已过期则返回null | getCachedResults(keyword: string, author?: string): SearchResultCache | null {
const cacheKey = this.getCacheKey(keyword, author);
const cached = this.searchCache.get(cacheKey);
if (!cached) {
return null;
}
// 检查缓存是否过期
if (Date.now() - cached.timestamp > CACHE_EXPIRE_MS) {
... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getCachedResults AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str... | getCachedResults(keyword: string, author?: string): SearchResultCache | null {
const cacheKey = this.getCacheKey(keyword, author);
const cached = this.searchCache.get(cacheKey);
if (!cached) {
return null;
}
// 检查缓存是否过期
if (Date.now() - cached.timestamp > CACHE_EXPIRE_MS) {
... | https://github.com/DaLongZhuaZi/manxia | 822273028fc2d5d63350ebdb15d9c56f864f8683 | github |
openharmony-sig/ohos_circle_indicator | library/src/main/ets/components/MagicScrollTabsIndicator.ets | arkts | comLineColor | 计算贝塞尔线条颜色 | comLineColor(index: number): ResourceColor {
let selectedColor = this.model.getIndicatorColors()[index%this.model.getIndicatorColors().length]
let nextColor : number | string = ''
let offset = Math.abs(this.indicatorOffset / this.model.getViewWidth())
if (index < this.titles.length - 1 && this.indicat... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left comLineColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) A... | comLineColor(index: number): ResourceColor {
let selectedColor = this.model.getIndicatorColors()[index%this.model.getIndicatorColors().length]
let nextColor : number | string = ''
let offset = Math.abs(this.indicatorOffset / this.model.getViewWidth())
if (index < this.titles.length - 1 && this.indicat... | https://gitee.com/openharmony-sig/ohos_circle_indicator.git | cdec0eb86bce123c47d3e23b9490bcd0751036b4 | gitee |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.uri.ets | arkts | encodedUserInfo | Sets Obtains the encoded user information part of the URI.
@param { string } input | set encodedUserInfo(input: string) {
this.uriEntry.setUserInfo(input);
} | AST#program#Left AST#ERROR#Left AST#set#Left set AST#set#Right AST#call_expression#Left AST#identifier#Left encodedUserInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string A... | set encodedUserInfo(input: string) {
this.uriEntry.setUserInfo(input);
} | https://gitcode.com/iop123123/arkts-static-skills | a07500b93ca36058a35630a9430da8531f0f3fc3 | gitcode |
openharmony-sig/applications_clock | common/src/main/ets/manager/FormManager.ets | arkts | getFromInfoSpById | get FromInfo from Sp ById
@return FromInfo | public async getFromInfoSpById(fromId: string): Promise<FormInfo | undefined> {
try {
const preferences = await this.getPreferences();
let formInfoString = await preferences.get(fromId, '');
if (String(formInfoString) !== '') {
const formInfo: FormInfo = JSON.parse(String(formInfoString)... | 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 getFromInfoSpById AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left fromId AST#identifier#Right AST#:#Left... | public async getFromInfoSpById(fromId: string): Promise<FormInfo | undefined> {
try {
const preferences = await this.getPreferences();
let formInfoString = await preferences.get(fromId, '');
if (String(formInfoString) !== '') {
const formInfo: FormInfo = JSON.parse(String(formInfoString)... | https://gitee.com/openharmony-sig/applications_clock.git | c52e57e6c7336cb64081dc42932a506b1a3fda97 | gitee |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/BillManager.ets | arkts | calculateAccountBalanceDelta | 根据账单和账户类型计算余额变动值。 | private static async calculateAccountBalanceDelta(bill: BillBean): Promise<number> {
const account: AccountBean | null = await AccountManager.getAccountByName(bill.account);
if (account === null) {
return 0;
}
if (account.type === AccountTypeEnum.LIABILITY) {
return bill.type === BillTypeE... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left calculateAccountBalanceDelta AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#id... | private static async calculateAccountBalanceDelta(bill: BillBean): Promise<number> {
const account: AccountBean | null = await AccountManager.getAccountByName(bill.account);
if (account === null) {
return 0;
}
if (account.type === AccountTypeEnum.LIABILITY) {
return bill.type === BillTypeE... | https://github.com/ZestBox-18/kitebook-frontend | ca8d33e2188751e702decbdd169556d6764df708 | github |
DaLongZhuaZi/NGF | ngf_framework/src/main/ets/push/facades/PushManagerFacade.ets | arkts | getToken | 获取设备的 Push Token
必须在模块级别配置好 client_id 且绑定了正确的签名证书 | async getToken(): Promise<string | null> {
try {
logger.info(TAG, '开始向华为推送服务器申请 Push Token...');
const pushToken = await pushService.getToken();
logger.info(TAG, 'Push Token 获取成功: ' + String(pushToken.substring(0, 10)) + '...');
return pushToken;
} catch (e) {
logger.error(TAG, '... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getToken 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_typ... | async getToken(): Promise<string | null> {
try {
logger.info(TAG, '开始向华为推送服务器申请 Push Token...');
const pushToken = await pushService.getToken();
logger.info(TAG, 'Push Token 获取成功: ' + String(pushToken.substring(0, 10)) + '...');
return pushToken;
} catch (e) {
logger.error(TAG, '... | https://github.com/DaLongZhuaZi/NGF | c7addb18da70cc979b58a60f4265a31e0cb1c540 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | constructor | Creates an Float64Array from FixedArray<int>
@param { FixedArray<int> } numbers - data initializer
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public constructor(numbers: FixedArray<int>) {
this(numbers.length)
for (let i: int = 0; i < this.lengthInt; ++i) {
this.setUnsafe(i, numbers[i].toDouble())
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left numbers AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_exp... | public constructor(numbers: FixedArray<int>) {
this(numbers.length)
for (let i: int = 0; i < this.lengthInt; ++i) {
this.setUnsafe(i, numbers[i].toDouble())
}
} | https://gitcode.com/iop123123/arkts-static-skills | cb2259bcde52d6d7aeafdf25f229067385837d75 | gitcode |
openharmony/security_privacy_center | entry/src/main/ets/common/utils/AutoMenuManager.ets | arkts | getInstance | To get single instance
@returns The single instance | public static getInstance(): AutoMenuManager {
if (!AutoMenuManager._INSTANCE) {
AutoMenuManager._INSTANCE = new AutoMenuManager();
}
return AutoMenuManager._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(): AutoMenuManager {
if (!AutoMenuManager._INSTANCE) {
AutoMenuManager._INSTANCE = new AutoMenuManager();
}
return AutoMenuManager._INSTANCE;
} | https://gitee.com/openharmony/security_privacy_center.git | 49a30b43d811458407cdb7ae513d682c19ad1971 | gitee |
FinalScave/SweetLine | platform/OHOS/sweetline/src/main/ets/Index.ets | arkts | getLineCharCount | Get the total character count of a specific line | public getLineCharCount(line: number): number {
return lib.Document_GetLineCharCount(this.nativeHandle, line);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLineCharCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left line AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | public getLineCharCount(line: number): number {
return lib.Document_GetLineCharCount(this.nativeHandle, line);
} | https://github.com/FinalScave/SweetLine | 34260cd74f4ef083f21258f0229dedf589a084dc | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/service/ReminderService.ets | arkts | createBudgetReminder | 为预算创建提醒 | static async createBudgetReminder(
userId: number,
budgetId: number,
reminderDate: string,
frequency: 'once' | 'monthly' = 'monthly'
): Promise<number> {
try {
const budget: Budget | null = await BudgetDAO.getById(budgetId);
if (!budget || budget.userId !== userId) {
const er... | 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 createBudgetReminder AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#L... | static async createBudgetReminder(
userId: number,
budgetId: number,
reminderDate: string,
frequency: 'once' | 'monthly' = 'monthly'
): Promise<number> {
try {
const budget: Budget | null = await BudgetDAO.getById(budgetId);
if (!budget || budget.userId !== userId) {
const er... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 8ab60c06eba968946ad6daaa078ebf2dd72c1cc6 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceConfigParser.ets | arkts | getSelectorFromAction | 从操作中获取选择器 | private getSelectorFromAction(action: Action): string | undefined {
switch (action.type) {
case ActionType.WAIT:
return (action as WaitAction).selector;
case ActionType.CLICK:
return (action as ClickAction).selector;
case ActionType.INPUT:
return (action as InputAction).s... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getSelectorFromAction AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident... | private getSelectorFromAction(action: Action): string | undefined {
switch (action.type) {
case ActionType.WAIT:
return (action as WaitAction).selector;
case ActionType.CLICK:
return (action as ClickAction).selector;
case ActionType.INPUT:
return (action as InputAction).s... | https://github.com/DaLongZhuaZi/manxia | 97fbee6b02b322833d539e33bbca2881157aff8a | github |
offlinecat-dev/OCNetORM | src/main/ets/logging/Logger.ets | arkts | setRecordHistory | 启用日志历史记录(用于测试)
@param record 是否记录 | setRecordHistory(record: boolean): void {
this.recordHistory = record
if (!record) {
this.logHistory = []
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setRecordHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left record AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right AST#)#Le... | setRecordHistory(record: boolean): void {
this.recordHistory = record
if (!record) {
this.logHistory = []
}
} | https://github.com/offlinecat-dev/OCNetORM | 796564be183342f31a2a32a257412c9a3c90d281 | github |
guoxiucai/ohos-scrcpy-app | scrcpy_server/entry/src/main/ets/scrcpyservice/AppListProvider.ets | arkts | listRemovableApps | 拉取所有 removable=true 的应用,按 label / bundle 升序。
失败时返回空数组(不抛),由调用方编 0x20/0x10 包发空列表。 | static async listRemovableApps(): Promise<AppEntry[]> {
try {
const flags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION;
const list = await bundleManager.getAllBundleInfo(flags);
const out: AppEntry[] = [];
for (let i = 0; i < list.length; i++) {
const bi = list[i];
... | 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 listRemovableApps AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS... | static async listRemovableApps(): Promise<AppEntry[]> {
try {
const flags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION;
const list = await bundleManager.getAllBundleInfo(flags);
const out: AppEntry[] = [];
for (let i = 0; i < list.length; i++) {
const bi = list[i];
... | https://github.com/guoxiucai/ohos-scrcpy-app | e00d06b1bcdb8137e61e3ea096e8b96bdd9749fb | github |
cpdd5201314/harmonyOS-music-app | products/phone/src/main/ets/pages/PlaylistManager.ets | arkts | getHistory | 获取播放历史 | getHistory(): MusicInfo[] {
return this.historyList;
} | AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier... | getHistory(): MusicInfo[] {
return this.historyList;
} | https://github.com/cpdd5201314/harmonyOS-music-app | 7ceded53bc96a8b974f7fb06b531c250d6954520 | github |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryExecutor.ets | arkts | update | 批量更新(不加载实体)
@param values 更新字段和值(属性名或列名)
@returns 受影响行数 | async update(values: BatchUpdateValues): Promise<number> {
return await this.withStoreLease(async () => {
const startTime = Date.now()
await DatabaseManager.getInstance().acquireQuerySlot()
try {
this.validateMutationQuery('UPDATE')
const resolvedValues = this.resolveUpdateValues... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left update AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left values AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#... | async update(values: BatchUpdateValues): Promise<number> {
return await this.withStoreLease(async () => {
const startTime = Date.now()
await DatabaseManager.getInstance().acquireQuerySlot()
try {
this.validateMutationQuery('UPDATE')
const resolvedValues = this.resolveUpdateValues... | https://github.com/offlinecat-dev/OCNetORM | 4ca7b82bd17fd28de14cb8c5d5e4e7edd7c3184a | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | slice | Creates a slice of current BigInt64Array using range [begin, end)
@param begin start index to be taken into slice
@param end last index to be taken into slice
@returns a new BigInt64Array with elements of current BigInt64Array[begin;end) where end index is excluded
@link https://developer.mozilla.org/en-US/docs/Web/Jav... | public slice(begin: number, end: number): BigInt64Array {
return this.slice(begin as int, end as int)
} | 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#ERROR#Left AST#identifier#Left begin AST#identifier#Right AST#:#Left : AST#:#Right AST#ER... | public slice(begin: number, end: number): BigInt64Array {
return this.slice(begin as int, end as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | e701bdace3043dcde9aa0062730b7ae101f5a9d6 | gitee |
codelably/HCompass | core/di/src/main/ets/ServiceContainer.ets | arkts | resolve | 解析服务实例
@template T 服务类型
@param key 服务标识符
@param default_factory 默认服务工厂函数
@returns 服务实例
@throws 服务未注册时抛出异常 | resolve<T>(key: ServiceKey, default_factory?: ServiceFactory<T>): T {
const instance = this.tryResolve<T>(key);
if (instance !== undefined) {
return instance;
}
if (default_factory === undefined) {
const keyStr = typeof key === 'symbol' ? SymbolToString(key) : key;
throw new Error(`... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left resolve AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#ERROR#Left AST#formal_parameters#Left AST#(#L... | resolve<T>(key: ServiceKey, default_factory?: ServiceFactory<T>): T {
const instance = this.tryResolve<T>(key);
if (instance !== undefined) {
return instance;
}
if (default_factory === undefined) {
const keyStr = typeof key === 'symbol' ? SymbolToString(key) : key;
throw new Error(`... | https://github.com/codelably/HCompass | 04da5dc2a1a52ca9a11e96e5ae96b6b69ee987e0 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test36_original_index.ets | arkts | simpleEmailCheck | --- Regex-free pattern matching (simple email check) --- | function simpleEmailCheck(s: string): boolean {
let atIndex: number = s.indexOf('@');
if (atIndex < 1) {
return false;
}
let dotIndex: number = s.indexOf('.', atIndex);
if (dotIndex < atIndex + 2) {
return false;
}
if (dotIndex >= s.length - 1) {
return false;
}
return true;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left simpleEmailCheck AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left s AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri... | function simpleEmailCheck(s: string): boolean {
let atIndex: number = s.indexOf('@');
if (atIndex < 1) {
return false;
}
let dotIndex: number = s.indexOf('.', atIndex);
if (dotIndex < atIndex + 2) {
return false;
}
if (dotIndex >= s.length - 1) {
return false;
}
return true;
} | https://github.com/miaochiahao/ark-ghidra | 2040bdc3a0ddab49c2eb87193f98012aa8d18bb9 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Components/ConsolePanel.ets | arkts | getPerformanceInfo | 获取性能信息 | getPerformanceInfo(): string {
const systemMetrics = this.performanceMetrics?.systems || [];
const metricsText = systemMetrics
.map((metric) => {
return `${metric.name}: ${metric.averageTime.toFixed(2)} ms`;
})
.join('\n');
return [
'=== 性能信息 ===',
`当前FPS: ${typeof t... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPerformanceInfo 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#sta... | getPerformanceInfo(): string {
const systemMetrics = this.performanceMetrics?.systems || [];
const metricsText = systemMetrics
.map((metric) => {
return `${metric.name}: ${metric.averageTime.toFixed(2)} ms`;
})
.join('\n');
return [
'=== 性能信息 ===',
`当前FPS: ${typeof t... | https://github.com/DaLongZhuaZi/manxia | febde6ca22812f9336a92e8e60d7856d9f89f5bb | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Jsonx.ets | arkts | asLong | Gets an integer value from an object by key.
@param {string} key - The key to look up
@returns {long} The integer value
@throws {JsonTypeError} If the value is not an integer or if this element is not an object
@throws {RangeError} If the key is not found | asLong(): long {
if (this.jsonType != JsonType.JsonNumber) {
throw new JsonTypeError("This value's ValueKind is not Number.")
}
if (this.maybeDoubleValue != undefined) {
throw new JsonTypeError("Expected long, but element contains a double valu... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left asLong 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 long AST#identifier#Right AST#ERROR#Right AST#statement... | asLong(): long {
if (this.jsonType != JsonType.JsonNumber) {
throw new JsonTypeError("This value's ValueKind is not Number.")
}
if (this.maybeDoubleValue != undefined) {
throw new JsonTypeError("Expected long, but element contains a double valu... | https://gitcode.com/iop123123/arkts-static-skills | 8921a9b0050f6f72a752767e608d7d11a0e255ef | gitcode |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnFormViewModel.ets | arkts | submitBasicForm | 提交基础表单 | submitBasicForm(): void {
this.basicController.validate().then((res): void => {
if (res.valid) {
this.validateResultMsg = "验证通过";
} else {
const labels: Array<string> = res.fields.map((item): string => item.label);
this.validateResultMsg = `${labels.join(",")} 验证失败`;
}
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left submitBasicForm 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_bl... | submitBasicForm(): void {
this.basicController.validate().then((res): void => {
if (res.valid) {
this.validateResultMsg = "验证通过";
} else {
const labels: Array<string> = res.fields.map((item): string => item.label);
this.validateResultMsg = `${labels.join(",")} 验证失败`;
}
... | https://github.com/codelably/tuniao-ui | a938f2ff6882c161137f0a31f50c18fda8f29200 | github |
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | notify | notify
@param bleDevice
@param uuid_service
@param uuid_notify
@param useCharacteristicDescriptor
@param callback | public notify(bleDevice: BleDevice, uuid_service: string, uuid_notify: string, useCharacteristicDescriptor: boolean = false, callback: BleNotifyCallback) {
if (callback == null) {
throw new Error("BleNotifyCallback can not be Null!");
}
if (this.multipleBluetoothController !== null) {
let bleB... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left notify AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bleDevice AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left BleD... | public notify(bleDevice: BleDevice, uuid_service: string, uuid_notify: string, useCharacteristicDescriptor: boolean = false, callback: BleNotifyCallback) {
if (callback == null) {
throw new Error("BleNotifyCallback can not be Null!");
}
if (this.multipleBluetoothController !== null) {
let bleB... | https://gitee.com/openharmony-sig/FastBle.git | ca6cfdfdb55d18ded1f7acbd0453e1dfdce01d53 | gitee |
erosTeam/NextE | feature/home/src/main/ets/viewmodel/GalleryListViewModel.ets | arkts | refresh | Pull-to-refresh: replace from the first page. Guarded + flagged isLoading so a concurrent
loadMore (which checks isLoading) can't interleave its appendData with this setData. | async refresh(afterPrepend?: (prependedCount: number) => void): Promise<number> {
DiagnosticLogger.info('home-list-anchor', 'refresh_enter', this.debugState())
if (this.isLoading || this.isLoadingMore) {
DiagnosticLogger.info('home-list-anchor', 'refresh_skip_busy', this.debugState())
return 0
... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left refresh AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#optional_parameter#Left AST#identifier#Left afterPrepend AST#identifier#Right AST#?#Left ? AST#?#Right AST... | async refresh(afterPrepend?: (prependedCount: number) => void): Promise<number> {
DiagnosticLogger.info('home-list-anchor', 'refresh_enter', this.debugState())
if (this.isLoading || this.isLoadingMore) {
DiagnosticLogger.info('home-list-anchor', 'refresh_skip_busy', this.debugState())
return 0
... | https://github.com/erosTeam/NextE | a52f64263d7ec33cab45089247ef8727c1973cc0 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/BarLineChartBaseModel.ets | arkts | moveViewTo | This will move the left side of the current viewport to the specified
x-value on the x-axis, and center the viewport to the specified y value on the y-axis.
This also refreshes the chart by calling invalidate().
@param xValue
@param yValue
@param axis - which axis should be used as a reference for the y-axis | public moveViewTo(xValue: number, yValue: number, axis: AxisDependency): void {
let yInView: number = this.getAxisRange(axis) / this.mViewPortHandler.getScaleY();
const transformer = this.getTransformer(axis);
if (transformer) {
let job: MoveViewJob = MoveViewJob.getInstance(this.mViewPortHandler,... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left moveViewTo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left xValue AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left num... | public moveViewTo(xValue: number, yValue: number, axis: AxisDependency): void {
let yInView: number = this.getAxisRange(axis) / this.mViewPortHandler.getScaleY();
const transformer = this.getTransformer(axis);
if (transformer) {
let job: MoveViewJob = MoveViewJob.getInstance(this.mViewPortHandler,... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 5710c604a785c6a6d7292a0fcc11d69bd5db4a41 | gitee |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/LibFreeRDP.ets | arkts | getConnectionHealth | Get connection health status
Returns: -1=invalid, 0=disconnected, 1=degraded, 2=healthy | static getConnectionHealth(inst: number): number {
if (!LibFreeRDP.ensureNativeReady()) {
return -1;
}
if (inst === 0) {
return -1;
}
try {
return freerdpNative!.freerdpGetConnectionHealth(inst);
} catch (e) {
console.error(`${LibFreeRDP.TAG}: getConnectionHealth error:... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getConnectionHealth 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#L... | static getConnectionHealth(inst: number): number {
if (!LibFreeRDP.ensureNativeReady()) {
return -1;
}
if (inst === 0) {
return -1;
}
try {
return freerdpNative!.freerdpGetConnectionHealth(inst);
} catch (e) {
console.error(`${LibFreeRDP.TAG}: getConnectionHealth error:... | https://github.com/tangwengang-del/freerdp-harmonyos | 295546795394f480e0b6914f9f84a0a8c8c3a463 | github |
openharmony-tpc/ImageKnife | library/src/main/ets/model/ImageKnifeRequest.ets | arkts | addHeader | RequestOption调用header对于的方法 | addHeader(key: string, value: Object) {
this.headers.set(key, value);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left addHeader AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#... | addHeader(key: string, value: Object) {
this.headers.set(key, value);
} | https://gitee.com/openharmony-tpc/ImageKnife.git | 0f633db1cc65e57138261d57b872cb660a7709f3 | gitee |
openharmony/vendor_unionman | unionpi_tiger/sample_hzu/smart_home/app/entry/src/main/ets/filemanager/pages/intelligentscenario.ets | arkts | OpenPwm | 光照太强拉开窗帘 | OpenPwm() {
setInterval(() => {
if (this.isOn2 == true && this.getLightIntensity >= this.getLightValue2) {
this.pwmAngle = 179;
pwm.SetPwmAsync(1, 179).then(); // 最高转到179度,180度会超出阈值
}
}, 1000); // 每隔1s刷新一次
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left OpenPwm AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST... | OpenPwm() {
setInterval(() => {
if (this.isOn2 == true && this.getLightIntensity >= this.getLightValue2) {
this.pwmAngle = 179;
pwm.SetPwmAsync(1, 179).then(); // 最高转到179度,180度会超出阈值
}
}, 1000); // 每隔1s刷新一次
} | https://gitee.com/openharmony/vendor_unionman.git | e6ca19cab4fe8dc5c2de2eb6d1b79ee24e4bdbd6 | gitee |
huaiminqin/TankWar-Master-with-Many-Tasks | util/src/main/ets/services/GameService.ets | arkts | createSupplyTruck | 创建补给车 | static createSupplyTruck(x: number, y: number): Tank {
return {
id: 'supply',
type: TankType.SUPPLY,
position: { x, y },
direction: Direction.UP,
health: 80,
maxHealth: 80,
speed: 1,
isAlive: true
};
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createSupplyTruck 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 n... | static createSupplyTruck(x: number, y: number): Tank {
return {
id: 'supply',
type: TankType.SUPPLY,
position: { x, y },
direction: Direction.UP,
health: 80,
maxHealth: 80,
speed: 1,
isAlive: true
};
} | https://github.com/huaiminqin/TankWar-Master-with-Many-Tasks | c9a14dbde33e3216c9b5d43f91639f385dbe81d6 | github |
Delsin-Yu/JustPDF | entry/src/main/ets/pages/pdfview/PDFViewerViewModel.ets | arkts | getPanClampBounds | 与 clampViewPan 使用同一套公式,供水平滑动翻页判断左右边界 | getPanClampBounds(uiContext: UIContext): PanClampBounds {
const viewSizeVp = pxToVp(this.viewSize, uiContext);
const viewportSizeVp = pxToVp(this.viewportSize, uiContext);
const scaledViewSizeVp = mul(viewSizeVp, this.viewScale);
const boundaryRelaxation = 0.25;
const relaxX = viewportSizeVp.x * b... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPanClampBounds AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uiContext AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left UIContext AST#identifier#Right AS... | getPanClampBounds(uiContext: UIContext): PanClampBounds {
const viewSizeVp = pxToVp(this.viewSize, uiContext);
const viewportSizeVp = pxToVp(this.viewportSize, uiContext);
const scaledViewSizeVp = mul(viewSizeVp, this.viewScale);
const boundaryRelaxation = 0.25;
const relaxX = viewportSizeVp.x * b... | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/pages/pdfview/PDFViewerViewModel.ets#L374-L414 | 4d5f3d6b0305b8e63fd24004b40883b96e9c9881 | github |
kumaleap/ArkSwipeDeck | library/src/main/ets/utils/AnimationUtils.ets | arkts | calculateDistance | 计算两点间距离
@param x1 - 起点X坐标
@param y1 - 起点Y坐标
@param x2 - 终点X坐标
@param y2 - 终点Y坐标
@returns 距离 | static calculateDistance(x1: number, y1: number, x2: number, y2: number): number {
const deltaX: number = x2 - x1;
const deltaY: number = y2 - y1;
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left calculateDistance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x1 AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | static calculateDistance(x1: number, y1: number, x2: number, y2: number): number {
const deltaX: number = x2 - x1;
const deltaY: number = y2 - y1;
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
} | https://github.com/kumaleap/ArkSwipeDeck | dba78703f08aff1d08cf56e986b10b5bc4c27376 | github |
arkui-x/samples | CodeLab/Cases/feature/bluetooth/src/main/ets/viewmodel/AdvertiserBluetoothViewModel.ets | arkts | notifyCharacteristicChanged | 通知链接的客户端特征值发生变化 | notifyCharacteristicChanged(deviceId: string, heartRate: number) {
Log.showInfo(TAG, `notifyCharacteristicChanged: deviceId = ${deviceId}, heartRate = ${heartRate}`);
if (!deviceId) {
Log.showWarn(TAG, `deviceId is null`);
return;
}
if (this.mGattServer) {
try {
let descrip... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left notifyCharacteristicChanged AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#E... | notifyCharacteristicChanged(deviceId: string, heartRate: number) {
Log.showInfo(TAG, `notifyCharacteristicChanged: deviceId = ${deviceId}, heartRate = ${heartRate}`);
if (!deviceId) {
Log.showWarn(TAG, `deviceId is null`);
return;
}
if (this.mGattServer) {
try {
let descrip... | https://gitcode.com/arkui-x/samples | 605d24d41a32b0bca4546cbd887874d70e6838f6 | gitcode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.