nwo stringclasses 449
values | path stringlengths 9 173 | language stringclasses 1
value | identifier stringlengths 1 53 | docstring stringlengths 5 4.13k | function stringlengths 10 87.2k | ast_function stringlengths 351 354k | obf_function stringlengths 10 87.2k | url stringlengths 30 175 | function_sha stringlengths 40 40 | source stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|
openharmony/codelabs | ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets | arkts | getPriority | Get Operator Precedence.
@param value The symbol.
@return Priority. | getPriority(value: string): number {
if (CheckEmptyUtil.isEmpty(value)) {
return Priority.LOW;
}
let result = 0;
switch (value) {
case CommonConstants.ADD:
case CommonConstants.MIN:
result = Priority.MEDIUM;
break;
case CommonConstants.MUL:
case CommonCons... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPriority AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AS... | getPriority(value: string): number {
if (CheckEmptyUtil.isEmpty(value)) {
return Priority.LOW;
}
let result = 0;
switch (value) {
case CommonConstants.ADD:
case CommonConstants.MIN:
result = Priority.MEDIUM;
break;
case CommonConstants.MUL:
case CommonCons... | https://gitee.com/openharmony/codelabs.git | 3d6598464faa6b7dedabd3d7e4d7f11739cc8ab2 | gitee |
openharmony/communication_wifi | wifi/test/wifi_testapp/entry/src/main/ets/entryability/candidateWifiModel/view/TargetListItem.ets | arkts | changeProgress | Save the adjustment progress.
@param progress progress value saved. | changeProgress(progress: number) {
this.latestProgress = progress;
this.updateDate = getCurrentTime();
let result = DataModel.updateProgress(this.index , this.latestProgress , this.updateDate);
if ( result ) {
this.overAllProgressChanged = !this.overAllProgressChanged;
}
this.isExpanded ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left changeProgress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left progress AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AS... | changeProgress(progress: number) {
this.latestProgress = progress;
this.updateDate = getCurrentTime();
let result = DataModel.updateProgress(this.index , this.latestProgress , this.updateDate);
if ( result ) {
this.overAllProgressChanged = !this.overAllProgressChanged;
}
this.isExpanded ... | https://gitee.com/openharmony/communication_wifi.git | 0f12bc19cff509dd6014d18722b0d29206b9c131 | gitee |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.stream.ets | arkts | on | Registering event messages.
@param { string } event - Register event.
@param { Function } callback - Event callbacks. | on(event: string, callback: Function): void {
if (!this.handlers.has(event)) {
const funcList = new Array<Function>();
this.handlers.set(event, funcList);
}
const funcList = this.handlers.get(event);
funcList!.push(callback);
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left on 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#Left string AST#identifier#Right AST#,#Left , AST#,#Right... | on(event: string, callback: Function): void {
if (!this.handlers.has(event)) {
const funcList = new Array<Function>();
this.handlers.set(event, funcList);
}
const funcList = this.handlers.get(event);
funcList!.push(callback);
... | https://gitcode.com/iop123123/arkts-static-skills | 5d895b730664b017053053ddbead173d1650f059 | gitcode |
openharmony/applications_app_samples | code/BasicFeature/Media/Camera/entry/src/main/ets/Dialog/SettingDialog.ets | arkts | getMirrorBol | Mirror persistence, enter again, confirm if the switch is turned on | getMirrorBol(bol: boolean) {
this.settingDataObj.mirrorBol = bol;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getMirrorBol AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bol AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right ... | getMirrorBol(bol: boolean) {
this.settingDataObj.mirrorBol = bol;
} | https://github.com/openharmony/applications_app_samples | 8ea9a3508605eac5e5e009afd921567aeab1c355 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoJsExtensions.ets | arkts | sha1Encode | SHA1编码 - 异步版本 | async sha1Encode(str: string): Promise<string> {
try {
const md = cryptoFramework.createMd('SHA1');
const encoder = new util.TextEncoder();
const data = encoder.encodeInto(str);
await md.update({ data: data });
const result = await md.digest();
return this.uint8ArrayToHex(resul... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left sha1Encode AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left str AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | async sha1Encode(str: string): Promise<string> {
try {
const md = cryptoFramework.createMd('SHA1');
const encoder = new util.TextEncoder();
const data = encoder.encodeInto(str);
await md.update({ data: data });
const result = await md.digest();
return this.uint8ArrayToHex(resul... | https://github.com/DaLongZhuaZi/manxia | 23b738727d663056e707a415d7b8713fa390d047 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/String.ets | arkts | concat | Concatenation of this and another String.
@param to string to concat with
@throws NullPointerException if to param is null
@returns new String which is a concatenation of this + to | public concat(to: String): String {
return StringBuilder.concatStrings(this, to);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left concat AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left to AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left String AST#... | public concat(to: String): String {
return StringBuilder.concatStrings(this, to);
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | afacf44514dc9f590638bc265d88c557f3881722 | gitee |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/components/GlassmorphicCard.ets | arkts | glassBg | 获取当前主题的玻璃卡片背景色 (base=dark, 因为应用默认深色) | function glassBg(): string {
const theme: string = AppStorage.get<string>('currentTheme') ?? 'dark';
const accent: string = AppStorage.get<string>('accentColor') ?? '#007DFF';
const p = theme === 'light' ? buildLight(accent) : buildDark(accent);
return p.card;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left glassBg AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Lef... | function glassBg(): string {
const theme: string = AppStorage.get<string>('currentTheme') ?? 'dark';
const accent: string = AppStorage.get<string>('accentColor') ?? '#007DFF';
const p = theme === 'light' ? buildLight(accent) : buildDark(accent);
return p.card;
} | https://github.com/Mydstiny/RemoteDeskHarmonyOS | b10545f3cd1c14f27bf302c53e591777e85f67ca | github |
jjjjjjava/ffmpeg_tools | src/main/ets/ffmpeg/FFmpegFactory.ets | arkts | watermark | 添加水印(右下角)
注意:overlay 滤镜需要软解码,硬编码输出
@param bitrate 可选码率参数,如 '1M', '500k'。不设置则使用编码器默认质量 | public static watermark(input: string, watermarkImg: string, output: string, bitrate?: string): string[] {
const cmd: string[] = [
'ffmpeg',
'-i', input,
'-i', watermarkImg,
'-filter_complex', '[0:v][1:v]overlay=main_w-overlay_w-10:main_h-overlay_h-10[outv]',
'-map', '[outv]',
... | 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 watermark AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:... | public static watermark(input: string, watermarkImg: string, output: string, bitrate?: string): string[] {
const cmd: string[] = [
'ffmpeg',
'-i', input,
'-i', watermarkImg,
'-filter_complex', '[0:v][1:v]overlay=main_w-overlay_w-10:main_h-overlay_h-10[outv]',
'-map', '[outv]',
... | https://github.com/jjjjjjava/ffmpeg_tools | a3e2e1f862a5b2aa38cf8a7a4fd00100c63195c8 | github |
HarmonyOS_Samples/hmosworld | HMOSWorld/Application/commons/utils/src/main/ets/utils/WebUtil.ets | arkts | webBuilder | Developer-defined template | @Builder
function webBuilder(data: Data) {
Web({ src: data.url.split('~')[0], controller: data.controller })
.domStorageAccess(true)
.zoomAccess(true)
.fileAccess(true)
.mixedMode(MixedMode.All)
.cacheMode(CacheMode.Default)
.verticalScrollBarAccess(false)
.javaScriptAccess(true)
.pinc... | 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 webBuilder AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#requir... | @Builder
function webBuilder(data: Data) {
Web({ src: data.url.split('~')[0], controller: data.controller })
.domStorageAccess(true)
.zoomAccess(true)
.fileAccess(true)
.mixedMode(MixedMode.All)
.cacheMode(CacheMode.Default)
.verticalScrollBarAccess(false)
.javaScriptAccess(true)
.pinc... | https://gitcode.com/HarmonyOS_Samples/hmosworld | 5f536f5f05bc560d9107a9bab8805e8392904fdb | gitcode |
openharmony/distributedhardware_device_manager | display/entry/src/main/ets/pages/ConfirmDialog.ets | arkts | setMarginValue | fontSizeScale means senior mode display magnification scale | setMarginValue(): void {
if ((this.fontSizeScale >= 1) && (this.fontSizeScale < 1.75)) {
if (this.fontSizeScale === 1) {
this.fontSize = '20vp';
} else if (this.fontSizeScale === 1.15) {
this.fontSize = '23vp';
} else if (this.fontSizeScale === 1.3) {
this.fontSize = '26v... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setMarginValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#{#Left { AST#{#Right AST#meth... | setMarginValue(): void {
if ((this.fontSizeScale >= 1) && (this.fontSizeScale < 1.75)) {
if (this.fontSizeScale === 1) {
this.fontSize = '20vp';
} else if (this.fontSizeScale === 1.15) {
this.fontSize = '23vp';
} else if (this.fontSizeScale === 1.3) {
this.fontSize = '26v... | https://gitee.com/openharmony/distributedhardware_device_manager.git | 77a4c8d949bed923b163672b0eb72140f7560e4d | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/OnlineImageLoader.ets | arkts | load | 加载在线图片(三级缓存:内存->磁盘->网络) | public async load(url: string, options?: OnlineLoadOptions): Promise<image.PixelMap | null> {
const effectiveOptions: OnlineLoadOptions = this.cloneLoadOptions(options);
const cacheKey = this.generateCacheKey(url, effectiveOptions);
const sourceKey = this.resolveSourceKey(url, effectiveOptions);
const... | 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 load AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right A... | public async load(url: string, options?: OnlineLoadOptions): Promise<image.PixelMap | null> {
const effectiveOptions: OnlineLoadOptions = this.cloneLoadOptions(options);
const cacheKey = this.generateCacheKey(url, effectiveOptions);
const sourceKey = this.resolveSourceKey(url, effectiveOptions);
const... | https://github.com/DaLongZhuaZi/manxia | 43a8121a1942f27ac165be4994a399b2cab7e5b6 | github |
wuba/omni-ui | omni_component/src/main/ets/components/popup/BasePopup.ets | arkts | show | 显示弹窗
@returns | show(): BasePopup<T> {
if (this.customBuilder != null) {
//设置弹窗宽度
this.popupConfig.width = this.popupConfig.width ?? this.popupWidth()
//设置弹窗高度
this.popupConfig.height = this.popupConfig.height ?? this.popupHeight()
//设置弹窗最大宽度
this.popupConfig.maxWidth = this.popupConfig.maxWid... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left show 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#binary_expression#Left AST#... | show(): BasePopup<T> {
if (this.customBuilder != null) {
//设置弹窗宽度
this.popupConfig.width = this.popupConfig.width ?? this.popupWidth()
//设置弹窗高度
this.popupConfig.height = this.popupConfig.height ?? this.popupHeight()
//设置弹窗最大宽度
this.popupConfig.maxWidth = this.popupConfig.maxWid... | https://github.com/wuba/omni-ui | 88bd53bb5c7933601cbbd6e8fc90014919e8c4a9 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/services/ChatService.ets | arkts | markAsRead | 标记消息已读 | markAsRead(sessionId: string, messageId: string): void {
this.wsService.send({
type: MessageType.MARK_READ,
data: JSON.stringify({ sessionId: sessionId, messageId: messageId })
});
const session = this.sessions.get(sessionId);
if (session && session.unreadCount > 0) {
session.un... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left markAsRead 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#Right AST#ERROR#Right AST#,#Left , AST#,#R... | markAsRead(sessionId: string, messageId: string): void {
this.wsService.send({
type: MessageType.MARK_READ,
data: JSON.stringify({ sessionId: sessionId, messageId: messageId })
});
const session = this.sessions.get(sessionId);
if (session && session.unreadCount > 0) {
session.un... | https://github.com/LJ666-ui/harmony-health-care | f94b159e8d171c37e77f2873309579b0d09e3076 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/renderer/RadarChartRenderer.ets | arkts | drawDataSet | Draws the RadarDataSet
@param c
@param dataSet
@param mostEntries the entry count of the dataset with the most entries | protected drawDataSet(c: CanvasRenderingContext2D, dataSet: IRadarDataSet, mostEntries: number): void {
if (!this.mAnimator) {
return;
}
let phaseX: number = this.mAnimator.getPhaseX();
let phaseY: number = this.mAnimator.getPhaseY();
let sliceangle: number = this.mChart.getSliceAngle();
... | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left drawDataSet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left c AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | protected drawDataSet(c: CanvasRenderingContext2D, dataSet: IRadarDataSet, mostEntries: number): void {
if (!this.mAnimator) {
return;
}
let phaseX: number = this.mAnimator.getPhaseX();
let phaseY: number = this.mAnimator.getPhaseY();
let sliceangle: number = this.mChart.getSliceAngle();
... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 54916450111758a5ae3d08555ff841e86de0fe2b | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/StreamWindowManager.ets | arkts | getCurrentWindowViewportSize | 获取当前窗口内容区域尺寸(vp)。
浮窗/自由窗口下默认屏幕尺寸不等于实际可绘制窗口尺寸,继续按屏幕计算会导致
XComponent 超出窗口后被父容器裁剪,看起来像画面被放大裁切。 | async getCurrentWindowViewportSize(): Promise<DisplaySize> {
try {
const win = await window.getLastWindow(this.context);
const properties = win.getWindowProperties();
let rect: window.Rect = properties.windowRect;
if (properties.drawableRect.width > 0 && properties.drawableRect.height > 0)... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getCurrentWindowViewportSize 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#:#R... | async getCurrentWindowViewportSize(): Promise<DisplaySize> {
try {
const win = await window.getLastWindow(this.context);
const properties = win.getWindowProperties();
let rect: window.Rect = properties.windowRect;
if (properties.drawableRect.width > 0 && properties.drawableRect.height > 0)... | https://github.com/AlkaidLab/moonlight-harmony | 0a6919fa8220a6e3b951513fcd116c88236ef0ea | github |
openharmony-sig/commons-cli | library/src/main/ets/components/cli/DefaultParser.ets | arkts | updateRequiredOptions | Removes the option or its group from the list of expected elements.
@param option | private updateRequiredOptions(option: CliOption): void {
if (option.isRequired()) {
this.expectedOpts.remove(option.getKey());
}
// if the option is in an OptionGroup make that option the selected option of the group
if (this.options.getOptionGroup(option) != null) {
let group: OptionGroup... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateRequiredOptions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left option AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident... | private updateRequiredOptions(option: CliOption): void {
if (option.isRequired()) {
this.expectedOpts.remove(option.getKey());
}
// if the option is in an OptionGroup make that option the selected option of the group
if (this.options.getOptionGroup(option) != null) {
let group: OptionGroup... | https://gitee.com/openharmony-sig/commons-cli.git | 505b37c5685c0545345718fcc7867a52d97b6cd0 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | updateComicSourceCookiesByName | ==================== ComicSource 表:Cookie 管理(统一存储) ==================== | async updateComicSourceCookiesByName(sourceName: string, cookiesJson: string): Promise<void> {
try {
const sql: string = `UPDATE comic_source SET cookies = ? WHERE name = ?`;
await this.databaseManager.executeSql(sql, [cookiesJson, sourceName]);
logger.info(TAG, `已更新图源Cookie到comic_source: source... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateComicSourceCookiesByName AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceName AST#identifier#Right AST#type_annotat... | async updateComicSourceCookiesByName(sourceName: string, cookiesJson: string): Promise<void> {
try {
const sql: string = `UPDATE comic_source SET cookies = ? WHERE name = ?`;
await this.databaseManager.executeSql(sql, [cookiesJson, sourceName]);
logger.info(TAG, `已更新图源Cookie到comic_source: source... | https://github.com/DaLongZhuaZi/manxia | c509f83378b4df39cdf6487d573d5c6b3508ff07 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Short.ets | arkts | isGreaterEqualThan | Checks if this instance value is greater than or equal to value of provided instance
@param { Short } other Right hand side of the comparison
@returns { boolean } true if this value is greater than or equal to provided, false otherwise
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public isGreaterEqualThan(other: Short): boolean {
return this.value >= other.toShort();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isGreaterEqualThan AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | public isGreaterEqualThan(other: Short): boolean {
return this.value >= other.toShort();
} | https://gitcode.com/iop123123/arkts-static-skills | 8f7e871a0618733ec3837e63560add477c0f720a | gitcode |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/strategies/UserTemplateStrategy.ets | arkts | getTemplates | 获取用户模板列表 | getTemplates(kdbx: Kdbx): IUserTemplate[] {
if (!kdbx) {
return [];
}
const templates: IUserTemplate[] = [];
const templateGroup = this.findTemplatesGroup(kdbx);
if (!templateGroup) {
return templates;
}
// 遍历模板分组下的所有条目
this.collectTemplatesFromGroup(templateGroup, templ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getTemplates AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left kdbx AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Kdbx AST#identifier#Right AST#)#Left ) AST#... | getTemplates(kdbx: Kdbx): IUserTemplate[] {
if (!kdbx) {
return [];
}
const templates: IUserTemplate[] = [];
const templateGroup = this.findTemplatesGroup(kdbx);
if (!templateGroup) {
return templates;
}
// 遍历模板分组下的所有条目
this.collectTemplatesFromGroup(templateGroup, templ... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/strategies/UserTemplateStrategy.ets#L22-L38 | 76078056d976e44838aaec7897fc0a0b1e393980 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | reduce | Calls the specified callback function for all the elements in an array.
The return value of the callback function is the accumulated result,
and is provided as an argument in the next call to the callback function.
@param { function } callbackfn - A function that accepts four arguments.
The reduce method calls the call... | public reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: int, array: Uint32Array) => number): number {
if (this.lengthInt == 0) {
throw new TypeError("Reduce of empty array with no initial value")
}
let accumulatedValue = this.$_get(0).toDouble()
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left reduce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#Left :... | public reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: int, array: Uint32Array) => number): number {
if (this.lengthInt == 0) {
throw new TypeError("Reduce of empty array with no initial value")
}
let accumulatedValue = this.$_get(0).toDouble()
... | https://gitcode.com/iop123123/arkts-static-skills | 3d6714536901a8b8e972712b0cd7451204f44983 | gitcode |
openharmony/applications_call | entry/src/main/ets/model/CallStateManager.ets | arkts | getInstance | update callData
@param { Object } data - callData | public static getInstance(): CallStateManager {
return CallStateManager.sCallStateManager;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L... | public static getInstance(): CallStateManager {
return CallStateManager.sCallStateManager;
} | https://gitee.com/openharmony/applications_call.git | b01ee989b605ddaa30280bf41bc10b290942223b | gitee |
openharmony-sig/applications_clock | feature/worldclock/src/main/ets/manager/WorldClockManager.ets | arkts | updateWorldClock | modify world clock data
@param world clock object | async updateWorldClock(worldClockInfo: WorldClockInfo): Promise<void> {
const rdbStore = await this.getRdbStore();
try {
rdbStore.beginTransaction();
const predicates = new dataRdb.RdbPredicates(DATA_TABLE);
if (worldClockInfo.id) {
predicates.equalTo('ID', worldClockInfo?.id);
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateWorldClock AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left worldClockInfo AST#identifier#Right AST#type_annotation#Left A... | async updateWorldClock(worldClockInfo: WorldClockInfo): Promise<void> {
const rdbStore = await this.getRdbStore();
try {
rdbStore.beginTransaction();
const predicates = new dataRdb.RdbPredicates(DATA_TABLE);
if (worldClockInfo.id) {
predicates.equalTo('ID', worldClockInfo?.id);
... | https://gitee.com/openharmony-sig/applications_clock.git | 6605613c526e66aaaa3082583b959481e0ef1038 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | with | Copying version of using the bracket notation to change the value of a given index.
It returns a new Array with the element at the given index replaced with the given value.
@param index to replace
@param value new value
@returns a new Array with the element at the given index replaced with the given value | public with(index: int, value: T): Array<T> {
let arr = new T[this.data.length]
for(let i: int = 0; i < this.data.length; i++) {
arr[i] = this.data[i]
}
arr[index] = value
return new Array<T>(arr)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#with_statement#Left AST#with#Left with AST#with#Right AST#parenthesized_expression#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST... | public with(index: int, value: T): Array<T> {
let arr = new T[this.data.length]
for(let i: int = 0; i < this.data.length; i++) {
arr[i] = this.data[i]
}
arr[index] = value
return new Array<T>(arr)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | d7dc9aaa35cb76445e441f6bcb0abe3d8b0ed410 | gitee |
openharmony/applications_permission_manager | permissionmanager/src/main/ets/common/permissionGroupManager/PermissionGroupManager.ets | arkts | getClickSituation | 处理点击状态
@param buttonStatus
return | public getClickSituation(buttonStatus: ButtonStatus): ClickOption {
switch (buttonStatus) {
case ButtonStatus.ALLOW:
case ButtonStatus.ALLOW_THIS_TIME:
case ButtonStatus.THIS_TIME_ONLY:
case ButtonStatus.ALLOW_ONLY_DURING_USE:
return ClickOption.GRANT;
case ButtonStatus.CANCE... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getClickSituation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buttonStatus AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi... | public getClickSituation(buttonStatus: ButtonStatus): ClickOption {
switch (buttonStatus) {
case ButtonStatus.ALLOW:
case ButtonStatus.ALLOW_THIS_TIME:
case ButtonStatus.THIS_TIME_ONLY:
case ButtonStatus.ALLOW_ONLY_DURING_USE:
return ClickOption.GRANT;
case ButtonStatus.CANCE... | https://gitee.com/openharmony/applications_permission_manager.git | d2b46c939db08e0f8b747c2d85c06941af0bf1b6 | gitee |
openharmony/codelabs | ETSUI/SchoolTimeTable/entry/src/main/ets/components/ExportCourseDialog.ets | arkts | aboutToAppear | 默认最大节次,可根据实际课程调整 | aboutToAppear() {
this.preparePreviewData();
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
this.preparePreviewData();
} | https://gitcode.com/openharmony/codelabs | ada76383230714fbfdf7ccc800e1d553ddfd4879 | gitcode |
qiuhaotc/HarmonyOSPlayground | entry/src/main/ets/utils/DateUtil.ets | arkts | formatYearMonth | 获取年月显示 YYYY-MM -> YYYY年MM月 | static formatYearMonth(yearMonth: string): string {
if (!yearMonth || yearMonth.length < 7) {
return yearMonth;
}
const parts = yearMonth.split('-');
return `${parts[0]}年${parts[1]}月`;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left formatYearMonth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left yearMonth AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri... | static formatYearMonth(yearMonth: string): string {
if (!yearMonth || yearMonth.length < 7) {
return yearMonth;
}
const parts = yearMonth.split('-');
return `${parts[0]}年${parts[1]}月`;
} | https://github.com/qiuhaotc/HarmonyOSPlayground | d9e07e8cc17fafdeadcc103cef1af84a52e80968 | github |
SuperBird007/HarmonyApp_beichengyu | entry/src/main/ets/pages/MainPage.ets | arkts | build | 被选中的页签索引 | build() {
Tabs({ index: this.currentTabIndex }) { // index 指示 Tabs 显示哪个页面
TabContent() {
HomeFragment()
}.tabBar(this.barBuilder(0, '难度', $r('app.media.fenlei'), $r('app.media.fenlei_unselect')))
TabContent() {
PracticeFragment()
}.tabBar(this.barBuilder(1, '背词', $r('app.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#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Tabs({ index: this.currentTabIndex }) { // index 指示 Tabs 显示哪个页面
TabContent() {
HomeFragment()
}.tabBar(this.barBuilder(0, '难度', $r('app.media.fenlei'), $r('app.media.fenlei_unselect')))
TabContent() {
PracticeFragment()
}.tabBar(this.barBuilder(1, '背词', $r('app.m... | https://github.com/SuperBird007/HarmonyApp_beichengyu | 62707f000c249d1d36b63a5f3ab22890aedf2f4c | github |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryBuilder.ets | arkts | where | 添加 WHERE 条件
@param column 列名或属性名
@param operator 操作符
@param value 值
@returns 当前实例(支持链式调用) | where(column: string, operator: ConditionOperator, value: ValueType): QueryBuilder {
const resolvedColumn = this.getResolvedColumnName(column)
if (resolvedColumn === null) {
throw new InvalidConditionError(column, `列 '${column}' 在实体 '${this.entityName}' 中不存在`)
}
this.ensureValidOperator(operator... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left where AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left column AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#R... | where(column: string, operator: ConditionOperator, value: ValueType): QueryBuilder {
const resolvedColumn = this.getResolvedColumnName(column)
if (resolvedColumn === null) {
throw new InvalidConditionError(column, `列 '${column}' 在实体 '${this.entityName}' 中不存在`)
}
this.ensureValidOperator(operator... | https://github.com/offlinecat-dev/OCNetORM | f6af715b001a3a8c3b9aa7c1b7da071c6cdf08cb | github |
jjjjjjava/ffmpeg_tools | src/main/ets/ffmpeg/FFmpegManager.ets | arkts | waitForTask | 等待任务(阻塞) | private waitForTask(): Promise<Task | null> {
return new Promise<Task | null>((resolve) => {
// 如果队列有任务,直接返回
if (this.taskQueue.length > 0) {
resolve(this.taskQueue.shift() || null);
return;
}
// 没有任务,阻塞等待
this.taskResolver = () => {
resolve(this.taskQu... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left waitForTask 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... | private waitForTask(): Promise<Task | null> {
return new Promise<Task | null>((resolve) => {
// 如果队列有任务,直接返回
if (this.taskQueue.length > 0) {
resolve(this.taskQueue.shift() || null);
return;
}
// 没有任务,阻塞等待
this.taskResolver = () => {
resolve(this.taskQu... | https://github.com/jjjjjjava/ffmpeg_tools | b9dc1524d051d20481e7c53416a143da10ca5e3a | github |
Octo-o-o-o/harmonyos-ai-workspace | samples/templates/huks-secure-store/SecureStore.ets | arkts | wrap | UTF-8 string → `gcm2|nonceHex|tagHex|cipherHex` | private async wrap(value: string): Promise<string> {
// AES-GCM 的 nonce 必须来自 CSPRNG —— Math.random() 重用一次就彻底 break
// GCM(key recovery)。cryptoFramework.createRandom() 走设备硬件 RNG。
// 注意:GCM 用 HUKS_TAG_NONCE,不是 HUKS_TAG_IV(IV 是 CBC/CTR 的命名)。
const nonce: Uint8Array = cryptoFramework.createRandom().genera... | 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 wrap AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Ri... | private async wrap(value: string): Promise<string> {
// AES-GCM 的 nonce 必须来自 CSPRNG —— Math.random() 重用一次就彻底 break
// GCM(key recovery)。cryptoFramework.createRandom() 走设备硬件 RNG。
// 注意:GCM 用 HUKS_TAG_NONCE,不是 HUKS_TAG_IV(IV 是 CBC/CTR 的命名)。
const nonce: Uint8Array = cryptoFramework.createRandom().genera... | https://github.com/Octo-o-o-o/harmonyos-ai-workspace | 068f69c39a69e5d7bdcf890fe2c7b49fc580f46a | github |
arkui-x/samples | CodeLab/Cases/feature/customstepper/src/main/ets/view/HeaderView.ets | arkts | build | 当前页面的索引,由索引及titleArray确定当前页面的Title | build() {
Column() {
Row() {
Image($r("sys.media.ohos_ic_compnent_titlebar_back"))
.height($r("app.integer.stepper_header_image_height"))
.aspectRatio(1)
.onClick(() => {
notImplementPrompt();
})
Text(this.titleArray[this.currentIndex])
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
Row() {
Image($r("sys.media.ohos_ic_compnent_titlebar_back"))
.height($r("app.integer.stepper_header_image_height"))
.aspectRatio(1)
.onClick(() => {
notImplementPrompt();
})
Text(this.titleArray[this.currentIndex])
... | https://gitcode.com/arkui-x/samples | 5feff90e107b7306cf24805da8caaafce47c40be | gitcode |
XJTUWYD/ArkDiff | entry/src/main/ets/engine/CharDiffEngine.ets | arkts | diffChars | 计算两个字符串的字符级差异段
@param oldStr 旧版本字符串
@param newStr 新版本字符串
@returns CharSegment[] 标注了每个字符范围的差异类型 | static diffChars(oldStr: string, newStr: string): CharSegment[] {
if (oldStr === newStr) {
return [];
}
const m = oldStr.length;
const n = newStr.length;
if (m === 0 && n === 0) return [];
// 构建 LCS DP 表(滚动数组:仅保留上一行,降低内存)
let prev = new Array<number>(n + 1).fill(0);
// 同时保留完整表用... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left diffChars AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left oldStr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left stri... | static diffChars(oldStr: string, newStr: string): CharSegment[] {
if (oldStr === newStr) {
return [];
}
const m = oldStr.length;
const n = newStr.length;
if (m === 0 && n === 0) return [];
// 构建 LCS DP 表(滚动数组:仅保留上一行,降低内存)
let prev = new Array<number>(n + 1).fill(0);
// 同时保留完整表用... | https://github.com/XJTUWYD/ArkDiff | d10816e8c2b143aa150f7d6e0c0dd0a316c78cbd | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/components/charts/line/LineChartRenderer.ets | arkts | hexToRgba | HEX转RGBA | private hexToRgba(hex: string, alpha: number): string {
const r = parseInt(hex.slice(1, 3), 16);
const g = parseInt(hex.slice(3, 5), 16);
const b = parseInt(hex.slice(5, 7), 16);
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left hexToRgba AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left hex AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left stri... | private hexToRgba(hex: string, alpha: number): string {
const r = parseInt(hex.slice(1, 3), 16);
const g = parseInt(hex.slice(3, 5), 16);
const b = parseInt(hex.slice(5, 7), 16);
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
} | https://github.com/LJ666-ui/harmony-health-care | a0650ff785b4cfd566c9d7a3d19fc9de2c5437c1 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Plugin/HSPPluginManager.ets | arkts | registerHSPPlugin | 注册HSP插件 | private async registerHSPPlugin(hapModuleInfo: bundleManager.HapModuleInfo): Promise<void> {
try {
// 使用明确的接口替代对象字面量类型声明
const moduleAccess = hapModuleInfo as HapModuleInfoAccess;
const moduleName = moduleAccess.name || '';
const bundleName = moduleAccess.bundleName || '';
// ... | 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 registerHSPPlugin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left hapModuleInfo AST#identifier#Right ... | private async registerHSPPlugin(hapModuleInfo: bundleManager.HapModuleInfo): Promise<void> {
try {
// 使用明确的接口替代对象字面量类型声明
const moduleAccess = hapModuleInfo as HapModuleInfoAccess;
const moduleName = moduleAccess.name || '';
const bundleName = moduleAccess.bundleName || '';
// ... | https://github.com/DaLongZhuaZi/manxia | a37f88f4fe1aa1a0724727b0289237fb0b616146 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/service/ChartService.ets | arkts | calculateAxisRange | 计算坐标轴范围(Nice Numbers算法)
生成美观的刻度值 | public calculateAxisRange(
data: number[],
options: AxisOptions = {}
): AxisRange {
const tickCount = options.tickCount ?? 5;
const nice = options.nice ?? true;
// 计算数据范围
let min = options.min ?? Math.min(...data);
let max = options.max ?? Math.max(...data);
// 处理包含0的情况
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left calculateAxisRange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_exp... | public calculateAxisRange(
data: number[],
options: AxisOptions = {}
): AxisRange {
const tickCount = options.tickCount ?? 5;
const nice = options.nice ?? true;
// 计算数据范围
let min = options.min ?? Math.min(...data);
let max = options.max ?? Math.max(...data);
// 处理包含0的情况
... | https://github.com/LJ666-ui/harmony-health-care | a5ab4cef9363aa3cf7b847d323d49ccc27a3890d | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/BookshelfCategoryManager.ets | arkts | swapCategoryOrder | 交换两个分类的顺序 | async swapCategoryOrder(categoryId1: string, categoryId2: string): Promise<void> {
const cat1 = this.categories.find(c => c.id === categoryId1);
const cat2 = this.categories.find(c => c.id === categoryId2);
if (cat1 && cat2) {
const tempOrder = cat1.order;
cat1.order = cat2.order;
cat2.o... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left swapCategoryOrder AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left categoryId1 AST#identifier#Right AST#type_annotation#Left AST... | async swapCategoryOrder(categoryId1: string, categoryId2: string): Promise<void> {
const cat1 = this.categories.find(c => c.id === categoryId1);
const cat2 = this.categories.find(c => c.id === categoryId2);
if (cat1 && cat2) {
const tempOrder = cat1.order;
cat1.order = cat2.order;
cat2.o... | https://github.com/DaLongZhuaZi/manxia | 7eae3999e7027aae4900a84d58958bfa1b173e0a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Theme/AppColors.ets | arkts | getColor | 根据颜色角色获取颜色
@param role 颜色角色
@returns 当前主题对应的颜色字符串 | static getColor(role: ColorRole): string {
return getColorForCurrentTheme(role);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left role AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ColorRo... | static getColor(role: ColorRole): string {
return getColorForCurrentTheme(role);
} | https://github.com/DaLongZhuaZi/manxia | 7b145a9d3f8315996b9e4da2b218934b37854eb7 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Byte.ets | arkts | toLong | Returns value of this instance
@returns { long }
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public override toLong(): long {
return this.value.toLong();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left toLong AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left... | public override toLong(): long {
return this.value.toLong();
} | https://gitcode.com/iop123123/arkts-static-skills | 2ac2183d865dab07ce55d49aed84beee21a9ec30 | gitcode |
offlinecat-dev/OCNetORM | example/UsageExample.ets | arkts | softDeleteExample | 软删除示例 | async function softDeleteExample(): Promise<void> {
const repository = new Repository('ArticleEntity')
// 1. 正常查询(自动排除已删除数据)
const activeArticles = await repository.findAll()
console.info(`活跃文章: ${activeArticles.length}`)
// 2. 包含已删除数据的查询
const allArticles = await repository.findAll(true)
console.info(`... | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left softDeleteExample AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left A... | async function softDeleteExample(): Promise<void> {
const repository = new Repository('ArticleEntity')
// 1. 正常查询(自动排除已删除数据)
const activeArticles = await repository.findAll()
console.info(`活跃文章: ${activeArticles.length}`)
// 2. 包含已删除数据的查询
const allArticles = await repository.findAll(true)
console.info(`... | https://github.com/offlinecat-dev/OCNetORM | 4637d3ec280e826e5dd8bc65b0444afd1f34b5ef | github |
PollenWang6/HiXD | entry/src/main/ets/utils/HttpUtil.ets | arkts | requestNoRedirect | 发送请求但不自动跟随重定向(公共底层方法)
getNoRedirect 和 postNoRedirect 都委托此方法 | private requestNoRedirect(
url: string,
method: http.RequestMethod,
bodyStr: string | undefined,
headers?: Record<string, string>
): Promise<HttpResponse> {
return new Promise<HttpResponse>((resolve, reject) => {
const req = http.createHttp();
const reqHeaders: Record<string, string>... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left requestNoRedirect AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | private requestNoRedirect(
url: string,
method: http.RequestMethod,
bodyStr: string | undefined,
headers?: Record<string, string>
): Promise<HttpResponse> {
return new Promise<HttpResponse>((resolve, reject) => {
const req = http.createHttp();
const reqHeaders: Record<string, string>... | https://github.com/PollenWang6/HiXD | 3c8882ade8a65f5ff4e1220443d832a592f3d14e | github |
honjow/Next2V | shared/src/main/ets/parser/V2exWriteFormParser.ets | arkts | extractPageOnce | The numeric `once` token that appears across an authed V2EX page (theme toggle, sign-out, …). All
occurrences on a page share the same value, so the first numeric `once=<n>` is the page once. | static extractPageOnce(html: string): string {
const m = (html || '').match(/[?&]once=(\d+)/) || (html || '').match(/once=(\d+)/)
return m && m[1] ? m[1] : ''
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left extractPageOnce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left html AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | static extractPageOnce(html: string): string {
const m = (html || '').match(/[?&]once=(\d+)/) || (html || '').match(/once=(\d+)/)
return m && m[1] ? m[1] : ''
} | https://github.com/honjow/Next2V | 6399cefe9fbe98e0eec7cb3cfb04e5b66508c34c | github |
erosTeam/NextE | feature/home/src/main/ets/viewmodel/GalleryListViewModel.ets | arkts | syncSource | Seed source/period from the shared HomeSourceState holder on (re)mount, WITHOUT reloading —
loadData() runs right after. The pinned source bar is the single source of truth; this keeps a
freshly-constructed VM aligned with a holder that may already have been changed. | syncSource(source: string, tl: number): void {
this.source = source
this.toplistTl = tl
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left syncSource AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left source AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AS... | syncSource(source: string, tl: number): void {
this.source = source
this.toplistTl = tl
} | https://github.com/erosTeam/NextE | 1481c16363ddcad9916d927480e16051db77a4d0 | github |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/pages/CalendarPage.ets | arkts | initializeSampleEvents | 初始化示例事件 | initializeSampleEvents() {
const today = new Date()
const now = today.getTime();
const events: CalendarEvent[] = []
this.events = events
this.selectedDate = today
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initializeSampleEvents 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_b... | initializeSampleEvents() {
const today = new Date()
const now = today.getTime();
const events: CalendarEvent[] = []
this.events = events
this.selectedDate = today
} | https://gitcode.com/openharmony/codelabs | b66f7c3792eff94f4f1669445d7be9fadcd47793 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Boolean.ets | arkts | isFalse | Checks if this instance is false
@returns { boolean } True if the instance value is false, false otherwise
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public isFalse(): boolean {
return this.value == false;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isFalse AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boole... | public isFalse(): boolean {
return this.value == false;
} | https://gitcode.com/iop123123/arkts-static-skills | 38a416a5dfc481cb8503b59c6dca706e71971c7c | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.uri.ets | arkts | createFromParts | Creates an opaque Uri from the given components.
@param { string } scheme - of the URI.
@param { string } ssp -scheme-specific-part, everything between the scheme separator (':') and the fragment
separator ('#'), which will get encoded.
@param { string } fragment - fragment, everything after the '#', null if undefined... | static createFromParts(scheme: string, ssp: string, fragment: string): URI {
let uriStr: string = scheme;
uriStr += ':' + encodeURIComponent(ssp);
if (fragment != "") {
uriStr += '#' + encodeURIComponent(fragment);
}
return new URI(uriStr);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createFromParts 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#Lef... | static createFromParts(scheme: string, ssp: string, fragment: string): URI {
let uriStr: string = scheme;
uriStr += ':' + encodeURIComponent(ssp);
if (fragment != "") {
uriStr += '#' + encodeURIComponent(fragment);
}
return new URI(uriStr);
} | https://gitcode.com/iop123123/arkts-static-skills | 1042ea21061121b0fddb061be105c71223f14cc8 | gitcode |
RedRackham-R/WanAndroidHarmoney | entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets | arkts | subscribeUserInfoUpdateEvent | 订阅用户信息更新事件 | subscribeUserInfoUpdateEvent(key: string, callback: (eventData: emitter.EventData) => void) {
EventBus.getInstance().regist(WanEventId.EVENT_UPDATE_USER_INFO, key, callback);
} | AST#program#Left AST#ERROR#Left AST#identifier#Left subscribeUserInfoUpdateEvent AST#identifier#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#Right AST#call_expression... | subscribeUserInfoUpdateEvent(key: string, callback: (eventData: emitter.EventData) => void) {
EventBus.getInstance().regist(WanEventId.EVENT_UPDATE_USER_INFO, key, callback);
} | https://github.com/RedRackham-R/WanAndroidHarmoney | 733c8e4b6d013e2d18068b2acbde6aad87d8e1ba | github |
fbinba3955/Flymby | main/src/main/ets/pages/home/media/EmbyEpisodeDetail/index.ets | arkts | scrollToTargetEpisode | 滚动剧集到指定为止
页面初始化的时候,最好延迟执行以下 | scrollToTargetEpisode() {
if (this.scrollToEpisodeMethod) {
this.scrollToEpisodeMethod(this.mCurrentEpisodeIndex)
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left scrollToTargetEpisode 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_bl... | scrollToTargetEpisode() {
if (this.scrollToEpisodeMethod) {
this.scrollToEpisodeMethod(this.mCurrentEpisodeIndex)
}
} | https://github.com/fbinba3955/Flymby | 7d2a78173df153fb183d893d64207b7429e44925 | github |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/services/DataCrypto.ets | arkts | getCloudPref | 获取 cloudPref 值 (通过 SQL) | private getCloudPref(key: string): string {
const store = this.getStore();
if (store) {
try {
const rs = store.querySqlSync("SELECT value FROM cryptoparams WHERE key = ?", [key]);
let result = '';
if (rs.goToFirstRow()) {
result = rs.getString(0);
}
rs.c... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getCloudPref 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 s... | private getCloudPref(key: string): string {
const store = this.getStore();
if (store) {
try {
const rs = store.querySqlSync("SELECT value FROM cryptoparams WHERE key = ?", [key]);
let result = '';
if (rs.goToFirstRow()) {
result = rs.getString(0);
}
rs.c... | https://github.com/Mydstiny/RemoteDeskHarmonyOS | 6f11ac5e8452e4dbbfb27b1de4eae4a8853d982d | github |
Coke0807/NewsAPP-HarmonyOS | NewsApp/entry/src/main/ets/pages/LoginPage.ets | arkts | goToRegister | 跳转到注册页 | goToRegister() {
router.pushUrl({ url: 'pages/RegisterPage' });
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left goToRegister 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 ... | goToRegister() {
router.pushUrl({ url: 'pages/RegisterPage' });
} | https://github.com/Coke0807/NewsAPP-HarmonyOS | d89f9faabe9ef153e0bbd8ac5f04e271aeaab592 | github |
openharmony/applications_contacts | entry/src/main/ets/model/ContactAbilityModel.ets | arkts | getIdByTelephone | Querying IDs by Phone Number
@param {string} DAHelper
@param {string} addParams Phone number
@param {Object} callBack Contact ID array | async getIdByTelephone(number: ValueType, callBack: Function, context?: common.UIAbilityContext | Context) {
HiLog.i(TAG, 'Start to query contactID by phone number.');
let DAHelper: dataShare.DataShareHelper = await dataShare.createDataShareHelper(context ? context :
globalThis.context, Contacts.CONTENT_U... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getIdByTelephone AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left number AST#identifier#Right AST#type_annotation#Left ... | async getIdByTelephone(number: ValueType, callBack: Function, context?: common.UIAbilityContext | Context) {
HiLog.i(TAG, 'Start to query contactID by phone number.');
let DAHelper: dataShare.DataShareHelper = await dataShare.createDataShareHelper(context ? context :
globalThis.context, Contacts.CONTENT_U... | https://gitee.com/openharmony/applications_contacts.git | ccc5166b55a6c3dc482e1845d12f896b12e6b1cb | gitee |
Yebingiscn/SweetVideo | entry/src/main/ets/database/Preferences.ets | arkts | getFileFolder | 所有文件夹视频数据 | static getFileFolder(context: Context) {
const folders = PreferencesUtil.getPreferencesValue(context, DATA_BASE_NAME, 'file_folder', []) as FileFolder[]
folders.sort((a, b) => Number(a.date) - Number(b.date))
return folders
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getFileFolder 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... | static getFileFolder(context: Context) {
const folders = PreferencesUtil.getPreferencesValue(context, DATA_BASE_NAME, 'file_folder', []) as FileFolder[]
folders.sort((a, b) => Number(a.date) - Number(b.date))
return folders
} | https://github.com/Yebingiscn/SweetVideo | 6a4d79bb59f0987db1b8ec66ab469b79c8225123 | github |
qiuhaotc/HarmonyOSPlayground | entry/src/main/ets/database/RecurringBillDatabase.ets | arkts | convertResultSetToRecords | 转换ResultSet为记录数组 | private convertResultSetToRecords(resultSet: relationalStore.ResultSet): GeneratedBillRecord[] {
const records: GeneratedBillRecord[] = [];
while (resultSet.goToNextRow()) {
const record = new GeneratedBillRecord(
resultSet.getLong(resultSet.getColumnIndex('recurringConfigId')),
resultS... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertResultSetToRecords AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AS... | private convertResultSetToRecords(resultSet: relationalStore.ResultSet): GeneratedBillRecord[] {
const records: GeneratedBillRecord[] = [];
while (resultSet.goToNextRow()) {
const record = new GeneratedBillRecord(
resultSet.getLong(resultSet.getColumnIndex('recurringConfigId')),
resultS... | https://github.com/qiuhaotc/HarmonyOSPlayground | b6850530048df3137bf2fc88f63b01a21d6defba | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/DataValidator.ets | arkts | logValidationErrors | 记录验证错误
@param result - 验证结果
@param context - 上下文信息 | static logValidationErrors(result: ValidationResult, context: string = ''): void {
if (!result.isValid) {
const contextMsg = context ? `[${context}] ` : '';
logger.warn(TAG, `${contextMsg}验证失败: ${result.errors.join(', ')}`);
}
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left logValidationErrors AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left result AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | static logValidationErrors(result: ValidationResult, context: string = ''): void {
if (!result.isValid) {
const contextMsg = context ? `[${context}] ` : '';
logger.warn(TAG, `${contextMsg}验证失败: ${result.errors.join(', ')}`);
}
} | https://github.com/DaLongZhuaZi/manxia | 4472347a5e7e9f2250dbdeae8599cb869340aaea | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | findElementsBySingleRule | 根据单个规则查找元素
支持: class.xxx, id.xxx, tag.div, tag.a.0, text.xxx, children
支持索引: tag.a.0, tag.a.-1, tag.a[0], tag.a[0:3] | private findElementsBySingleRule(content: string, rule: string): string[] {
// 解析索引选择器
const indexResult = this.parseIndexSelector(rule);
const selector = indexResult.selector;
const requiredCount = this.estimateRequiredElementCount(indexResult);
// 获取所有匹配的元素
let results: string[] = [];
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left findElementsBySingleRule AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left content AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left strin... | private findElementsBySingleRule(content: string, rule: string): string[] {
// 解析索引选择器
const indexResult = this.parseIndexSelector(rule);
const selector = indexResult.selector;
const requiredCount = this.estimateRequiredElementCount(indexResult);
// 获取所有匹配的元素
let results: string[] = [];
... | https://github.com/DaLongZhuaZi/manxia | 31e9fe2c1d7f8510b84e6c917934125dec47ed48 | github |
qiuhaotc/HarmonyOSPlayground | entry/src/main/ets/pages/AddBillPage.ets | arkts | showEndDatePickerDialog | 显示截止日期选择器 | showEndDatePickerDialog() {
// 截止日期必须晚于开始日期
const minDate = new Date(this.selectedDate);
minDate.setDate(minDate.getDate() + 1);
const selectedEndDate = this.endDate ? new Date(this.endDate) : minDate;
this.getUIContext().showDatePickerDialog({
s... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left showEndDatePickerDialog 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_... | showEndDatePickerDialog() {
// 截止日期必须晚于开始日期
const minDate = new Date(this.selectedDate);
minDate.setDate(minDate.getDate() + 1);
const selectedEndDate = this.endDate ? new Date(this.endDate) : minDate;
this.getUIContext().showDatePickerDialog({
s... | https://github.com/qiuhaotc/HarmonyOSPlayground | f33acc6620d069436cd3103d5548efeee11aa97e | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Object.ets | arkts | toString | Converts this object to a string
@returns { String } A string representing the object.
@throws { TypeError } The object is an unexpected fixedarray.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public toString(): String {
const thisObj = this
if (thisObj instanceof Function) {
return "Cannot get source code of function"
}
const thisType = Class.of(thisObj)
if (thisType.isFixedArray()) {
if (thisObj instanceof FixedArray<Any>) {
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left String AST#id... | public toString(): String {
const thisObj = this
if (thisObj instanceof Function) {
return "Cannot get source code of function"
}
const thisType = Class.of(thisObj)
if (thisType.isFixedArray()) {
if (thisObj instanceof FixedArray<Any>) {
... | https://gitcode.com/iop123123/arkts-static-skills | bd5a9a3d1a820790a2d6f42a1f67d12cc4012b5f | gitcode |
LJ666-ui/harmony-health-care | entry/src/main/ets/services/WebSocketService.ets | arkts | init | 初始化WebSocket连接 | async init(userId: string, userRole: string): Promise<boolean> {
this.userId = userId;
this.userRole = userRole;
console.info('WebSocket服务初始化');
console.info('用户ID:', userId);
console.info('用户角色:', userRole);
// 注意:实际WebSocket连接需要使用@ohos.net.webSocket
// 这里仅作为服务层示例
this.conne... | AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left init AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left userId ... | async init(userId: string, userRole: string): Promise<boolean> {
this.userId = userId;
this.userRole = userRole;
console.info('WebSocket服务初始化');
console.info('用户ID:', userId);
console.info('用户角色:', userRole);
// 注意:实际WebSocket连接需要使用@ohos.net.webSocket
// 这里仅作为服务层示例
this.conne... | https://github.com/LJ666-ui/harmony-health-care | 64a4a7ddbd70d4a4e0277924e2d0c7ad2f7d1fe6 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/testing/arktest.ets | arkts | final | Runs this test.
@returns {boolean}
@syscap SystemCapability.Utils.Lang
@FaAndStageModel
@since 24 | final run(): boolean {
let testcaseName: string = this.getFullName();
let startMs = Date.now();
try {
this.callback();
} catch (e) {
if (e instanceof Error) {
this.handleTestError(testcaseName, startMs, e as Erro... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left final AST#identifier#Right AST#ERROR#Left AST#identifier#Left run AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right ... | final run(): boolean {
let testcaseName: string = this.getFullName();
let startMs = Date.now();
try {
this.callback();
} catch (e) {
if (e instanceof Error) {
this.handleTestError(testcaseName, startMs, e as Erro... | https://gitcode.com/iop123123/arkts-static-skills | 43abd028afb8a2dfffc11230fe2e5f3ad268fc76 | gitcode |
openharmony/multimedia_camera_framework | frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets | arkts | onSessionErrorChange | 监听捕获会话错误变化
@param session - 相机捕获会话对象
@returns 无返回值 | onSessionErrorChange(session: camera.PhotoSession | camera.VideoSession): void {
try {
session.on('error', (captureSessionError: BusinessError): void => {
Logger.info(TAG,
'onCaptureSessionErrorChange captureSession fail: ' + JSON.stringify(captureSessionError.code));
});
} catch... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onSessionErrorChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left session AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#member_expression#Lef... | onSessionErrorChange(session: camera.PhotoSession | camera.VideoSession): void {
try {
session.on('error', (captureSessionError: BusinessError): void => {
Logger.info(TAG,
'onCaptureSessionErrorChange captureSession fail: ' + JSON.stringify(captureSessionError.code));
});
} catch... | https://gitee.com/openharmony/multimedia_camera_framework.git | a5e808a536e8316a06993e5c9bdabaa7f3c6b195 | gitee |
openharmony/codelabs | ETSUI/HarmonyPhotoAlbum/entry/src/main/ets/service/AuthService.ets | arkts | verifyPin | 校验 PIN 码是否正确 | static async verifyPin(context: common.UIAbilityContext, pin: string): Promise<boolean> {
const store = await AuthService.getStore(context);
const value = await store.get(AuthService.KEY_PIN, '') as string;
return value === pin;
} | 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 verifyPin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#... | static async verifyPin(context: common.UIAbilityContext, pin: string): Promise<boolean> {
const store = await AuthService.getStore(context);
const value = await store.get(AuthService.KEY_PIN, '') as string;
return value === pin;
} | https://gitcode.com/openharmony/codelabs | b58592161f3d684ec93aadf2df4ca457a2cc72b0 | gitcode |
openharmony/applications_mms | entry/src/main/ets/utils/MmsDatabaseHelper.ets | arkts | update | Update Interface
@param predicates
@param predicates
@return | async update(predicates, valueBucket) {
if (this.mRdbStore !== null) {
let changedRows = await this.mRdbStore.update(valueBucket, predicates);
HiLog.i(TAG, 'update, changedRows=' + changedRows);
} else {
HiLog.w(TAG, 'mRdbStore is null, update fail.');
}
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left update AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left predicates AST#identifier#Right AST#,#Left , AST#,#Right A... | async update(predicates, valueBucket) {
if (this.mRdbStore !== null) {
let changedRows = await this.mRdbStore.update(valueBucket, predicates);
HiLog.i(TAG, 'update, changedRows=' + changedRows);
} else {
HiLog.w(TAG, 'mRdbStore is null, update fail.');
}
... | https://gitee.com/openharmony/applications_mms.git | 28ef474d6f06b7e869321ce382f57d8fc77193c3 | gitee |
richshaw2015/nds | ohos/entry/src/main/ets/utils/SoundEffectManager.ets | arkts | play | 播放指定音效 | public play(effect: SoundEffect): void {
// 触发按键震动反馈
HapticManager.getInstance().trigger();
if (!this.initialized || !this.soundPool) return;
const enabled = this.settingsManager.getSync<boolean>('sfx_enabled', true);
if (!enabled) return;
const soundId = this.soundIds.get(effect);
if (... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left play AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left effect AST#identifier#Right AST#:#Left : AST#:#Right AST#ER... | public play(effect: SoundEffect): void {
// 触发按键震动反馈
HapticManager.getInstance().trigger();
if (!this.initialized || !this.soundPool) return;
const enabled = this.settingsManager.getSync<boolean>('sfx_enabled', true);
if (!enabled) return;
const soundId = this.soundIds.get(effect);
if (... | https://github.com/richshaw2015/nds | f53b96d2ccd4a5297bcfe559363ffbb04fbb7f6e | github |
FinalScave/SweetLine | platform/OHOS/sweetline/src/main/ets/Index.ets | arkts | getUri | Get the URI of the managed document | public getUri(): string {
return lib.Document_GetUri(this.nativeHandle);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getUri 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#R... | public getUri(): string {
return lib.Document_GetUri(this.nativeHandle);
} | https://github.com/FinalScave/SweetLine | fcf3edf1e3346ab6be1a4fbc9258cb2a4b5bc150 | github |
terryma2024/happyword | harmonyos/entry/src/main/ets/services/ParentRedemptionPoll.ets | arkts | injectTimers | Test seam: replace setTimeout/clearTimeout. | injectTimers(
setTimeoutFn: (cb: () => void, ms: number) => number,
clearTimeoutFn: (id: number) => void,
): void {
this.setTimeoutFn = setTimeoutFn;
this.clearTimeoutFn = clearTimeoutFn;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left injectTimers AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left setTimeoutFn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST... | injectTimers(
setTimeoutFn: (cb: () => void, ms: number) => number,
clearTimeoutFn: (id: number) => void,
): void {
this.setTimeoutFn = setTimeoutFn;
this.clearTimeoutFn = clearTimeoutFn;
} | https://github.com/terryma2024/happyword | ff717b631cdc27cc2ef95e516f640dee3148d9be | github |
OHPG/FinSdk | jellyfin/src/main/ets/api/ItemsApi.ets | arkts | getItemUserData | getItemUserData
@summary Get Item User Data.
@param {ItemsApiGetItemUserDataRequest} requestParameters Request parameters.
@throws {RequiredError}
@memberof ItemsApi | public async getItemUserData(requestParameters: ItemsApiGetItemUserDataRequest): Promise<UserItemDataDto> {
this.assertParam(requestParameters.itemId)
return this.apiClient.get({path: `/UserItems/${requestParameters.itemId}/UserData`, parameters: requestParameters, excludeParams: ['itemId']})
} | 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 getItemUserData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right A... | public async getItemUserData(requestParameters: ItemsApiGetItemUserDataRequest): Promise<UserItemDataDto> {
this.assertParam(requestParameters.itemId)
return this.apiClient.get({path: `/UserItems/${requestParameters.itemId}/UserData`, parameters: requestParameters, excludeParams: ['itemId']})
} | https://github.com/OHPG/FinSdk | db859ad60e9cdeb34a5b038477c106be43a93bf9 | github |
openharmony-sig/applications_clock | common/src/main/ets/utils/TimeUtil.ets | arkts | getDayOfWeek | Query which day of the week the Nth day is.
@param day Index of the queried week day
@param weekDayFormat The format of week day, the default value is WeekDayFormat.Short
@return The description of the queried day of a week in the corresponding language. | static getDayOfWeek(day: number, weekDayFormat: WeekDayFormat): string {
const options: intl.DateTimeOptions = { weekday: weekDayFormat || WeekDayFormat.Short };
const date = new Date(WEEK_DAY_BASIC_YEAR, WEEK_DAY_BASIC_MONTH);
date.setDate(day + 1);
let locale = new Intl.Locale(i18n.System.getSystemL... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getDayOfWeek AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left day AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left numb... | static getDayOfWeek(day: number, weekDayFormat: WeekDayFormat): string {
const options: intl.DateTimeOptions = { weekday: weekDayFormat || WeekDayFormat.Short };
const date = new Date(WEEK_DAY_BASIC_YEAR, WEEK_DAY_BASIC_MONTH);
date.setDate(day + 1);
let locale = new Intl.Locale(i18n.System.getSystemL... | https://gitee.com/openharmony-sig/applications_clock.git | cc603c06a9f99658f73e38e15c27980fbbc3586f | gitee |
Countly/countly-sdk-hos | library/src/main/ets/internal/ModuleBase.ets | arkts | onEnterForeground | Called when "foreground" transition detected (counter: 0 → 1). | public onEnterForeground(): void { } | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onEnterForeground AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expr... | public onEnterForeground(): void { } | https://github.com/Countly/countly-sdk-hos | ec2bb258fb7b64f213723e90ff310a72306071e9 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets | arkts | getTimezoneOffset | Returns the difference, in minutes, between a date as
evaluated in the UTC time zone, and the same date as evaluated in the local time zone.
@returns { long } get new date value
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public getTimezoneOffset(): long {
return this.TZOffset;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTimezoneOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left long... | public getTimezoneOffset(): long {
return this.TZOffset;
} | https://gitcode.com/iop123123/arkts-static-skills | ce9fec8434ff5950c17f523b4365dfa0c9a63351 | gitcode |
openharmony/codelabs | Data/PersonalAssistantPro/entry/src/main/ets/common/utils/DateUtils.ets | arkts | isSameDay | 判断是否是同一天 | public static isSameDay(ts1: number, ts2: number): boolean {
const d1 = new Date(ts1);
const d2 = new Date(ts2);
return d1.getFullYear() === d2.getFullYear() &&
d1.getMonth() === d2.getMonth() &&
d1.getDate() === d2.getDate();
} | 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 isSameDay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ts1 AST#identifier#Right AST#:#Left : AST#:#R... | public static isSameDay(ts1: number, ts2: number): boolean {
const d1 = new Date(ts1);
const d2 = new Date(ts2);
return d1.getFullYear() === d2.getFullYear() &&
d1.getMonth() === d2.getMonth() &&
d1.getDate() === d2.getDate();
} | https://gitcode.com/openharmony/codelabs | 698028364fef0cee9535077f3202ee6d3bd172f1 | gitcode |
Dabing-0x19d/berverage_HarmonyOS6.0 | entry/src/main/ets/utils/ShareUtil.ets | arkts | shareJsonFile | 分享JSON文件(用于店铺数据分享)
@param jsonData JSON数据字符串
@param fileName 文件名
@param uiContext UI上下文 | static async shareJsonFile(jsonData: string, fileName: string, uiContext: UIContext): Promise<void> {
try {
console.info('ShareUtil: Starting shareJsonFile');
const context = uiContext.getHostContext() as common.UIAbilityContext;
console.info('ShareUtil: Got UI ability context');
const fi... | 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 shareJsonFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left jsonData AST#identifier#Right AST#ERROR#Left AST#:#Left :... | static async shareJsonFile(jsonData: string, fileName: string, uiContext: UIContext): Promise<void> {
try {
console.info('ShareUtil: Starting shareJsonFile');
const context = uiContext.getHostContext() as common.UIAbilityContext;
console.info('ShareUtil: Got UI ability context');
const fi... | https://github.com/Dabing-0x19d/berverage_HarmonyOS6.0 | d9cb6e6b1ef09403866710f5542b936241eae402 | github |
openharmony/multimedia_camera_framework | frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets | arkts | photoOutputCallBack | 监听拍照事件 | photoOutputCallBack(photoOutput: camera.PhotoOutput): void {
try {
// 监听拍照开始
photoOutput.on('captureStartWithInfo', (err: BusinessError, captureStartInfo: camera.CaptureStartInfo): void => {
Logger.info(TAG, `photoOutputCallBack captureStartWithInfo success: ${JSON.stringify(captureStartInfo)}... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left photoOutputCallBack AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left photoOutput AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left camera AST#identif... | photoOutputCallBack(photoOutput: camera.PhotoOutput): void {
try {
// 监听拍照开始
photoOutput.on('captureStartWithInfo', (err: BusinessError, captureStartInfo: camera.CaptureStartInfo): void => {
Logger.info(TAG, `photoOutputCallBack captureStartWithInfo success: ${JSON.stringify(captureStartInfo)}... | https://gitee.com/openharmony/multimedia_camera_framework.git | e583fd84bafc66ea9218f2d86ee035eab4def04a | gitee |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/services/ExtensionLoader.ets | arkts | inspectSshPrivateKey | 解析/检测 OpenSSH 私钥
@param privateKeyPem PEM 格式私钥
@param passphrase 解密密码 (""=尝试无密码) | inspectSshPrivateKey(privateKeyPem: string, passphrase: string): SshPrivateKeyInfo {
try {
return rdpnapi.inspectSshPrivateKey(privateKeyPem, passphrase) as SshPrivateKeyInfo;
} catch (err) {
hilog.error(DOMAIN, TAG, '[ExtensionLoader] inspectSshPrivateKey: ' + JSON.stringify(err));
return {... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left inspectSshPrivateKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left privateKeyPem AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#... | inspectSshPrivateKey(privateKeyPem: string, passphrase: string): SshPrivateKeyInfo {
try {
return rdpnapi.inspectSshPrivateKey(privateKeyPem, passphrase) as SshPrivateKeyInfo;
} catch (err) {
hilog.error(DOMAIN, TAG, '[ExtensionLoader] inspectSshPrivateKey: ' + JSON.stringify(err));
return {... | https://github.com/Mydstiny/RemoteDeskHarmonyOS | c7bcdec4b7952d720a16737f58ded65a4cc786f5 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ArrayBlockingQueue.ets | arkts | constructor | Constructs a ArrayBlockingQueue with provided capaity.
@param { int } capacity the capacity of the ArrayBlockingQueue | constructor(capacity: int) {
if (capacity <= 0) {
throw new RangeError("ArrayBlockingQueue:: Invalid capacity");
}
this.capacitySize = capacity;
this.array = Array.create<T | undefined>(this.capacitySize, undefined);
this.mutex = Concur... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left capacity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Right AST#ERROR#Right ... | constructor(capacity: int) {
if (capacity <= 0) {
throw new RangeError("ArrayBlockingQueue:: Invalid capacity");
}
this.capacitySize = capacity;
this.array = Array.create<T | undefined>(this.capacitySize, undefined);
this.mutex = Concur... | https://gitcode.com/iop123123/arkts-static-skills | 2c6e5b3fd4ac6f4f7bad3f1af04789634459675e | gitcode |
StarHeartY/CalculatorX | entry/src/main/ets/utils/EngineService.ets | arkts | calculateNative | 4. 封装 C++ 底层代数引擎的直接调用 | public static calculateNative(jsonStr: string, isRad: boolean, cppPrecisionMode: number): string {
return testNapi.calculate(jsonStr, isRad, cppPrecisionMode);
} | 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 calculateNative AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left jsonStr AST#identifier#Right AST#ERROR#Left AST#:#Left... | public static calculateNative(jsonStr: string, isRad: boolean, cppPrecisionMode: number): string {
return testNapi.calculate(jsonStr, isRad, cppPrecisionMode);
} | https://github.com/StarHeartY/CalculatorX | 72236f34c2b08e12a8559cfaf6166b9982846e60 | github |
openharmony/codelabs | ETSUI/AccountApp/entry/src/main/ets/pages/LoginPage.ets | arkts | aboutToAppear | 页面初始化 | aboutToAppear() {
try {
let context = getContext(this) as common.UIAbilityContext;
this.rdbHelper = new RdbHelper(context);
// 初始化数据库
this.rdbHelper.initRdbStore((isSuccess: boolean) => {
if (!isSuccess) {
this.showToast('数据库异常,请重启应用');
}
});
// 2. 初... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
try {
let context = getContext(this) as common.UIAbilityContext;
this.rdbHelper = new RdbHelper(context);
// 初始化数据库
this.rdbHelper.initRdbStore((isSuccess: boolean) => {
if (!isSuccess) {
this.showToast('数据库异常,请重启应用');
}
});
// 2. 初... | https://gitcode.com/openharmony/codelabs | 117b4165263803f4d94022bd42a810dc0360604c | gitcode |
encorexin/WordPressCMS | harmonyos/entry/src/main/ets/services/db/AISettingsDao.ets | arkts | fromResultSet | 异步映射 — 支持加密字段解密 | static async fromResultSet(rs: relationalStore.ResultSet): Promise<AISettingsModel> {
try {
const s = new AISettingsModel()
s.id = rs.getString(rs.getColumnIndex('id'))
s.userId = rs.getString(rs.getColumnIndex('user_id'))
s.name = rs.getString(rs.getColumnIndex('name'))
s.isDefault ... | 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 fromResultSet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rs AST#identifier#Right AST#:#Left : AST#:... | static async fromResultSet(rs: relationalStore.ResultSet): Promise<AISettingsModel> {
try {
const s = new AISettingsModel()
s.id = rs.getString(rs.getColumnIndex('id'))
s.userId = rs.getString(rs.getColumnIndex('user_id'))
s.name = rs.getString(rs.getColumnIndex('name'))
s.isDefault ... | https://github.com/encorexin/WordPressCMS | 221e33eeb20774972b13f7af5f140e3e7b8c5d07 | github |
Explore-In-HMOS-Wearable/expense-splitter | entry/src/main/ets/database/RDBBuilder.ets | arkts | build | Initialize RDB with migration handling (versions).
@param { Context } the application context.
@returns { Promise<relationalStore.RdbStore> } The RDB store {@link relationalStore.RdbStore}. | public async build(context: Context): Promise<relationalStore.RdbStore> {
const store = await relationalStore.getRdbStore(context, {
name: this.rdbName,
securityLevel: relationalStore.SecurityLevel.S1
});
// Fresh DB? Run creation queries once (version 0)
if (store.version === 0) {
a... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left build AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST#... | public async build(context: Context): Promise<relationalStore.RdbStore> {
const store = await relationalStore.getRdbStore(context, {
name: this.rdbName,
securityLevel: relationalStore.SecurityLevel.S1
});
// Fresh DB? Run creation queries once (version 0)
if (store.version === 0) {
a... | https://github.com/Explore-In-HMOS-Wearable/expense-splitter | 9de35db48ec4bb964532e1b94f37323b527b14c5 | github |
somnio-software/my-bot-pal | entry/src/main/ets/features/home/repository/PermissionRepository.ets | arkts | getDevicePermissions | Gets all device permissions with their current status
@param context Application context
@returns List of device permissions with their status | async getDevicePermissions(context: Context): Promise<DevicePermissionModel[]> {
// Get the permission models from the data source
const permissions = new DevicePermissionsDataSource().getPermissionModels();
// Check the current status of each permission without requesting them
for (let i = 0; i < pe... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getDevicePermissions AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST#type_annotation#Left AST#... | async getDevicePermissions(context: Context): Promise<DevicePermissionModel[]> {
// Get the permission models from the data source
const permissions = new DevicePermissionsDataSource().getPermissionModels();
// Check the current status of each permission without requesting them
for (let i = 0; i < pe... | https://github.com/somnio-software/my-bot-pal | 10fca5201b1ed90ae08d8799ed91094b9f00dc45 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | constructor | Creates an BigInt64Array from FixedArray<number>
@param { FixedArray<number> } numbers - data initializer
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public constructor(numbers: FixedArray<number>) {
this(numbers.length)
for (let i: int = 0; i < this.lengthInt; ++i) {
this.setUnsafe(i, numbers[i].toLong())
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left numbers AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_exp... | public constructor(numbers: FixedArray<number>) {
this(numbers.length)
for (let i: int = 0; i < this.lengthInt; ++i) {
this.setUnsafe(i, numbers[i].toLong())
}
} | https://gitcode.com/iop123123/arkts-static-skills | b9294c49724f080bba55dd9b1958d50ad51a03db | gitcode |
terryma2024/happyword | harmonyos/entry/src/main/ets/services/AudioService.ets | arkts | isPlayable | Test hook: whether a key is preloaded AND not muted. | isPlayable(key: string): boolean {
const slot: PlayerSlot | undefined = this.slots.get(key);
if (slot === undefined) {
return false;
}
return !slot.muted;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isPlayable 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#)... | isPlayable(key: string): boolean {
const slot: PlayerSlot | undefined = this.slots.get(key);
if (slot === undefined) {
return false;
}
return !slot.muted;
} | https://github.com/terryma2024/happyword | 6e4815239f2113e090d7629b3b2b23ad839524dc | github |
Delsin-Yu/JustPDF | entry/src/main/ets/pages/pdfview/PDFViewerViewModel.ets | arkts | canPanHorizontally | 内容宽于视口时需横向平移才能看全 | canPanHorizontally(uiContext: UIContext): boolean {
const b = this.getPanClampBounds(uiContext);
return b.scaledViewSizeVp.x > b.viewportSizeVp.x;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left canPanHorizontally AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uiContext AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left UIContext AST#identifier#Right A... | canPanHorizontally(uiContext: UIContext): boolean {
const b = this.getPanClampBounds(uiContext);
return b.scaledViewSizeVp.x > b.viewportSizeVp.x;
} | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/pages/pdfview/PDFViewerViewModel.ets#L435-L438 | 9dab718ed99adc7bcd1fc6466b9b58b1346bcd37 | github |
dingzhilin1990/zhilinclaw | src/security/SandboxedExecutor.ets | arkts | sanitizeString | 清理字符串(防止注入攻击) | private sanitizeString(input: string): string {
// 移除潜在的脚本标签
let sanitized = input.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
// 移除潜在的危险字符
sanitized = sanitized.replace(/[<>\"'&]/g, (char) => {
const entities: Record<string, string> = {
'<': '<',
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left sanitizeString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | private sanitizeString(input: string): string {
// 移除潜在的脚本标签
let sanitized = input.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
// 移除潜在的危险字符
sanitized = sanitized.replace(/[<>\"'&]/g, (char) => {
const entities: Record<string, string> = {
'<': '<',
... | https://github.com/dingzhilin1990/zhilinclaw | 50d4f2c735d81c949531712514801b845f1b5842 | github |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/services/HostSyncService.ets | arkts | getAllRelays | ==================== RustDesk 中继服务器配置 ==================== | getAllRelays(): RustDeskRelayConfig[] {
const result: RustDeskRelayConfig[] = [];
this.relays.forEach((r: RustDeskRelayConfig) => { result.push(r); });
return result;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAllRelays 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 RustDeskRelayConfig AST#identifier#Right AST#[#Le... | getAllRelays(): RustDeskRelayConfig[] {
const result: RustDeskRelayConfig[] = [];
this.relays.forEach((r: RustDeskRelayConfig) => { result.push(r); });
return result;
} | https://github.com/Mydstiny/RemoteDeskHarmonyOS | 625977b897765fc4d2c5bd482886750f2b8aba52 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/AudioVibrationService.ets | arkts | triggerMusicTimeVibration | 音乐模式时长振动(兼容): 30-80ms 短脉冲 | private triggerMusicTimeVibration(intensity: number): void {
if (intensity < 5) return;
// 音乐模式: 短脉冲 30-80ms,模拟鼓点
const duration = Math.floor(30 + intensity * 0.5); // 30-80ms
vibrator.startVibration({
type: 'time',
duration: duration
}, {
id: 0,
usage: 'physicalFeedback'
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left triggerMusicTimeVibration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left intensity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left nu... | private triggerMusicTimeVibration(intensity: number): void {
if (intensity < 5) return;
// 音乐模式: 短脉冲 30-80ms,模拟鼓点
const duration = Math.floor(30 + intensity * 0.5); // 30-80ms
vibrator.startVibration({
type: 'time',
duration: duration
}, {
id: 0,
usage: 'physicalFeedback'
... | https://github.com/AlkaidLab/moonlight-harmony | 3e0a837c9506f494c01a13e2132929c4f9e6d525 | github |
OSpark-Team/Free-PCM | library/src/main/ets/utils/AudioRendererPlayer.ets | arkts | setSpeed | 设置播放速度
@param speed - 播放速度倍率(0.25 ~ 4.0)
@remarks
- 1.0 = 正常速度
- 2.0 = 2 倍速
- 0.5 = 0.5 倍速(慢放)
- 支持范围:0.25 ~ 4.0
- 变速播放不会改变音调(如果系统支持)
@throws
- AudioRenderer 未初始化 | public setSpeed(speed: number): void {
if (!this.renderer) {
throw new Error('AudioRenderer not initialized');
}
this.renderer.setSpeed(speed);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setSpeed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left speed AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number... | public setSpeed(speed: number): void {
if (!this.renderer) {
throw new Error('AudioRenderer not initialized');
}
this.renderer.setSpeed(speed);
} | https://github.com/OSpark-Team/Free-PCM/blob/3440e7220d07d28815d172b4b3237145434075ee/library/src/main/ets/utils/AudioRendererPlayer.ets#L504-L509 | b8b0cc1b8a25dbc97907f79fedc25a3b00cea4cc | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/EventSourcingDAO.ets | arkts | getByDateRange | 根据时间范围查询事件 | static async getByDateRange(startDate: string, endDate: string): Promise<DomainEvent[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(DomainEvent.tableName);
predicates.greater... | 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 getByDateRange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left startDate AST#identifier#Right AST#ERROR#Left AST#:#Left... | static async getByDateRange(startDate: string, endDate: string): Promise<DomainEvent[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(DomainEvent.tableName);
predicates.greater... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | b8b4eece4da20d937f35c5404ef48b54e1c85ef5 | github |
Cool_foolisher1/ArkTSRepository | ArkTSDemo/products/entry/src/main/ets/view/MyDemoOldView.ets | arkts | selectTabBarColor | 选择TabBar的颜色
@param index TabBar下标索引
@returns TabBar颜色 | selectTabBarColor(index: number): ResourceColor {
return this.currentIndex === index ? '#007DFF' : '#808080'
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left selectTabBarColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Lef... | selectTabBarColor(index: number): ResourceColor {
return this.currentIndex === index ? '#007DFF' : '#808080'
} | https://gitcode.com/Cool_foolisher1/ArkTSRepository | abac30b936ba600a66c0dec0d26a804d24edd003 | gitcode |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/services/RustDeskLanDiscoveryService.ets | arkts | startScan | 启动局域网扫描
@param timeoutMs 超时时间 (默认 15s)
@returns 发现的设备列表 | startScan(timeoutMs: number = SCAN_TIMEOUT_MS): Promise<DiscoveredRustDeskPeer[]> {
return new Promise<DiscoveredRustDeskPeer[]>((resolve) => {
if (this.scanning) {
resolve([]);
return;
}
this.scanning = true;
const discovered: DiscoveredRustDeskPeer[] = [];
const see... | AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left startScan AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left timeoutMs AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignme... | startScan(timeoutMs: number = SCAN_TIMEOUT_MS): Promise<DiscoveredRustDeskPeer[]> {
return new Promise<DiscoveredRustDeskPeer[]>((resolve) => {
if (this.scanning) {
resolve([]);
return;
}
this.scanning = true;
const discovered: DiscoveredRustDeskPeer[] = [];
const see... | https://github.com/Mydstiny/RemoteDeskHarmonyOS | f88ac6111a571c778c3b3e9a397d0e54cae7e400 | github |
erosTeam/NextE | shared/src/main/ets/model/EhGalleryImage.ets | arkts | constructor | nl('xxx') source id — append ?nl= to re-source a broken/509 image (换源) | constructor(page: number = 0) {
this.page = page
} | 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 page AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifier#Lef... | constructor(page: number = 0) {
this.page = page
} | https://github.com/erosTeam/NextE | d1a539409ccd042b7868b8b1c374a0b7d6672eb8 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/AxisBase.ets | arkts | enableAxisLineDashedLine | Enables the axis line to be drawn in dashed mode, e.g. like this
"- - - - - -". THIS ONLY WORKS IF HARDWARE-ACCELERATION IS TURNED OFF.
Keep in mind that hardware acceleration boosts performance.
@param lineLength the length of the line pieces
@param spaceLength the length of space in between the pieces
@param phase ... | public enableAxisLineDashedLine(lineLength: number, spaceLength: number, phase: number): void {
this.mAxisLineDashPathEffect = new DashPathEffect([lineLength, spaceLength], phase);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left enableAxisLineDashedLine AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left lineLength AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left numbe... | public enableAxisLineDashedLine(lineLength: number, spaceLength: number, phase: number): void {
this.mAxisLineDashPathEffect = new DashPathEffect([lineLength, spaceLength], phase);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | b2d8760867e219d2d30730bac8d57d8488671918 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Diagnostics/StartupTest.ets | arkts | runAllTests | 运行所有测试 | async runAllTests(): Promise<void> {
logger.info('StartupTest', '🚀 开始运行启动流程测试套件');
const results = {
normalStartup: false,
failureRecovery: false,
performanceMonitoring: false
};
// 测试正常启动流程
results.normalStartup = await this.testNormalStartup();
await this.delay(1... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left runAllTests 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... | async runAllTests(): Promise<void> {
logger.info('StartupTest', '🚀 开始运行启动流程测试套件');
const results = {
normalStartup: false,
failureRecovery: false,
performanceMonitoring: false
};
// 测试正常启动流程
results.normalStartup = await this.testNormalStartup();
await this.delay(1... | https://github.com/DaLongZhuaZi/manxia | 1837a44ee99c58a5c800454f9933e7b645dd1b47 | github |
genjishare/snake-game | entry/src/main/ets/pages/WebViewPage.ets | arkts | initGameData | 用于初始化游戏数据的方法 | initGameData(gameData: GameData): void {
// 首先检查函数是否存在
this.webController.runJavaScript('typeof window.initGameDataFromNative === "function"', (error, result) => {
if (error || result === 'false') {
console.error(`initGameDataFromNative函数不存在,将在500ms后重试`);
// 如果函数不存在,等待一段时间后重试
set... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left initGameData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left gameData AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left GameData AST#identifier#Right AST#)#Lef... | initGameData(gameData: GameData): void {
// 首先检查函数是否存在
this.webController.runJavaScript('typeof window.initGameDataFromNative === "function"', (error, result) => {
if (error || result === 'false') {
console.error(`initGameDataFromNative函数不存在,将在500ms后重试`);
// 如果函数不存在,等待一段时间后重试
set... | https://github.com/genjishare/snake-game | 1048ba52a2bc85979a7a957f39d07b6067ddbffa | github |
Nekofox-POT/LinMusic | entry/src/main/ets/pages/Index.ets | arkts | aboutToAppear | 文件管理器核心
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
基础函数 //
//////////
进入app操作 // | aboutToAppear() {
// 注册后台任务 //
reg_bg_run()
// 版本号检查 //
if (this.global_config.version == '0') {this.start_ui = true} else {this.start_ready = true}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
// 注册后台任务 //
reg_bg_run()
// 版本号检查 //
if (this.global_config.version == '0') {this.start_ui = true} else {this.start_ready = true}
} | https://github.com/Nekofox-POT/LinMusic | f7686ba4a8e1010738c3db20bf5ba7d76c3db7d3 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/DatabaseService.ets | arkts | addSearchColumnsIfNeeded | 添加搜索引用相关字段(用于联网搜索) | private async addSearchColumnsIfNeeded(): Promise<void> {
if (this.rdbStore === null) {
return
}
try {
await this.rdbStore.executeSql(`ALTER TABLE ${TableNames.MESSAGES} ADD COLUMN search_query TEXT DEFAULT ''`)
} catch (error) {
console.info('DatabaseService', 'search_query column m... | 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 addSearchColumnsIfNeeded AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressio... | private async addSearchColumnsIfNeeded(): Promise<void> {
if (this.rdbStore === null) {
return
}
try {
await this.rdbStore.executeSql(`ALTER TABLE ${TableNames.MESSAGES} ADD COLUMN search_query TEXT DEFAULT ''`)
} catch (error) {
console.info('DatabaseService', 'search_query column m... | https://github.com/LongLiveY96/chatcube | 8e0e99689223d59954022df2e9caeaef5bd2be5f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | normalizeSpace | 规范化空白字符 | private normalizeSpace(text: string): string {
return text.replace(/\s+/g, ' ').trim();
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left normalizeSpace AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | private normalizeSpace(text: string): string {
return text.replace(/\s+/g, ' ').trim();
} | https://github.com/DaLongZhuaZi/manxia | 4f306b2b2f57015bef67d3193462bafcfd16a3b1 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | reverse | Modifies `this` instance of `Array` class and populates
it with same elements ordered towards the direction opposite to that previously stated.
@note Mutating method | public reverse(): void {
let res = this.reverseArray();
this.data = res;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left reverse 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 ... | public reverse(): void {
let res = this.reverseArray();
this.data = res;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 421f405434af576529189a7c17f647985b470a54 | gitee |
Xiwei753/xiezuoruanjian | apps/harmony/entry/src/main/ets/system/ThemePalette.ets | arkts | mergeIntoThemeColors | Merge palette colors into ThemeColors, only overriding non-empty values.
Paper/editor background only uses neutral/surface, never high-saturation primary. | static mergeIntoThemeColors(colors: ThemeColors, palette: ThemePaletteData, isDark: boolean): ThemeColors {
const prefix = isDark ? 'dark_' : 'light_'
const result = { ...colors }
const merge = (key: keyof ThemeColors, paletteKey: string) => {
const val = (palette as Record<string, string>)[palette... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left mergeIntoThemeColors AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left colors AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie... | static mergeIntoThemeColors(colors: ThemeColors, palette: ThemePaletteData, isDark: boolean): ThemeColors {
const prefix = isDark ? 'dark_' : 'light_'
const result = { ...colors }
const merge = (key: keyof ThemeColors, paletteKey: string) => {
const val = (palette as Record<string, string>)[palette... | https://github.com/Xiwei753/xiezuoruanjian | 884ac477ace8b4701249c7e23aeac1946d65f875 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/NSFWHelper.ets | arkts | getNSFWWarning | 获取NSFW警告文本 | public static getNSFWWarning(): string {
return '此内容包含成人向内容,请确认您已满18岁';
} | 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 getNSFWWarning AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#... | public static getNSFWWarning(): string {
return '此内容包含成人向内容,请确认您已满18岁';
} | https://github.com/DaLongZhuaZi/manxia | aee4d89e935a2d1028cc14344b71f5724a030de1 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | with | Creates a copy with replaced value on index
@param index
@param value
@returns an Int32Array with replaced value on index | public with(index: number, value: number): Int32Array {
return this.with(index as int, value as double as int as int)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#with_statement#Left AST#with#Left with AST#with#Right AST#parenthesized_expression#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST... | public with(index: number, value: number): Int32Array {
return this.with(index as int, value as double as int as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | feed20a6c6210f1ea8599c5b8168eff63ce8bc90 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | reduce | Calls the specified callback function for all the elements in an array.
The return value of the callback function is the accumulated result,
and is provided as an argument in the next call to the callback function.
@param { function } callbackfn - A function that accepts four arguments.
The reduce method calls the call... | public reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: int, array: Int32Array) => number): number {
if (this.lengthInt == 0) {
throw new TypeError("Reduce of empty array with no initial value")
}
let accumulatedValue = (this.getUnsafe(0)).toDouble(... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left reduce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#Left :... | public reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: int, array: Int32Array) => number): number {
if (this.lengthInt == 0) {
throw new TypeError("Reduce of empty array with no initial value")
}
let accumulatedValue = (this.getUnsafe(0)).toDouble(... | https://gitcode.com/iop123123/arkts-static-skills | f40871dd9ea732b66c1fde663323732e8b5ea392 | gitcode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.