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 |
|---|---|---|---|---|---|---|---|---|---|---|
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | includes | Determines whether Int32Array includes a certain element, returning true or false as appropriate
@param { int } searchElement - The element to search for. The search starts at index 0.
@returns { boolean } - true if searchElement is in Int32Array, false otherwise
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public includes(searchElement: int): boolean {
return this.includes(searchElement, 0)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left includes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left searchElement AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identi... | public includes(searchElement: int): boolean {
return this.includes(searchElement, 0)
} | https://gitcode.com/iop123123/arkts-static-skills | c1e2f343d13de14d5f203665bef4db37630ee956 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BigInt.ets | arkts | constructor | Creates a new `BigInt` instance from a double value.
@param { double } d The double value to convert to BigInt. Must be an integer.
@throws { RangeError } Throw RangeError when d is not an integer or d is not a safe integer.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | constructor(d: double) {
// should we cast it to long at then use internal helper?
// i.e. like this: this.bytes = BigInt.fromLongHelper(d as long, 64)
if (!d.isInteger()) {
throw new RangeError(`the Double value ${d} cannot be converted to a BigInt because it is not an integer`)... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left d AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left double AST#identifier#Right AST#... | constructor(d: double) {
// should we cast it to long at then use internal helper?
// i.e. like this: this.bytes = BigInt.fromLongHelper(d as long, 64)
if (!d.isInteger()) {
throw new RangeError(`the Double value ${d} cannot be converted to a BigInt because it is not an integer`)... | https://gitcode.com/iop123123/arkts-static-skills | 8c3a3d0fb58840c7266bcdc5643125ae3c9d5743 | gitcode |
Countly/countly-sdk-hos | library/src/main/ets/internal/Network.ets | arkts | describeError | Pretty-print an unknown error for the failure log. HMOS HTTP
rejections are `BusinessError` instances with `code` + `message`;
the default `${err}` template interpolation prints `[object
Object]`, which is useless for debugging. Try structured fields
first, then `toString`, then JSON, then a fixed "unknown" sentinel. | private static describeError(err: Object): string {
if (err === null || err === undefined) return 'unknown';
const rec: Record<string, Object> = err as Record<string, Object>;
const code: Object | undefined = rec['code'];
const message: Object | undefined = rec['message'];
if (message !== undefine... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left describeError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left err AST#identifier#Right AST#:#Left : ... | private static describeError(err: Object): string {
if (err === null || err === undefined) return 'unknown';
const rec: Record<string, Object> = err as Record<string, Object>;
const code: Object | undefined = rec['code'];
const message: Object | undefined = rec['message'];
if (message !== undefine... | https://github.com/Countly/countly-sdk-hos | 227e1f9590a5cfbe40616413b7b8f78a6f33dae0 | github |
HarmonyOS_Samples/scankit-samplecode-clientdemo-arkts | products/phone/src/main/ets/pages/customScan/view/CommonCodeLayout.ets | arkts | multiAppear | Multi-code scanning result animation: 0 - 600ms stop(500ms) breath: Loop-scale: 1-0.8-1(600ms)-0.8-1(600ms)-stop(400ms)
0 - 350ms opacity:0-1 scale:0.3 - 1.1 multiAppear()
350ms - 600ms scale: 1.1 - 1 multiAppearEnd() | multiAppear(): void {
this.multiCodeScale = 0.3;
UIContextSelf.uiContext.animateTo({
duration: 350,
curve: curves.cubicBezierCurve(0.33, 0, 0.67, 1), // Animation curve.
delay: 0,
iterations: 1,
playMode: PlayMode.Alternate,
onFinish: () => {
this.multiAppearEnd();
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left multiAppear 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#... | multiAppear(): void {
this.multiCodeScale = 0.3;
UIContextSelf.uiContext.animateTo({
duration: 350,
curve: curves.cubicBezierCurve(0.33, 0, 0.67, 1), // Animation curve.
delay: 0,
iterations: 1,
playMode: PlayMode.Alternate,
onFinish: () => {
this.multiAppearEnd();
... | https://gitcode.com/HarmonyOS_Samples/scankit-samplecode-clientdemo-arkts | cfcc7b0487b4bf1394b4c4981f3b7e0906f8621e | gitcode |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/RDPInputHandler.ets | arkts | handlePanGesture | 处理拖拽手势 | private handlePanGesture(event: TouchEvent) {
if (this.isScrollMode) {
// 滚动模式
const touch = event.touches[0]
this.sendInputEvent({
type: 'mouse',
x: Math.floor(touch.x),
y: Math.floor(touch.y),
button: 4, // 滚轮
flags: 0x0400
})
} else {
//... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handlePanGesture AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | private handlePanGesture(event: TouchEvent) {
if (this.isScrollMode) {
// 滚动模式
const touch = event.touches[0]
this.sendInputEvent({
type: 'mouse',
x: Math.floor(touch.x),
y: Math.floor(touch.y),
button: 4, // 滚轮
flags: 0x0400
})
} else {
//... | https://github.com/AetheriumSimulator/qemu-hmos | e2d0e8bbf149710fc9e33a9f9ef011d517c0279c | github |
PollenWang6/HiXD | entry/src/main/ets/services/CasLoginService.ets | arkts | aesEncryptBase64 | AES-CBC 加密 → Base64 | private async aesEncryptBase64(data: Uint8Array, key16: Uint8Array, iv16: Uint8Array): Promise<string> {
const symKeyGenerator: cryptoFramework.SymKeyGenerator =
cryptoFramework.createSymKeyGenerator('AES128');
const keyBlob: cryptoFramework.DataBlob = { data: key16 };
const symKey: cryptoFramework.... | 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 aesEncryptBase64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left... | private async aesEncryptBase64(data: Uint8Array, key16: Uint8Array, iv16: Uint8Array): Promise<string> {
const symKeyGenerator: cryptoFramework.SymKeyGenerator =
cryptoFramework.createSymKeyGenerator('AES128');
const keyBlob: cryptoFramework.DataBlob = { data: key16 };
const symKey: cryptoFramework.... | https://github.com/PollenWang6/HiXD | f7d7382650484e0f7b38c2bb26f165a9acfb556f | github |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/theme-chalk/color.type.ets | arkts | value | 返回自定义颜色值
@returns 自定义 hex 颜色字符串 | value(): ResourceColor {
return this.customHexColor;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left value 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 ResourceColor AST#identifier#Right AST#ERROR#Right AST#s... | value(): ResourceColor {
return this.customHexColor;
} | https://github.com/codelably/tuniao-ui | af9a64cfd97192cadeff4db09ebc989c77c76e2a | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/system/windows/classes/meowUiHost.ets | arkts | updateWindowBackgroundColor | Updates the background color for the window. | updateWindowBackgroundColor() {
let color = getColor(meowThemeColorType.SECONDARY) as ResourceColor as string;
if (useEffects()) {
if (getCreateMyApp().dark) {
color = '#ff000000'; // Set all black
} else {
color = '#ffffffff'; // Set all white
}
}
try {
this.wi... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateWindowBackgroundColor 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#statem... | updateWindowBackgroundColor() {
let color = getColor(meowThemeColorType.SECONDARY) as ResourceColor as string;
if (useEffects()) {
if (getCreateMyApp().dark) {
color = '#ff000000'; // Set all black
} else {
color = '#ffffffff'; // Set all white
}
}
try {
this.wi... | https://github.com/awaLiny2333/LinysBrowser_NEXT | a012e99f79a4ba59e5a6d3f2c7ea7eb4c7f2aa74 | github |
Joker-x-dev/CoolMallArkTS | core/designsystem/src/main/ets/component/Column.ets | arkts | build | 渲染布局
@returns {void} 无返回值
@example
ColumnSpaceBetweenStart() { Text("A"); Text("B"); } | build(): void {
ColumnBase({
options: this.options,
justifyContent: FlexAlign.SpaceBetween,
alignItems: HorizontalAlign.Start,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.m... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#... | build(): void {
ColumnBase({
options: this.options,
justifyContent: FlexAlign.SpaceBetween,
alignItems: HorizontalAlign.Start,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.m... | https://github.com/Joker-x-dev/CoolMallArkTS | 6a9ea30c0bdc52e2f8f5cc5d251ea8fd862c2c83 | github |
LZZLHY/hlib | entry/src/main/ets/viewmodel/UpdateChecker.ets | arkts | currentVersionCode | 本地 versionCode(与 app.json5 一致)。失败回退 0。 | static async currentVersionCode(): Promise<number> {
try {
const info: bundleManager.BundleInfo = await bundleManager.getBundleInfoForSelf(
bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT,
);
return info.versionCode;
} catch (e) {
Logger.w(TAG, `read versionCode failed: ${(e a... | 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 currentVersionCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A... | static async currentVersionCode(): Promise<number> {
try {
const info: bundleManager.BundleInfo = await bundleManager.getBundleInfoForSelf(
bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT,
);
return info.versionCode;
} catch (e) {
Logger.w(TAG, `read versionCode failed: ${(e a... | https://github.com/LZZLHY/hlib | 9afaf37e7d42d657fcebdf849fa2c894b799c271 | github |
killetom/ktretrofit | ktretrofit/src/main/ets/retrofit/Retrofit.ets | arkts | addHeader | Add a default header to all requests. | addHeader(key: string, value: string): RetrofitBuilder {
this.defaultHeaders[key] = value;
return this;
} | AST#program#Left AST#ERROR#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#,#Left , AST#,#... | addHeader(key: string, value: string): RetrofitBuilder {
this.defaultHeaders[key] = value;
return this;
} | https://github.com/killetom/ktretrofit | edb19a07775e7f2e80533857cd2c99f3b01e2238 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/AudioFocusManager.ets | arkts | setOnAudioFocusLostCallback | Set callback for audio focus lost | static setOnAudioFocusLostCallback(callback: () => void): void {
onAudioFocusLostCallback = callback;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left setOnAudioFocusLostCallback AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#Left AST#... | static setOnAudioFocusLostCallback(callback: () => void): void {
onAudioFocusLostCallback = callback;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 65e6cee808e1817ba0d6c24407cd03087809af1f | github |
dingzhilin1990/zhilinclaw | src/skills/SkillRegistry.ets | arkts | getSkillStats | 获取技能调用统计 | public getSkillStats(name: string): Record<string, any> | null {
const wrapper = this.skills.get(name);
if (!wrapper) return null;
return {
name: wrapper.skill.metadata.name,
version: wrapper.skill.metadata.version,
registeredAt: wrapper.registeredAt,
callCount: wrapper.callCount,... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getSkillStats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left st... | public getSkillStats(name: string): Record<string, any> | null {
const wrapper = this.skills.get(name);
if (!wrapper) return null;
return {
name: wrapper.skill.metadata.name,
version: wrapper.skill.metadata.version,
registeredAt: wrapper.registeredAt,
callCount: wrapper.callCount,... | https://github.com/dingzhilin1990/zhilinclaw | cc1d2e0470942ec489ad40360ed58898e3b51233 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | internal | Creates a Uint16Array with the same ArrayBuffer
@param begin start index, inclusive
@returns new Uint16Array with the same ArrayBuffer
public | /* public */ internal subarray(begin: int): Uint16Array {
return this.subarray(begin, this.length)
} | 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 subarray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left begin AST#identifier#Right AST#ERROR#Left AST#:#Lef... | /* public */ internal subarray(begin: int): Uint16Array {
return this.subarray(begin, this.length)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | b91a5fc402f2394290596f6f0af85b40feb60e53 | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/TouchInputHandler.ets | arkts | constructor | 点击最大时长 | constructor(config?: TouchInputConfig) {
this.nativeInput = nativeLib as NativeInputModule;
this.config = {
sensitivity: config?.sensitivity ?? TouchInputHandler.DEFAULT_SENSITIVITY,
clickThreshold: config?.clickThreshold ?? TouchInputHandler.DEFAULT_CLICK_THRESHOLD,
clickTimeThreshold: conf... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left To... | constructor(config?: TouchInputConfig) {
this.nativeInput = nativeLib as NativeInputModule;
this.config = {
sensitivity: config?.sensitivity ?? TouchInputHandler.DEFAULT_SENSITIVITY,
clickThreshold: config?.clickThreshold ?? TouchInputHandler.DEFAULT_CLICK_THRESHOLD,
clickTimeThreshold: conf... | https://github.com/AlkaidLab/moonlight-harmony | 08e6df7fcdec13a283e0bcb2fe3b42757f0db915 | github |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/views/components/TopicBadges.ets | arkts | getCategorySymbol | 分类 icon -> sys.symbol 映射 | static getCategorySymbol(category: Category, parent: Category | null = null): Resource | null {
const own: string = normalizeFaIconName(category.icon);
let name: string = own;
if (name.length === 0 && parent !== null) {
name = normalizeFaIconName((parent as Category).icon);
}
if (name.length... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCategorySymbol AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left category AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | static getCategorySymbol(category: Category, parent: Category | null = null): Resource | null {
const own: string = normalizeFaIconName(category.icon);
let name: string = own;
if (name.length === 0 && parent !== null) {
name = normalizeFaIconName((parent as Category).icon);
}
if (name.length... | https://github.com/Amaz1ny/HarmonyDO-public | 5818cd279a6ebe9ae562373a4041715f02f0929a | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/microphone/MicrophoneCapturer.ets | arkts | processAudioData | 处理音频数据
累积数据直到达到完整的 Opus 帧大小 | private processAudioData(buffer: ArrayBuffer): void {
if (!this.running || !this.dataCallback) {
return;
}
const data = new Uint8Array(buffer);
let dataOffset = 0;
let remainingBytes = data.length;
while (remainingBytes > 0) {
// 计算当前帧还需要多少字节
const bytesNeeded = Mic... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left processAudioData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buffer AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | private processAudioData(buffer: ArrayBuffer): void {
if (!this.running || !this.dataCallback) {
return;
}
const data = new Uint8Array(buffer);
let dataOffset = 0;
let remainingBytes = data.length;
while (remainingBytes > 0) {
// 计算当前帧还需要多少字节
const bytesNeeded = Mic... | https://github.com/AlkaidLab/moonlight-harmony | b1e3605de3ea014df312bb340190dcbd2ddecd5d | github |
cpdd5201314/harmonyOS-music-app | products/phone/src/main/ets/pages/WYCrypto.ets | arkts | uint8ArrayToHex | Uint8Array 转 HEX 字符串(大写) | private static uint8ArrayToHex(arr: Uint8Array): string {
return Array.from(arr)
.map(byte => byte.toString(16).padStart(2, '0'))
.join('')
.toUpperCase();
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left uint8ArrayToHex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Right AST#:#Left ... | private static uint8ArrayToHex(arr: Uint8Array): string {
return Array.from(arr)
.map(byte => byte.toString(16).padStart(2, '0'))
.join('')
.toUpperCase();
} | https://github.com/cpdd5201314/harmonyOS-music-app | fc49160ab2e538745d9ee42afd39c1b380114a10 | github |
PollenWang6/HiXD | entry/src/main/ets/services/ClassService.ets | arkts | activateAppSession | 激活 app session | private async activateAppSession(appId: string, force: boolean = false): Promise<void> {
if (!force && this.appSessionUrl[appId]) {
console.info(TAG, 'activateAppSession: using cached for ' + appId);
return;
}
const appPath = APP_PATH_MAP.get(appId) || '/jwapp/sys/wdkb';
this.appSessionUr... | 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 activateAppSession AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left appId AST#identifier#Right AST#:#L... | private async activateAppSession(appId: string, force: boolean = false): Promise<void> {
if (!force && this.appSessionUrl[appId]) {
console.info(TAG, 'activateAppSession: using cached for ' + appId);
return;
}
const appPath = APP_PATH_MAP.get(appId) || '/jwapp/sys/wdkb';
this.appSessionUr... | https://github.com/PollenWang6/HiXD | 8ba2725b3cd0eb794097fc09a02068eed6bc90c0 | github |
webabcd/HarmonyDemo | entry/src/main/ets/pages/ui/SystemBarDemo.ets | arkts | enableImmersiveMode | 沉浸式效果 | enableImmersiveMode() {
this.windowClass.setImmersiveModeEnabledState(true)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left enableImmersiveMode 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_bloc... | enableImmersiveMode() {
this.windowClass.setImmersiveModeEnabledState(true)
} | https://github.com/webabcd/HarmonyDemo | ff133243fcf7060769afb5b7807a92a05781de38 | github |
Explore-In-HMOS-Wearable/unit-calculator | entry/src/main/ets/services/PreferencesService.ets | arkts | setPrefillRecord | ─── Prefill record (transient) ──────────────────────────────────────────── | static setPrefillRecord(record: ConversionRecord): void {
AppStorage.setOrCreate<string>(PrefKeys.PREFILL_RECORD, JSON.stringify(record));
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setPrefillRecord 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#Le... | static setPrefillRecord(record: ConversionRecord): void {
AppStorage.setOrCreate<string>(PrefKeys.PREFILL_RECORD, JSON.stringify(record));
} | https://github.com/Explore-In-HMOS-Wearable/unit-calculator | 72ccff94803acee55c050e4e2a0ef043d5644712 | github |
offlinecat-dev/OCNetORM | src/main/ets/query/RelationLoader.ets | arkts | loadManyToMany | 加载 MANY_TO_MANY 关联数据
使用两次查询策略:
1. 先查询中间表获取目标实体 ID 列表
2. 再根据 ID 列表查询目标实体数据
@param entities 主实体数据数组
@param relation 多对多关联关系元数据
@returns 带有关联数据的实体数组 | private async loadManyToMany(
entities: Array<EntityData>,
relation: ManyToManyMetadata,
options: RelationQueryOptions | null = null
): Promise<Array<EntityData>> {
return await this.manyToManySupport.loadManyToMany(entities, relation, options)
} | 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 loadManyToMany AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left entities AST#identi... | private async loadManyToMany(
entities: Array<EntityData>,
relation: ManyToManyMetadata,
options: RelationQueryOptions | null = null
): Promise<Array<EntityData>> {
return await this.manyToManySupport.loadManyToMany(entities, relation, options)
} | https://github.com/offlinecat-dev/OCNetORM | 06f18b56999342028adcd48e7e6453dd70a7159e | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/AnimationSettingsManager.ets | arkts | notifyListeners | 通知所有监听器设置已变化 | private notifyListeners(): void {
const settings = this.getSettings();
this.listeners.forEach(listener => {
try {
listener(settings);
} catch (error) {
logger.error(TAG, '监听器回调执行失败', String(error));
}
});
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left notifyListeners 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#... | private notifyListeners(): void {
const settings = this.getSettings();
this.listeners.forEach(listener => {
try {
listener(settings);
} catch (error) {
logger.error(TAG, '监听器回调执行失败', String(error));
}
});
} | https://github.com/DaLongZhuaZi/manxia | 54b325f7ad6105197492e39c47211fd49199c329 | github |
kumaleap/ArkSwipeDeck | library/src/main/ets/utils/GestureUtils.ets | arkts | getSwipeDirection | 判断滑动方向
@param state - 手势状态
@returns 滑动方向 | static getSwipeDirection(state: GestureState): SwipeDirection {
const absX: number = Math.abs(state.deltaX);
const absY: number = Math.abs(state.deltaY);
if (absX > absY) {
return state.deltaX > 0 ? SwipeDirection.RIGHT : SwipeDirection.LEFT;
} else {
return state.deltaY > 0 ? SwipeDirect... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getSwipeDirection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left state AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | static getSwipeDirection(state: GestureState): SwipeDirection {
const absX: number = Math.abs(state.deltaX);
const absY: number = Math.abs(state.deltaY);
if (absX > absY) {
return state.deltaX > 0 ? SwipeDirection.RIGHT : SwipeDirection.LEFT;
} else {
return state.deltaY > 0 ? SwipeDirect... | https://github.com/kumaleap/ArkSwipeDeck | 74cd99de7ba6fc8e9875c8f217700c6169759d17 | github |
webabcd/HarmonyDemo | entry/src/main/ets/pages/component/display/DataPanelDemo.ets | arkts | applyContent | 返回指定的自定义 DataPanel | applyContent () : WrappedBuilder<[DataPanelConfiguration]> {
return wrapBuilder(buildDataPanel)
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left applyContent 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... | applyContent () : WrappedBuilder<[DataPanelConfiguration]> {
return wrapBuilder(buildDataPanel)
} | https://github.com/webabcd/HarmonyDemo | ff9da8ddac7cc7cf4ce9c68669b5c40efbd9e6ae | github |
LongLiveY96/chatcube | entry/src/main/ets/services/PreferencesService.ets | arkts | getNotifyOnFailed | 获取“失败时通知”开关 | async getNotifyOnFailed(): Promise<boolean> {
return await this.getBoolean(PreferenceKeys.NOTIFY_ON_FAILED, true)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getNotifyOnFailed AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#ge... | async getNotifyOnFailed(): Promise<boolean> {
return await this.getBoolean(PreferenceKeys.NOTIFY_ON_FAILED, true)
} | https://github.com/LongLiveY96/chatcube | ca440e8119ad33d7d8b11952473f7bc75d6b18df | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoUrlAnalyzer.ets | arkts | executeJsSimple | 简单JS执行(同步,不依赖WebView)
处理简单的字符串拼接、变量替换、数学表达式等 | private executeJsSimple(jsCode: string, currentResult?: string): string | null {
try {
let code = jsCode.trim();
const resultValue = currentResult !== undefined ? currentResult : (this.variables.get('result') || '');
// 处理 cookie.removeCookie() - 这是一个副作用函数,直接返回空字符串
// 书源中常用于清除cookie... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left executeJsSimple AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left jsCode AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | private executeJsSimple(jsCode: string, currentResult?: string): string | null {
try {
let code = jsCode.trim();
const resultValue = currentResult !== undefined ? currentResult : (this.variables.get('result') || '');
// 处理 cookie.removeCookie() - 这是一个副作用函数,直接返回空字符串
// 书源中常用于清除cookie... | https://github.com/DaLongZhuaZi/manxia | 5c501c6ebd86c2ca6664d864b96af7e9c17f96df | github |
Explore-In-HMOS-Wearable/unit-calculator | entry/src/main/ets/services/PreferencesService.ets | arkts | saveLastUsed | ─── Last-used (global) ──────────────────────────────────────────────────── | static saveLastUsed(category: string, fromUnit: AnyUnit, toUnit: AnyUnit): void {
AppStorage.setOrCreate<string>(PrefKeys.LAST_CATEGORY, category);
AppStorage.setOrCreate<string>(PrefKeys.LAST_FROM_UNIT, fromUnit);
AppStorage.setOrCreate<string>(PrefKeys.LAST_TO_UNIT, toUnit);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left saveLastUsed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left category AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#R... | static saveLastUsed(category: string, fromUnit: AnyUnit, toUnit: AnyUnit): void {
AppStorage.setOrCreate<string>(PrefKeys.LAST_CATEGORY, category);
AppStorage.setOrCreate<string>(PrefKeys.LAST_FROM_UNIT, fromUnit);
AppStorage.setOrCreate<string>(PrefKeys.LAST_TO_UNIT, toUnit);
} | https://github.com/Explore-In-HMOS-Wearable/unit-calculator | fc35f5dfefefdcda10c64e69c1ccf8a264697a86 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | internal | Creates a slice of current Uint32Array using range [begin, this.length).
@param begin start index to be taken into slice
@returns a new Uint32Array with elements of current Uint32Array[begin, this.length)
public | /* public */ internal slice(begin: int): Uint32Array {
return this.slice(begin, this.length)
} | 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): Uint32Array {
return this.slice(begin, this.length)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 2a7f3bd48e1bc610e012d969d4c87c9bf820fdef | gitee |
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | requestConnectionPriority | requestConnectionPriority
@param connectionPriority Request a specific connection priority. Must be one of
{@link BluetoothGatt#CONNECTION_PRIORITY_BALANCED},
{@link BluetoothGatt#CONNECTION_PRIORITY_HIGH}
or {@link BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER}.
@throws IllegalArgumentException If the parameters are out... | public requestConnectionPriority(bleDevice: BleDevice, connectionPriority: number): boolean {
// let bleBluetooth: BleBluetooth = this.multipleBluetoothController.getBleBluetooth(bleDevice);
// if (bleBluetooth == null) {
// return false;
// } else {
// r... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left requestConnectionPriority 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#i... | public requestConnectionPriority(bleDevice: BleDevice, connectionPriority: number): boolean {
// let bleBluetooth: BleBluetooth = this.multipleBluetoothController.getBleBluetooth(bleDevice);
// if (bleBluetooth == null) {
// return false;
// } else {
// r... | https://gitee.com/openharmony-sig/FastBle.git | 12c2af3a6e025ef80fdc9cec1a2c284914125d52 | gitee |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/model/RemoteHost.ets | arkts | getDefaultPort | 获取协议默认端口 | static getDefaultPort(protocol: string): number {
if (protocol === 'rustdesk') { return 21116; }
if (protocol === 'ssh') { return 22; }
return 3389;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getDefaultPort AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left protocol AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string... | static getDefaultPort(protocol: string): number {
if (protocol === 'rustdesk') { return 21116; }
if (protocol === 'ssh') { return 22; }
return 3389;
} | https://github.com/Mydstiny/RemoteDeskHarmonyOS | 42412a9788f3e42489c1c3b13a10a8729c301580 | github |
midori52000/ArkPilot | Agent/entry/src/main/ets/skills/SkillsBackendService.ets | arkts | downloadRepoViaApi | 通过 GitHub API 逐文件下载仓库内容(不依赖 ZIP 解压) | private async downloadRepoViaApi(repo: SkillRepo, destDir: string, branch: string): Promise<boolean> {
const treeUrl = `https://api.github.com/repos/${repo.owner}/${repo.name}/git/trees/${branch}?recursive=1`;
try {
const httpRequest = http.createHttp();
const treeResponse = await httpRequest.requ... | 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 downloadRepoViaApi AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left repo AST#identifier#Right AST#:#Le... | private async downloadRepoViaApi(repo: SkillRepo, destDir: string, branch: string): Promise<boolean> {
const treeUrl = `https://api.github.com/repos/${repo.owner}/${repo.name}/git/trees/${branch}?recursive=1`;
try {
const httpRequest = http.createHttp();
const treeResponse = await httpRequest.requ... | https://github.com/midori52000/ArkPilot | 1ecbdd89071317fd0679f31ce2ab0085f676b7d9 | github |
openharmony/codelabs | CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/MainViewModel.ets | arkts | getDescContent | Get description content in MainViewModel.
@param alarmItem AlarmItem
@return content string | public getDescContent(alarmItem: AlarmItem): string{
return (alarmItem.name + CommonConstants.DEFAULT_STRING_COMMA
+ (alarmItem.isRepeat
? this.getAlarmRepeatDayContent(alarmItem.repeatDays)
: CommonConstants.DEFAULT_STRING_NO_REPEAT));
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDescContent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left alarmItem AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | public getDescContent(alarmItem: AlarmItem): string{
return (alarmItem.name + CommonConstants.DEFAULT_STRING_COMMA
+ (alarmItem.isRepeat
? this.getAlarmRepeatDayContent(alarmItem.repeatDays)
: CommonConstants.DEFAULT_STRING_NO_REPEAT));
} | https://gitee.com/openharmony/codelabs.git | 18120cfffaaabdbbe4a10f83eaed447063710577 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoWebViewExecutor.ets | arkts | webView | 使用WebView访问网络
@param html 直接用webView载入的html, 如果html为空直接访问url
@param url html内如果有相对路径的资源不传入url访问不了
@param js 用来取返回值的js语句, 没有就返回整个源代码
@returns 返回js获取的内容 | async webView(html: string | null, url: string | null, js: string | null): Promise<string> {
const result = await this.execute({
url: url || undefined,
html: html || undefined,
javaScript: js || undefined,
timeout: 30000
});
return result.body;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left webView AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left html AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R... | async webView(html: string | null, url: string | null, js: string | null): Promise<string> {
const result = await this.execute({
url: url || undefined,
html: html || undefined,
javaScript: js || undefined,
timeout: 30000
});
return result.body;
} | https://github.com/DaLongZhuaZi/manxia | 7680b570ccfdccb10026f5df92310dfc57ca463e | github |
openharmony/codelabs | Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets | arkts | onTouchMove | Touch move.
@param x
@param y | onTouchMove(x: number, y: number): void {
Logger.debug(TAG, `onTouchMove: [state: ${this.state}] [x: ${x}, y: ${y}]`);
let offsetX = x - this.touchPoint.x;
let offsetY = y - this.touchPoint.y;
if (this.state === CropTouchState.CROP_MOVE) {
this.cropShow.moveCropRect(offsetX, offsetY);
} else... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onTouchMove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , AST#,#... | onTouchMove(x: number, y: number): void {
Logger.debug(TAG, `onTouchMove: [state: ${this.state}] [x: ${x}, y: ${y}]`);
let offsetX = x - this.touchPoint.x;
let offsetY = y - this.touchPoint.y;
if (this.state === CropTouchState.CROP_MOVE) {
this.cropShow.moveCropRect(offsetX, offsetY);
} else... | https://gitee.com/openharmony/codelabs.git | 3afaebcc4ed71e795508797c6529f033ecd7fb47 | gitee |
openharmony/arkui_ace_engine | examples/Picker/Picker/entry/src/main/ets/pages/datepicker/DatePickerExample004.ets | arkts | constructor | constructor function | constructor(loop: boolean) {
this.canloop = loop
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left loop AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right ... | constructor(loop: boolean) {
this.canloop = loop
} | https://gitee.com/openharmony/arkui_ace_engine.git | b9712d132e61bcc81e7211fcf8ac9d7115478133 | gitee |
SMAT-Lab/PhantomRendering | Harmoney_Next-Tiktok/entry/src/main/ets/components/topBar.ets | arkts | openLeftSideBar | 打开左侧边栏 | openLeftSideBar() {
animateTo({ duration: 200 }, () => {
this.showDialog = !this.showDialog
this.dialogBgColor = '#80000000'
//更改坐标轴
this.IndexX = '70%'
})
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left openLeftSideBar 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... | openLeftSideBar() {
animateTo({ duration: 200 }, () => {
this.showDialog = !this.showDialog
this.dialogBgColor = '#80000000'
//更改坐标轴
this.IndexX = '70%'
})
} | https://github.com/SMAT-Lab/PhantomRendering | 4463709836064bd3e1a1bed6af06c66ff9d6aae5 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/libs/htmlparser/LegadoHtmlBridge.ets | arkts | extractAttribute | 提取元素属性 | extractAttribute(elem: HTMLElement, attr: string): string {
const lowerAttr = attr.toLowerCase();
switch (lowerAttr) {
case 'text':
case 'textnodes':
case 'owntext':
return elem.text;
case 'html':
case 'all':
return elem.innerHTML;
case 'outerhtml':
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left extractAttribute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left elem AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left HTMLElement AST#identifier#Right AST#,#... | extractAttribute(elem: HTMLElement, attr: string): string {
const lowerAttr = attr.toLowerCase();
switch (lowerAttr) {
case 'text':
case 'textnodes':
case 'owntext':
return elem.text;
case 'html':
case 'all':
return elem.innerHTML;
case 'outerhtml':
... | https://github.com/DaLongZhuaZi/manxia | 2d99a0c9dbd1c158057e2b865b472ae76156c50d | github |
Joker-x-dev/HarmonyKit | feature/main/src/main/ets/navigation/MainGraph.ets | arkts | register | 注册主模块导航路由
@returns {void} 无返回值 | register(): void {
RouteBuild.register(MainRoutes.Main, wrapBuilder(MainNav));
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left register AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Lef... | register(): void {
RouteBuild.register(MainRoutes.Main, wrapBuilder(MainNav));
} | https://github.com/Joker-x-dev/HarmonyKit | c0f378f0c564c003222c91bf3f7648cd90cf307d | github |
picklerick422/zju-learning-assistant-OH | entry/src/main/ets/model/Types.ets | arkts | filePath | 落盘完整路径(目录 + 实际文件名)。 | get filePath(): string {
return `${this.upload.path}/${this.fileName}`;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left filePath 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 AS... | get filePath(): string {
return `${this.upload.path}/${this.fileName}`;
} | https://github.com/picklerick422/zju-learning-assistant-OH | e42c6e448d9ae7ef985a79b9b261afec256a006e | github |
tdcare/tdwebrtc | src/main/ets/utils/NetworkUtil.ets | arkts | getDefaultNet | 获取默认激活的数据网络
@returns | static getDefaultNet(): Promise<connection.NetHandle> {
return connection.getDefaultNet();
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getDefaultNet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expressi... | static getDefaultNet(): Promise<connection.NetHandle> {
return connection.getDefaultNet();
} | https://github.com/tdcare/tdwebrtc | 577b2f2cf8b092a44b2e9cbb9bdd03b00637930b | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.url.ets | arkts | protocol | Sets the protocol portion of the URL.
@param { string } scheme - protocol portion of the URL. | set protocol(scheme: string) {
if (scheme.length == 0) {
return;
}
if (this.cProtocol == "file:" && (this.cHost == "" || this.cHost == null)) {
return;
}
this.urlInner.setScheme(scheme);
this.cProtocol = this... | AST#program#Left AST#ERROR#Left AST#set#Left set AST#set#Right AST#call_expression#Left AST#identifier#Left protocol AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left scheme AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#ide... | set protocol(scheme: string) {
if (scheme.length == 0) {
return;
}
if (this.cProtocol == "file:" && (this.cHost == "" || this.cHost == null)) {
return;
}
this.urlInner.setScheme(scheme);
this.cProtocol = this... | https://gitcode.com/iop123123/arkts-static-skills | 2b9961683037bd4a6182fff0b2ddd5b91821c441 | gitcode |
openharmony-sig/knowledge_demo_entainment | FA/notebook/entry/src/main/ets/pages/Index.ets | arkts | aboutToAppear | 生命周期函数 | aboutToAppear(): void {
this.refreshData()
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | aboutToAppear(): void {
this.refreshData()
} | https://gitee.com/openharmony-sig/knowledge_demo_entainment.git | 7dafb2f1566b43218c2f08eac744a5d5b58eeb0a | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/BackgroundStreamService.ets | arkts | updateNotification | 更新长时任务通知,显示游戏名称 | private async updateNotification(): Promise<void> {
if (this.notificationId <= 0) {
return;
}
try {
const request: notificationManager.NotificationRequest = {
id: this.notificationId,
content: {
notificationContentType: notificationManager.ContentType.NOTIFICATION_CON... | 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 updateNotification AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | private async updateNotification(): Promise<void> {
if (this.notificationId <= 0) {
return;
}
try {
const request: notificationManager.NotificationRequest = {
id: this.notificationId,
content: {
notificationContentType: notificationManager.ContentType.NOTIFICATION_CON... | https://github.com/AlkaidLab/moonlight-harmony | cae1ca03ac5c99af19995d820deae7a211e79d79 | github |
David8Idira/AI-OA | packages/harmonyos/commons/src/main/ets/service/AiService.ets | arkts | getCompletion | 获取AI回复(流式/非流式)
@param content 用户输入
@param sessionId 会话ID
@param onChunk 增量回调(可选) | async getCompletion(
content: string,
sessionId?: string,
onChunk?: (text: string) => void
): Promise<string> {
try {
const res = await this.sendMessage(content, sessionId)
if (res.code === 0 || res.code === 200) {
return res.data?.reply || ''
} else {
throw new Err... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getCompletion AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left content AST#identifier#Right AST#type_annotation#Left AST#:#Left ... | async getCompletion(
content: string,
sessionId?: string,
onChunk?: (text: string) => void
): Promise<string> {
try {
const res = await this.sendMessage(content, sessionId)
if (res.code === 0 || res.code === 200) {
return res.data?.reply || ''
} else {
throw new Err... | https://github.com/David8Idira/AI-OA | 73a8bc19ed8828f1bf67bd258fc397617d66578b | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/BackgroundStreamService.ets | arkts | enableBackgroundPlaybackIfSupported | API 24+ 支持显式声明 AVSession 允许后台播放。
通过运行时探测避免低版本设备触达 API 24+ 方法。 | private async enableBackgroundPlaybackIfSupported(): Promise<void> {
if (!this.session) return;
const session = this.session as BackgroundPlayableAVSession;
if (typeof session.setBackgroundPlayMode !== 'function') {
console.info(`${TAG} 当前 SDK/设备不支持 setBackgroundPlayMode,沿用系统默认后台播放策略`);
retur... | 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 enableBackgroundPlaybackIfSupported AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#cal... | private async enableBackgroundPlaybackIfSupported(): Promise<void> {
if (!this.session) return;
const session = this.session as BackgroundPlayableAVSession;
if (typeof session.setBackgroundPlayMode !== 'function') {
console.info(`${TAG} 当前 SDK/设备不支持 setBackgroundPlayMode,沿用系统默认后台播放策略`);
retur... | https://github.com/AlkaidLab/moonlight-harmony | 27ba968a67f514589421f495f115d8e0e929f858 | github |
DaLongZhuaZi/NGF | ngf_framework/src/main/ets/platformOhos/UIContextManager.ets | arkts | bindUIContext | 绑定 UIContext
@param context UIContext 实例
@note API 23 适配:参数类型从 Object 改为 UIContext | bindUIContext(context: UIContext): void {
this.uiContext = context;
logger.info(TAG, '绑定 UIContext');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left bindUIContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left UIContext AST#identifier#Right AST#)#Le... | bindUIContext(context: UIContext): void {
this.uiContext = context;
logger.info(TAG, '绑定 UIContext');
} | https://github.com/DaLongZhuaZi/NGF | 13699d33e08fea18e9cb600e0b6bd427450e31e3 | github |
offlinecat-dev/OCNetORM | src/main/ets/query/AggregateResult.ets | arkts | toArray | 转换为对象数组
@returns 对象数组 | toArray(): Array<Record<string, ValueType>> {
const result: Array<Record<string, ValueType>> = []
for (let i = 0; i < this.rows.length; i++) {
result.push(this.rows[i].toObject())
}
return result
} | AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left toArray 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 : ... | toArray(): Array<Record<string, ValueType>> {
const result: Array<Record<string, ValueType>> = []
for (let i = 0; i < this.rows.length; i++) {
result.push(this.rows[i].toObject())
}
return result
} | https://github.com/offlinecat-dev/OCNetORM | e96943c52ef95881cfc936af6d6cf7921196ad22 | github |
Luxcis/Pokedex_Next | entry/src/main/ets/util/AppUtil.ets | arkts | init | common.UIAbilityContext,上下文
初始化方法,缓存全局变量,在UIAbility的onCreate方法中初始化该方法。
@param windowStage 窗口管理器 | static init(context: common.UIAbilityContext) {
AppUtil.context = context;
} | AST#program#Left AST#expression_statement#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 : AS... | static init(context: common.UIAbilityContext) {
AppUtil.context = context;
} | https://github.com/Luxcis/Pokedex_Next | fec7442c61cb86242476d3e3522a18cd5ff73c93 | github |
openharmony/codelabs | ETSUI/Habit/entry/src/main/ets/view/component/TimeAnalysisCard.ets | arkts | getPercent | 计算百分比的辅助方法 | getPercent(): number {
if (this.total === 0) {
return 0;
}
return (this.count / this.total) * 100;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPercent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statement_b... | getPercent(): number {
if (this.total === 0) {
return 0;
}
return (this.count / this.total) * 100;
} | https://gitcode.com/openharmony/codelabs | 89ea3ae02dabfbcc3370ebc1b043464e0aee39f3 | gitcode |
holg/eulumdat-rs | EulumdatHarmonyOS/Eulumdat/entry/src/main/ets/model/EulumdatEngine.ets | arkts | getValidationErrors | Get validation errors (strict/fatal issues) | public getValidationErrors(): ValidationWarning[] {
return eulumdat_napi.getValidationErrors();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getValidationErrors AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ex... | public getValidationErrors(): ValidationWarning[] {
return eulumdat_napi.getValidationErrors();
} | https://github.com/holg/eulumdat-rs | 205cff14f6f1b6e94b6736b0f722bdef8fac7558 | github |
wuba/omni-ui | omni_component/src/main/ets/components/popup/Builder.ets | arkts | setBorderSize | 边框大小,单位:vp
@param borderSize
@returns | setBorderSize(borderSize: number): Builder {
this.popupConfig.borderSize = borderSize
return this
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setBorderSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left borderSize AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST... | setBorderSize(borderSize: number): Builder {
this.popupConfig.borderSize = borderSize
return this
} | https://github.com/wuba/omni-ui | a9b2a372f9f33bec09f4c77fa99897c1ae2ef470 | github |
XHXYT/Pixark | entry/src/main/ets/viewmodel/MoreViewModel.ets | arkts | currentUser | 获取当前登录用户信息 | get currentUser(): PixivUser | null {
return PixState.currentUser
} | 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(): PixivUser | null {
return PixState.currentUser
} | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/MoreViewModel.ets#L19-L21 | 05f803b1a7bf3644cf246c78ae9a98158bc9b7d5 | github |
fangmingtao/Ohs_ArkTs_Eyepetizer | entry/src/main/ets/viewmodel/DailyViewModel.ets | arkts | resetPagination | 重置分页状态,用于下拉刷新 | resetPagination(): void {
this.nextPageUrl = null;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left resetPagination 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... | resetPagination(): void {
this.nextPageUrl = null;
} | https://gitcode.com/fangmingtao/Ohs_ArkTs_Eyepetizer | 169d61e15ea85167224222cf5d2229d4bd2c235e | gitcode |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/components/parts/Bookmarks/Panel.ets | arkts | closeAllRightOf | Close all levels on the right of the given index.
The #idx card is safe from this.
@param idx The index of the level to close. | closeAllRightOf(idx: number) {
this.myUi.openedStack = this.myUi.openedStack.slice(0, idx + 1);
this.myUi.openedIndexOfLevels = this.myUi.openedIndexOfLevels.slice(0, idx + 1);
this.myUi.openedIndexOfLevels[idx] = undefined; // Clear opened index in that level.
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left closeAllRightOf 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#Righ... | closeAllRightOf(idx: number) {
this.myUi.openedStack = this.myUi.openedStack.slice(0, idx + 1);
this.myUi.openedIndexOfLevels = this.myUi.openedIndexOfLevels.slice(0, idx + 1);
this.myUi.openedIndexOfLevels[idx] = undefined; // Clear opened index in that level.
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | 98d096376911c6e8647270734172d5996fb1f3c5 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/utils/XmlUtil.ets | arkts | getValues | 从 XML 中获取指定标签的所有值(用于列表)
@param xml XML 字符串
@param tag 标签名
@returns 所有匹配的标签值数组 | static getValues(xml: string, tag: string): string[] {
const regex = new RegExp(`<${tag}>(.*?)</${tag}>`, 'gs');
const matches: string[] = [];
let match: RegExpExecArray | null;
while ((match = regex.exec(xml)) !== null) {
matches.push(match[1].trim());
}
return matches;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getValues AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left xml AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string ... | static getValues(xml: string, tag: string): string[] {
const regex = new RegExp(`<${tag}>(.*?)</${tag}>`, 'gs');
const matches: string[] = [];
let match: RegExpExecArray | null;
while ((match = regex.exec(xml)) !== null) {
matches.push(match[1].trim());
}
return matches;
} | https://github.com/AlkaidLab/moonlight-harmony | 0e6cbfe490b4cfb091f21f3c2ef6a5d9320a1e2f | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/Sm4Utils.ets | arkts | decryptWithPrefix | SM4解密,认准SM4:前缀,有前缀才解密
@param data 16进制的字符串, SM4:1234567890123
@returns 明文字符串 | public static decryptWithPrefix(data: string): string {
if (!data) {
return '';
}
if (data && data.startsWith(Sm4Utils.SM4_ENCRYPT_PREFIX)) {
return aegis.sm4DecTextHexSync(aegis.SM4Alg.SM4_CBC_PKCS5Padding, data.substring(Sm4Utils.SM4_ENCRYPT_PREFIX.length), Sm4Utils.initKey());
}
ret... | 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 decryptWithPrefix AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left ... | public static decryptWithPrefix(data: string): string {
if (!data) {
return '';
}
if (data && data.startsWith(Sm4Utils.SM4_ENCRYPT_PREFIX)) {
return aegis.sm4DecTextHexSync(aegis.SM4Alg.SM4_CBC_PKCS5Padding, data.substring(Sm4Utils.SM4_ENCRYPT_PREFIX.length), Sm4Utils.initKey());
}
ret... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/Sm4Utils.ets#L105-L113 | 70d9d33e4174edf5660742404266d864954d5559 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Initialization/DataInitializer.ets | arkts | getInitializationStatus | 获取初始化状态 | public getInitializationStatus(): InitializationStatus {
const status: InitializationStatus = {
isInitialized: this.isInitialized,
isInitializing: this.initializationPromise !== null
};
return status;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getInitializationStatus 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#Lef... | public getInitializationStatus(): InitializationStatus {
const status: InitializationStatus = {
isInitialized: this.isInitialized,
isInitializing: this.initializationPromise !== null
};
return status;
} | https://github.com/DaLongZhuaZi/manxia | 8817f2d63370d00ef3888b6dd8d69a8a2ccff960 | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/oauth2/BaseOAuth2Provider.ets | arkts | constructor | 构造函数
@param config OAuth2配置 | constructor(config: OAuth2Config) {
this.config = config;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left OAuth2Config AST#identifier... | constructor(config: OAuth2Config) {
this.config = config;
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/oauth2/BaseOAuth2Provider.ets#L29-L31 | 44a29a84b375882664731036d1354823d02b4518 | github |
fbinba3955/Flymby | common/src/main/ets/video/ControlPanelView.ets | arkts | endLongPressSpeedUp | 结束长按倍速播放 | endLongPressSpeedUp() {
if (!this.isLongPressing) return
this.mIndicatorMainText = ""
this.mIndicatorSubText = ""
this.isLongPressing = false
// 恢复原始播放速度
this.onSpeedChange(this.originalSpeed)
LogUtil.info('结束长按倍速播放,恢复速度:' + this.originalSpeed)
// 清理定时器
if (this.longPressTimer) ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left endLongPressSpeedUp 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_bloc... | endLongPressSpeedUp() {
if (!this.isLongPressing) return
this.mIndicatorMainText = ""
this.mIndicatorSubText = ""
this.isLongPressing = false
// 恢复原始播放速度
this.onSpeedChange(this.originalSpeed)
LogUtil.info('结束长按倍速播放,恢复速度:' + this.originalSpeed)
// 清理定时器
if (this.longPressTimer) ... | https://github.com/fbinba3955/Flymby | b8aa966c0e1d4ca5a60e4ca7dc7cbabb5d4bd46e | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test11_original_index.ets | arkts | testMathMethods | --- Math methods: min, max, abs, ceil, floor, round --- | function testMathMethods(): string {
let min: number = Math.min(3, 1, 4, 1, 5);
let max: number = Math.max(3, 1, 4, 1, 5);
let abs: number = Math.abs(-42);
let ceil: number = Math.ceil(3.2);
let floor: number = Math.floor(3.8);
let round: number = Math.round(3.5);
return String(min) + ',' + String(max) + ... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testMathMethods AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_... | function testMathMethods(): string {
let min: number = Math.min(3, 1, 4, 1, 5);
let max: number = Math.max(3, 1, 4, 1, 5);
let abs: number = Math.abs(-42);
let ceil: number = Math.ceil(3.2);
let floor: number = Math.floor(3.8);
let round: number = Math.round(3.5);
return String(min) + ',' + String(max) + ... | https://github.com/miaochiahao/ark-ghidra | b78d5f2442a2076b7cd8bed6393ce86599d0a2bf | github |
FinalScave/SweetEditor | platform/OHOS/sweeteditor/src/main/ets/core/EditorCore.ets | arkts | insertSnippet | ==================== Linked Editing ==================== | insertSnippet(snippetTemplate: string): EditorActionResult {
return CoreProtocol.decodeEditorActionResult(native.editorInsertSnippet(this.handle, snippetTemplate));
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left insertSnippet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left snippetTemplate AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ... | insertSnippet(snippetTemplate: string): EditorActionResult {
return CoreProtocol.decodeEditorActionResult(native.editorInsertSnippet(this.handle, snippetTemplate));
} | https://github.com/FinalScave/SweetEditor | b90571dea001a7bce15a4f62265174c33c1f9031 | github |
yongoe1024/RdbPlus | rdbplus/src/main/ets/BaseMapper.ets | arkts | update | 更新,手动set更新字段
@param wrapper 更新条件
@returns sql执行结果:改变数量 | async update(wrapper: Wrapper, db?: Connection): Promise<relationalStore.ValueType> {
let isClose: boolean = true
if (db === undefined) {
db = await this.getConnection()
} else {
isClose = false
}
let myWrapper = MyWrapper.build(wrapper)
const sql = this.sqlUtils.update(myWrapper.g... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left update AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left wrapper AST#identifier#Right AST#type_annotation#Left AST#:#Lef... | async update(wrapper: Wrapper, db?: Connection): Promise<relationalStore.ValueType> {
let isClose: boolean = true
if (db === undefined) {
db = await this.getConnection()
} else {
isClose = false
}
let myWrapper = MyWrapper.build(wrapper)
const sql = this.sqlUtils.update(myWrapper.g... | https://github.com/yongoe1024/RdbPlus/blob/83f7347b7ac692941729d3464923155948e876bb/rdbplus/src/main/ets/BaseMapper.ets#L316-L330 | a8cc0781135e68ac06e5b2d1931d8da73fdf020d | github |
Joker-x-dev/CoolMallArkTS | core/base/src/main/ets/viewmodel/BaseNetWorkListViewModel.ets | arkts | aboutToAppear | 页面出现时初始化列表数据
@returns {void} 无返回值 | aboutToAppear(): void {
this.initLoad();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | aboutToAppear(): void {
this.initLoad();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 392875a23f950d049a86b35d2f8df9d6907535b8 | github |
CarGuo/GSYGithubAppOH | entry/src/main/ets/entryability/EntryAbility.ets | arkts | handleBootCommonListInjection | 测试通道:want.parameters.bootCommonList=dataType|showType|currentUser|repoName,
HomePage 启动后会 push 到 CommonListPage,补足无自然入口的 Compose list 类型回归。 | private handleBootCommonListInjection(want: Want): void {
const params: Record<string, Object> | undefined = want.parameters as Record<string, Object> | undefined;
if (!params) {
return;
}
const raw: Object | undefined = params[PARAM_BOOT_COMMON_LIST];
if (typeof raw !== 'string') {
re... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleBootCommonListInjection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST... | private handleBootCommonListInjection(want: Want): void {
const params: Record<string, Object> | undefined = want.parameters as Record<string, Object> | undefined;
if (!params) {
return;
}
const raw: Object | undefined = params[PARAM_BOOT_COMMON_LIST];
if (typeof raw !== 'string') {
re... | https://github.com/CarGuo/GSYGithubAppOH | 01ee5d5f304c79243b998654bec3a94163a258a8 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelDataManager.ets | arkts | setBookGroupBatch | 批量设置书籍分组 | async setBookGroupBatch(bookIds: string[], groupName: string): Promise<void> {
const store = this.getStore();
const now = Date.now();
for (const bookId of bookIds) {
await store.executeSql(
'UPDATE novel_book SET groupName = ?, updateTime = ? WHERE id = ?',
[groupName, now, bookId]
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left setBookGroupBatch AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left bookIds AST#identifier#Right AST#type_annotation#Left AST#:#L... | async setBookGroupBatch(bookIds: string[], groupName: string): Promise<void> {
const store = this.getStore();
const now = Date.now();
for (const bookId of bookIds) {
await store.executeSql(
'UPDATE novel_book SET groupName = ?, updateTime = ? WHERE id = ?',
[groupName, now, bookId]
... | https://github.com/DaLongZhuaZi/manxia | 2a2b6a66cb414d06c57995c71694ef0175f568b3 | github |
openharmony/arkcompiler_taihe_ffi_gen | test/ani_tuple/user/main.ets | arkts | main | ====== Run all tests ====== | function main() {
const suite = new arktest.ArkTestsuite("Tuple Tests");
suite.addTest("MakeIntPair", testMakeIntPair);
suite.addTest("SumIntPair", testSumIntPair);
suite.addTest("SwapIntPair", testSwapIntPair);
suite.addTest("ProcessMixed", testProcessMixed);
suite.addTest("MakeStringPair", te... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#lexical_declaration#Le... | function main() {
const suite = new arktest.ArkTestsuite("Tuple Tests");
suite.addTest("MakeIntPair", testMakeIntPair);
suite.addTest("SumIntPair", testSumIntPair);
suite.addTest("SwapIntPair", testSwapIntPair);
suite.addTest("ProcessMixed", testProcessMixed);
suite.addTest("MakeStringPair", te... | https://gitcode.com/openharmony/arkcompiler_taihe_ffi_gen | ae40326463afc2b37f6aae9d72855bfb5763c294 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Editor/FileEditorService.ets | arkts | touchSession | 标记会话更新时间 | public touchSession(sessionId: string): void {
const session = this.sessions.get(sessionId);
if (session) {
const updated: FileEditorSessionInfo = {
instanceId: session.instanceId,
sessionId: session.sessionId,
createdAt: session.createdAt,
updatedAt: Date.now(),
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left touchSession AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sessionId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#... | public touchSession(sessionId: string): void {
const session = this.sessions.get(sessionId);
if (session) {
const updated: FileEditorSessionInfo = {
instanceId: session.instanceId,
sessionId: session.sessionId,
createdAt: session.createdAt,
updatedAt: Date.now(),
... | https://github.com/DaLongZhuaZi/manxia | 9904548a18d9633447afbb296293e4e65617ce0d | github |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/MouseCursorChannel.ets | arkts | setMethodHandler | Sets the {@link MouseCursorMethodHandler} which receives all events and requests that are
parsed from the underlying platform channel.
@param mouseCursorMethodHandler | public setMethodHandler(mouseCursorMethodHandler: MouseCursorMethodHandler | null): void {
this.mouseCursorMethodHandler = mouseCursorMethodHandler;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setMethodHandler AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mouseCursorMethodHandler AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right... | public setMethodHandler(mouseCursorMethodHandler: MouseCursorMethodHandler | null): void {
this.mouseCursorMethodHandler = mouseCursorMethodHandler;
} | https://gitee.com/openharmony-sig/flutter_engine.git | d28f552fdb38d5fdc1ea37917d6459cc279b58af | gitee |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/userdata/keyshortcuts/classes/meowKeyBind.ets | arkts | toResourceStr | To ResourceStr for UI display.
@returns The ResourceStr of this keybind object contents. | toResourceStr(): ResourceStr {
if (this.value === '') {
return $r('app.string.General_wait');
}
return this.toString();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toResourceStr 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 ResourceStr AST#identifier#Right AST#ERROR#Right... | toResourceStr(): ResourceStr {
if (this.value === '') {
return $r('app.string.General_wait');
}
return this.toString();
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | a17813dc5b94c13028e91e454c7792a14fa9a211 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoUrlAnalyzer.ets | arkts | analyzeUrlAsync | 解析URL模板(异步版本,支持完整JS执行) | async analyzeUrlAsync(urlTemplate: string, key?: string, page?: number): Promise<ParsedUrlRequest> {
// 保存参数
if (key !== undefined) {
this.key = key;
this.variables.set('key', key);
this.variables.set('encodedKey', encodeURIComponent(key));
}
if (page !== undefined) {
this.page... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left analyzeUrlAsync AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left urlTemplate AST#identifier#Ri... | async analyzeUrlAsync(urlTemplate: string, key?: string, page?: number): Promise<ParsedUrlRequest> {
// 保存参数
if (key !== undefined) {
this.key = key;
this.variables.set('key', key);
this.variables.set('encodedKey', encodeURIComponent(key));
}
if (page !== undefined) {
this.page... | https://github.com/DaLongZhuaZi/manxia | 16c23abe035d0efc29833573cfd5e9890b2aff95 | github |
terryma2024/happyword | harmonyos/entry/src/main/ets/services/PackSelectionService.ets | arkts | appendOrRotate | V0.8.3 — activate `packId` when under the cap, or when at cap swap out
the earliest-activated non-pinned pack. Pinned packs are never auto-closed. | async appendOrRotate(packId: string): Promise<AppendOutcome> {
const out: AppendOutcome = new AppendOutcome();
out.addedId = packId;
if (this.activeIds.indexOf(packId) >= 0) {
out.result = 'activated';
out.autoClosed = null;
return out;
}
if (this.activeIds.length < MAX_ACTIVE_PA... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left appendOrRotate AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left packId AST#identifier#Right AST#type_annotation#Left AST#:#Left ... | async appendOrRotate(packId: string): Promise<AppendOutcome> {
const out: AppendOutcome = new AppendOutcome();
out.addedId = packId;
if (this.activeIds.indexOf(packId) >= 0) {
out.result = 'activated';
out.autoClosed = null;
return out;
}
if (this.activeIds.length < MAX_ACTIVE_PA... | https://github.com/terryma2024/happyword | 7e12ccf066e5e8e36c09efdead0c6cb9af91d472 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/model/SessionState.ets | arkts | getConnectionState | Get current connection state | getConnectionState(): ConnectionState {
return this.connectionState;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getConnectionState 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 ConnectionState AST#identifier#Right AST#ER... | getConnectionState(): ConnectionState {
return this.connectionState;
} | https://github.com/tangwengang-del/freerdp-harmonyos | da9b9a3e517d877346e5bf9ba7618b4a69ddd748 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/ThemeManager.ets | arkts | getCurrentThemeId | 获取当前主题 ID
@returns 当前主题 ID | public getCurrentThemeId(): NDSThemeId {
return this.currentThemeId;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getCurrentThemeId 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 NDST... | public getCurrentThemeId(): NDSThemeId {
return this.currentThemeId;
} | https://github.com/richshaw2015/nds | 83e38f490240e56ca504ff609b32f3a697437516 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/FontManager.ets | arkts | addCustomFont | 添加自定义字体
@param displayName 用户提供的显示名称(如果为空则自动解析)
@param sourceFilePath 源字体文件路径 | async addCustomFont(displayName: string, sourceFilePath: string, uiContext?: UIContext | null): Promise<CustomFont> {
const id = `custom_${Date.now()}`;
// 获取文件扩展名
const ext = this.getFileExtension(sourceFilePath);
const localFileName = `${id}${ext}`;
const localFilePath = `${this.fontsDirPat... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left addCustomFont AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left displayName AST#identifier#Right AST#type_annotation#Left AST#:#L... | async addCustomFont(displayName: string, sourceFilePath: string, uiContext?: UIContext | null): Promise<CustomFont> {
const id = `custom_${Date.now()}`;
// 获取文件扩展名
const ext = this.getFileExtension(sourceFilePath);
const localFileName = `${id}${ext}`;
const localFilePath = `${this.fontsDirPat... | https://github.com/DaLongZhuaZi/manxia | 37014da371e5d842c9b364d62690a1bcd975d222 | github |
CLMC2025/Vignette | entry/src/main/ets/ui/Animations.ets | arkts | FadeOut | 淡出动画组件 | @Builder
function FadeOut(
key: string,
duration: number = 300,
progress: number
): void {
Column() {
// 内容直接嵌入
}
.opacity(1 - progress)
.animation({
duration: duration,
curve: Curve.EaseInOut,
iterations: 1,
playMode: PlayMode.Normal
})
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left FadeOut AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_... | @Builder
function FadeOut(
key: string,
duration: number = 300,
progress: number
): void {
Column() {
// 内容直接嵌入
}
.opacity(1 - progress)
.animation({
duration: duration,
curve: Curve.EaseInOut,
iterations: 1,
playMode: PlayMode.Normal
})
} | https://github.com/CLMC2025/Vignette | 33d19ea41e0e7be8ecac164eb362d0ef4a8819fb | github |
openharmony/applications_app_samples | code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/VideoTrimmerView.ets | arkts | seekTo | 设置播放位置 | seekTo(msec: number) {
if (this && this.avPlayer) {
this.avPlayer?.seek(msec);
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left seekTo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left msec AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#... | seekTo(msec: number) {
if (this && this.avPlayer) {
this.avPlayer?.seek(msec);
}
} | https://github.com/openharmony/applications_app_samples | 18bd1b375b362056765fcaa159dc5035e562fe65 | github |
SMAT-Lab/PhantomRendering | Harmoney_Next-Tiktok/entry/src/main/ets/pages/ChatDetail/ChatDetail.ets | arkts | getAllRecord | 获取所有聊天记录 | getAllRecord() {
this.messList = new Tiktok(getContext()).getChatMessage(this.talkUser.user_id)
this.scroller.scrollEdge(Edge.Bottom)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getAllRecord 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 ... | getAllRecord() {
this.messList = new Tiktok(getContext()).getChatMessage(this.talkUser.user_id)
this.scroller.scrollEdge(Edge.Bottom)
} | https://github.com/SMAT-Lab/PhantomRendering | 31a5c5659fece132f5b54628041a2bf031fe4de5 | github |
picklerick422/zju-learning-assistant-OH | entry/src/main/ets/pages/SettingsPage.ets | arkts | exportTargetLabel | 当前导出目标的展示文案。 | exportTargetLabel(): string {
const uri = this.cfg?.export_uri ?? '';
if (uri.length > 0) {
return new fileUri.FileUri(uri).path;
}
return '系统「下载」/ 浙大学习助手';
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left exportTargetLabel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#stat... | exportTargetLabel(): string {
const uri = this.cfg?.export_uri ?? '';
if (uri.length > 0) {
return new fileUri.FileUri(uri).path;
}
return '系统「下载」/ 浙大学习助手';
} | https://github.com/picklerick422/zju-learning-assistant-OH | 00ba4f0dcf4a0916c13398aa4111e810a25fcc9e | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/WeakSet.ets | arkts | has | The has() method returns a boolean indicating whether an object
exists in a WeakSet or not. | has(v: K): boolean {
throw new Error("Not implemented");
return false;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left has AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left K AST#identifier#Right AST#)#Left ) AST#)#Right AST#arg... | has(v: K): boolean {
throw new Error("Not implemented");
return false;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 4653959e303d2831578041f2d4454e5d9a534332 | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/network/QrShareService.ets | arkts | isScanQrCodeSupported | 当前设备是否支持拉起系统扫码 UI。
例如 MateBook/2in1 设备缺少 ScanBarcode syscap,直接调用会返回取消或失败。 | static isScanQrCodeSupported(): boolean {
try {
return canIUse(SCAN_BARCODE_SYSCAP);
} catch (_e) {
return false;
}
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isScanQrCodeSupported AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boo... | static isScanQrCodeSupported(): boolean {
try {
return canIUse(SCAN_BARCODE_SYSCAP);
} catch (_e) {
return false;
}
} | https://github.com/AlkaidLab/moonlight-harmony | e17940f9582bf1c2b5438ed8ec7f6536384d8c28 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | negate | Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by -1.
@returns { Decimal } the Decimal type | public negate(): Decimal {
let x = new Decimal(this);
x.sign = -x.sign;
return Utils.finaliseExternal(x);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left negate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left Decimal AST#ide... | public negate(): Decimal {
let x = new Decimal(this);
x.sign = -x.sign;
return Utils.finaliseExternal(x);
} | https://gitcode.com/iop123123/arkts-static-skills | 623461041938f7403067858cecb46f107d837ba4 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/AnimationSettingsManager.ets | arkts | loadSettings | 从持久化存储加载设置 | private async loadSettings(): Promise<void> {
this.currentSettings = {
bookOpenEnabled: this.settingsManager.getBoolean(
SettingKeys.ANIMATION_BOOK_OPEN_ENABLED,
DEFAULT_ANIMATION_SETTINGS.bookOpenEnabled
),
bookCloseEnabled: this.settingsManager.getBoolean(
SettingKeys.A... | 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 loadSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#... | private async loadSettings(): Promise<void> {
this.currentSettings = {
bookOpenEnabled: this.settingsManager.getBoolean(
SettingKeys.ANIMATION_BOOK_OPEN_ENABLED,
DEFAULT_ANIMATION_SETTINGS.bookOpenEnabled
),
bookCloseEnabled: this.settingsManager.getBoolean(
SettingKeys.A... | https://github.com/DaLongZhuaZi/manxia | d94131f05ee70dd326d97ccd3df8988810a0996e | github |
LambdaYH/ScrcpyForHarmonyOS | app/src/main/ets/helper/ServerManager.ets | arkts | getLastScid | 获取最后生成的SCID(用于连接socket) | static getLastScid(): string {
return ServerManager.lastScid;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getLastScid 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#str... | static getLastScid(): string {
return ServerManager.lastScid;
} | https://github.com/LambdaYH/ScrcpyForHarmonyOS | 7c1426b670df06d4dd172d87957d4c739b67797a | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/NvHttp.ets | arkts | clearCachedUniqueId | 清除 uniqueId 静态缓存,下次请求从文件重新读取。
备份恢复后调用,确保使用恢复的 uniqueId 而非启动时生成的新值。 | static clearCachedUniqueId(): void {
NvHttp.cachedUniqueId = null;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left clearCachedUniqueId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ex... | static clearCachedUniqueId(): void {
NvHttp.cachedUniqueId = null;
} | https://github.com/AlkaidLab/moonlight-harmony | 3818451aa89e07f280d7a7407b3f0ef81752b100 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets | arkts | toJSON | Returns a string representation of the Date object.
@returns { string | null } get new date value
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public toJSON(): string | null {
if (!this.isDateValid()) {
return null;
}
return this.toISOString();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toJSON 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#iden... | public toJSON(): string | null {
if (!this.isDateValid()) {
return null;
}
return this.toISOString();
} | https://gitcode.com/iop123123/arkts-static-skills | 9ff889729c09b9f6be786e57ef3d646af4924982 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EnumConstant.ets | arkts | create | create
@param { string } name None
@param { Type } typ None
@param { int } v None
@returns { EnumConstant }
@throws { Error } - Input parameter error.
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static create(name: string, typ: Type, v: int): EnumConstant {
// TODO(shumilov-petr): not implemented
throw new Error("not implemented")
} | 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 create AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Rig... | public static create(name: string, typ: Type, v: int): EnumConstant {
// TODO(shumilov-petr): not implemented
throw new Error("not implemented")
} | https://gitcode.com/iop123123/arkts-static-skills | 8973c35539f9a6f98407454dcac8710cce0facbe | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | from | Creates an array from an array-like object.
@param { ArrayLike<T> } arrayLike - An array-like object to convert to an array.
@param { function } mapfn - A mapping function to call on every element of the array.
@returns { Uint16Array } - A new Uint16Array
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number): Uint16Array {
let res = new Uint16Array(arrayLike.length)
// NOTE (ikorobkov): Please don't replace idx as int[1] with int-variable, because of value of single variable doesn't change (idx++) into lambda call by unkn... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identif... | public static from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number): Uint16Array {
let res = new Uint16Array(arrayLike.length)
// NOTE (ikorobkov): Please don't replace idx as int[1] with int-variable, because of value of single variable doesn't change (idx++) into lambda call by unkn... | https://gitcode.com/iop123123/arkts-static-skills | a35f6a9fd53edbd9754c66f465700d9f6693651e | gitcode |
lidaixian999/Smart_Car | entry/src/main/ets/model/SsapManager.ets | arkts | getScanResults | 获取扫描结果 | public getScanResults(): Array<scan.ScanResults> {
return [...this.scanResults]; // 返回副本,避免外部修改
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getScanResults AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#express... | public getScanResults(): Array<scan.ScanResults> {
return [...this.scanResults]; // 返回副本,避免外部修改
} | https://github.com/lidaixian999/Smart_Car | 56c867d908df1036c3dbdc66968a95e346656b15 | github |
arkui-x/samples | CodeLab/Cases/feature/calendarswitch/src/main/ets/customcalendar/utils/TimeUtils.ets | arkts | getLastYear | 获取上个月的年份
@param year 年
@param month 月
@returns | static getLastYear(year: number, month: number): number {
return (month - 1 < 1) ? year - 1 : year;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getLastYear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left year AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left numb... | static getLastYear(year: number, month: number): number {
return (month - 1 < 1) ? year - 1 : year;
} | https://gitcode.com/arkui-x/samples | 3778d50d13be10c386e636090a0a302fef41b3bf | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Scraper/GoogleBooksScraper.ets | arkts | searchBySubject | 按分类/主题搜索书籍
@param subject 分类/主题
@param limit 返回数量限制 | public async searchBySubject(subject: string, limit: number = 20): Promise<ScraperSearchResult> {
const query = `subject:${subject}`;
return this.searchVolumes(query, limit);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left searchBySubject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left subject AST#identifier#Right AST#ERROR#Left AST#:#Left ... | public async searchBySubject(subject: string, limit: number = 20): Promise<ScraperSearchResult> {
const query = `subject:${subject}`;
return this.searchVolumes(query, limit);
} | https://github.com/DaLongZhuaZi/manxia | ea5ea76fba46deda724b5ee30c2fdf5ab9df464a | github |
chendi126/harmonyOS-TCP | entry/src/main/ets/pages/DeviceMonitor.ets | arkts | addRandomLog | 添加随机日志(仅用于模拟模式) | addRandomLog() {
const levels: ('INFO' | 'WARN' | 'ERROR' | 'DEBUG')[] = ['INFO', 'WARN', 'ERROR', 'DEBUG'];
const messages = [
'设备启动完成',
'传感器数据更新',
'网络连接正常',
'内存使用率较高',
'温度传感器异常',
'电压波动检测',
'接收到控制命令',
'数据发送成功'
];
const newLog: LogEntry = {
timest... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left addRandomLog 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 ... | addRandomLog() {
const levels: ('INFO' | 'WARN' | 'ERROR' | 'DEBUG')[] = ['INFO', 'WARN', 'ERROR', 'DEBUG'];
const messages = [
'设备启动完成',
'传感器数据更新',
'网络连接正常',
'内存使用率较高',
'温度传感器异常',
'电压波动检测',
'接收到控制命令',
'数据发送成功'
];
const newLog: LogEntry = {
timest... | https://github.com/chendi126/harmonyOS-TCP | 2ee954b29238c1c917c9323ef00512c4b03c58f9 | github |
arkui-x/samples | CodeLab/Cases/feature/imageviewer/src/main/ets/view/ImageItemView.ets | arkts | aboutToAppear | 图片原始宽高比 | aboutToAppear(): void {
this.initCurrentImageInfo();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | aboutToAppear(): void {
this.initCurrentImageInfo();
} | https://gitcode.com/arkui-x/samples | 6ccec65136be9c639cb094522e40d3b3d05af8c5 | gitcode |
ASweetBite/HarmonyPulse | entry/src/main/ets/pages/components/MiniPlayBar.ets | arkts | getPlaybackModeIcon | 获取当前播放模式对应的图标 | getPlaybackModeIcon(): Resource {
switch (this.musicState.playbackStatus) {
case "顺序播放":
return $r('app.media.ic_auto') // 顺序播放图标
case "单曲循环":
return $r('app.media.ic_repeat') // 单曲循环图标
case "随机播放":
return $r('app.media.ic_random') // 随机播放图标
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPlaybackModeIcon 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 Resource AST#identifier#Right AST#ERROR#Ri... | getPlaybackModeIcon(): Resource {
switch (this.musicState.playbackStatus) {
case "顺序播放":
return $r('app.media.ic_auto') // 顺序播放图标
case "单曲循环":
return $r('app.media.ic_repeat') // 单曲循环图标
case "随机播放":
return $r('app.media.ic_random') // 随机播放图标
}
} | https://github.com/ASweetBite/HarmonyPulse/blob/a7fcf153a20bafa29ac1fb8c25743dd5350dc54c/entry/src/main/ets/pages/components/MiniPlayBar.ets#L269-L278 | 92f9528579b990f15f17e4c4ef6004b202f04e97 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Download/StreamDownloader.ets | arkts | downloadSingleStream | ─── 私有核心 ─────────────────────────────────────────────────────────────────
单文件流式下载
使用 requestInStream 事件驱动逐块写入,避免将整个文件载入内存 | private async downloadSingleStream(
url: string,
dest: string,
extraHeaders?: Record<string, string>
): Promise<void> {
return new Promise<void>((resolve, reject) => {
const httpRequest = http.createHttp();
// 打开目标文件(CREATE | WRITE_ONLY)
let file: fs.File | null = null;
try ... | 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 downloadSingleStream AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#L... | private async downloadSingleStream(
url: string,
dest: string,
extraHeaders?: Record<string, string>
): Promise<void> {
return new Promise<void>((resolve, reject) => {
const httpRequest = http.createHttp();
// 打开目标文件(CREATE | WRITE_ONLY)
let file: fs.File | null = null;
try ... | https://github.com/DaLongZhuaZi/manxia | 911f3570831edb8f8caa6630d02c7f265ab50947 | github |
openharmony/applications_notes | common/utils/src/main/ets/default/baseUtil/NoteUtil.ets | arkts | unsetAllNotesChecked | unset all Notes with Checked status
@param CheckedNoteArray - Checked status Note list | unsetAllNotesChecked(checkedNoteArray: NoteData[]) {
LogUtil.info(TAG, "unsetAllNotesChecked")
checkedNoteArray.splice(0, checkedNoteArray.length)
AppStorage.Set('CheckedNoteArray', checkedNoteArray)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left unsetAllNotesChecked AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left checkedNoteArray AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left NoteData AST#identifier#... | unsetAllNotesChecked(checkedNoteArray: NoteData[]) {
LogUtil.info(TAG, "unsetAllNotesChecked")
checkedNoteArray.splice(0, checkedNoteArray.length)
AppStorage.Set('CheckedNoteArray', checkedNoteArray)
} | https://gitee.com/openharmony/applications_notes.git | 8310f8ffcec5b9bedcf9578213302204c2894144 | gitee |
HarmonyOS_Samples/core-speech-kit-sample-code-ark-ts-kit-asrdemo | entry/src/main/ets/pages/FileCapturer.ets | arkts | setFilePath | Setting the File Path
@param filePath | public setFilePath(filePath: string) {
this.mFilePath = filePath;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setFilePath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Ri... | public setFilePath(filePath: string) {
this.mFilePath = filePath;
} | https://gitcode.com/HarmonyOS_Samples/core-speech-kit-sample-code-ark-ts-kit-asrdemo | 40582199f0778e80eb5a3d69829aa2d158396c6b | gitcode |
OHPG/FinSdk | jellyfin/src/main/ets/api/TvShowsApi.ets | arkts | getSeasons | getSeasons
@summary Gets seasons for a tv series.
@param {TvShowsApiGetSeasonsRequest} requestParameters Request parameters.
@throws {RequiredError}
@memberof TvShowsApi | public async getSeasons(requestParameters: TvShowsApiGetSeasonsRequest): Promise<BaseItemDtoQueryResult> {
this.assertParam(requestParameters.seriesId)
return this.apiClient.get({path: `/Shows/${requestParameters.seriesId}/Seasons`, parameters: requestParameters, excludeParams: ['seriesId']})
} | 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 getSeasons AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right AST#:#... | public async getSeasons(requestParameters: TvShowsApiGetSeasonsRequest): Promise<BaseItemDtoQueryResult> {
this.assertParam(requestParameters.seriesId)
return this.apiClient.get({path: `/Shows/${requestParameters.seriesId}/Seasons`, parameters: requestParameters, excludeParams: ['seriesId']})
} | https://github.com/OHPG/FinSdk | a148dff77ec9d6565281fa789ddae819a7e9507b | github |
openharmony/codelabs | Distributed/DistributeDraw/entry/src/main/ets/common/utils/RemoteDeviceUtil.ets | arkts | getInstance | Obtaining a class instance.
@returns Class instance. | static getInstance(): RemoteDeviceUtil {
if (RemoteDeviceUtil.dmInstance === undefined) {
RemoteDeviceUtil.dmInstance = new RemoteDeviceUtil();
}
return RemoteDeviceUtil.dmInstance;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left RemoteDevi... | static getInstance(): RemoteDeviceUtil {
if (RemoteDeviceUtil.dmInstance === undefined) {
RemoteDeviceUtil.dmInstance = new RemoteDeviceUtil();
}
return RemoteDeviceUtil.dmInstance;
} | https://gitee.com/openharmony/codelabs.git | 1ba627084a9eaa11975b1e9622f417c89fae1bb0 | gitee |
wgli-collab/qs-arkts | entry/src/main/ets/pages/Index.ets | arkts | t7_parameterLimit | T7: Parameter limit | t7_parameterLimit(): void {
const opts: ParseOptions = { parameterLimit: 2, throwOnLimitExceeded: true };
let errorCaught: boolean = false;
try {
parse('a=1&b=2&c=3&d=4', opts);
} catch (e) {
errorCaught = e instanceof RangeError;
}
this.record('T7 Parameter limit throw', errorCaug... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left t7_parameterLimit 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_... | t7_parameterLimit(): void {
const opts: ParseOptions = { parameterLimit: 2, throwOnLimitExceeded: true };
let errorCaught: boolean = false;
try {
parse('a=1&b=2&c=3&d=4', opts);
} catch (e) {
errorCaught = e instanceof RangeError;
}
this.record('T7 Parameter limit throw', errorCaug... | https://github.com/wgli-collab/qs-arkts | fa8a5d6693ffd15ec2fa1c0f8d2bb5977d03e117 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.