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 |
|---|---|---|---|---|---|---|---|---|---|---|
AlkaidLab/moonlight-harmony | entry/src/main/ets/components/ShortcutManager.ets | arkts | initialize | 初始化(需要传入 context) | async initialize(context: common.UIAbilityContext): Promise<void> {
if (this.initialized) return;
this.context = context;
try {
this.prefs = await preferences.getPreferences(context, ShortcutManager.PREFS_NAME);
await this.loadShortcuts();
this.initialized = true;
} catch (error... | AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left initialize AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context... | async initialize(context: common.UIAbilityContext): Promise<void> {
if (this.initialized) return;
this.context = context;
try {
this.prefs = await preferences.getPreferences(context, ShortcutManager.PREFS_NAME);
await this.loadShortcuts();
this.initialized = true;
} catch (error... | https://github.com/AlkaidLab/moonlight-harmony | 33f2e9be3613a58afedfe10b3da171fe99960451 | github |
HarmonyOS_Samples/guide-snippets | Ability/ApplicationContextDemo/entry/src/main/ets/entrylifecycleability/EntryLifecycleAbility.ets | arkts | onWindowStageInactive | 当窗口处于非活动状态时被调用 | onWindowStageInactive(uiAbility, windowStage: window.WindowStage) {
hilog.info(DOMAIN_NUMBER, TAG, `onWindowStageInactive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
hilog.info(DOMAIN_NUMBER, TAG, `onWindowStageInactive windowStage: ${JSON.stringify(windowStage)}`);
}, | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onWindowStageInactive AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left uiAbility AST#identifier#Right AST#,#Left , AST#,#Right AST#member_expression#Left AST#identifier#Left windowStage AST#id... | onWindowStageInactive(uiAbility, windowStage: window.WindowStage) {
hilog.info(DOMAIN_NUMBER, TAG, `onWindowStageInactive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`);
hilog.info(DOMAIN_NUMBER, TAG, `onWindowStageInactive windowStage: ${JSON.stringify(windowStage)}`);
}, | https://gitcode.com/HarmonyOS_Samples/guide-snippets | ea1c8b2a21d7e7b889c370dc725f97bc792ca8ef | gitcode |
OSpark-Team/Free-PCM | library/src/main/ets/utils/AudioRendererPlayer.ets | arkts | getBufferSizeSync | 获取 AudioRenderer 建议的最小缓冲区大小
@returns 最小缓冲区大小(字节),未创建时返回 0
@remarks
- 这是 AudioRenderer 建议的最小缓冲区大小
- 可以根据此值调整环形缓冲区大小 | public getBufferSizeSync(): number {
if (!this.renderer) {
return 0;
}
return this.renderer.getBufferSizeSync();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getBufferSizeSync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number A... | public getBufferSizeSync(): number {
if (!this.renderer) {
return 0;
}
return this.renderer.getBufferSizeSync();
} | https://github.com/OSpark-Team/Free-PCM/blob/3440e7220d07d28815d172b4b3237145434075ee/library/src/main/ets/utils/AudioRendererPlayer.ets#L620-L625 | cae8a770a4b0e4c28af21defffaf219dd4c9c984 | github |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/AccountManager.ets | arkts | getAccountById | 按主键查询账户详情,供编辑和删除前校验使用。 | static async getAccountById(id: number): Promise<AccountBean | null> {
const predicates = new relationalStore.RdbPredicates(TABLE_NAME);
predicates.equalTo('id', id);
return new Promise<AccountBean | null>((resolve, reject) => {
dbManager.dbStore?.query(predicates)
.then((result) => {
... | 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 getAccountById AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#... | static async getAccountById(id: number): Promise<AccountBean | null> {
const predicates = new relationalStore.RdbPredicates(TABLE_NAME);
predicates.equalTo('id', id);
return new Promise<AccountBean | null>((resolve, reject) => {
dbManager.dbStore?.query(predicates)
.then((result) => {
... | https://github.com/ZestBox-18/kitebook-frontend | 3cc7bd9a256e23b209b5bbbd0d858f36aa71ca0f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/ChineseConverter.ets | arkts | convert | 根据配置转换文本 | convert(text: string, config: ChineseConversionConfig): string {
if (!config.enabled || !text) {
return text;
}
switch (config.direction) {
case 's2t':
return this.simplifiedToTraditional(text);
case 't2s':
return this.traditionalToSimplified(text);
case 'auto':
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left convert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#R... | convert(text: string, config: ChineseConversionConfig): string {
if (!config.enabled || !text) {
return text;
}
switch (config.direction) {
case 's2t':
return this.simplifiedToTraditional(text);
case 't2s':
return this.traditionalToSimplified(text);
case 'auto':
... | https://github.com/DaLongZhuaZi/manxia | e3019c76348e5e0adeda67d91355e264f4fd9011 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/utils/MyMath.ets | arkts | toRadians | Converts an angle measured in degrees to an approximately
equivalent angle measured in radians. The conversion from
degrees to radians is generally inexact.
@param angdeg an angle, in degrees
@return the measurement of the angle {@code angdeg}
in radians. | public static toRadians(ang: number): number {
return ang * MyMath.degrees;
} | 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 toRadians AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ang AST#identifier#Right AST#:#Left : AST#:#R... | public static toRadians(ang: number): number {
return ang * MyMath.degrees;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 785936b0f7b861856609598cd4e7ed09d848d8a0 | gitee |
Joker-x-dev/HarmonyKit | core/data/src/main/ets/repository/DemoRepository.ets | arkts | clearAll | 清空全部 Demo 记录
@returns {Promise<number>} 受影响行数 | async clearAll(): Promise<number> {
return this.demoLocalDataSource.clearAll();
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left clearAll AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_typ... | async clearAll(): Promise<number> {
return this.demoLocalDataSource.clearAll();
} | https://github.com/Joker-x-dev/HarmonyKit | 7d2779251d2aa066f533a9a497302fc96a869344 | github |
HarmonyOS_Codelabs/liveviewkit_codelab_flight_arkts | entry/src/main/ets/utils/FlightLiveViewUtil.ets | arkts | setWeather | Set LiveView WeatherInfo
@param weatherType
@returns WeatherInfo | public static setWeather(weatherType?: CustomerWeatherType): liveViewManager.WeatherInfo {
if (weatherType) {
return WEATHER_SAMPLE_DATA[weatherType];
}
// Developers can write setting logic according to their own business needs here
return {};
} | 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 setWeather AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left weatherType AST#identifier#Right AST#?#Left ... | public static setWeather(weatherType?: CustomerWeatherType): liveViewManager.WeatherInfo {
if (weatherType) {
return WEATHER_SAMPLE_DATA[weatherType];
}
// Developers can write setting logic according to their own business needs here
return {};
} | https://gitcode.com/HarmonyOS_Codelabs/liveviewkit_codelab_flight_arkts | b1a450970707d8411e52ccb54cabc2fee430e180 | gitcode |
qiuhaotc/Sunshine_HarmonyOS | entry/src/main/ets/utils/HistoryManager.ets | arkts | clearAdvancedHistory | 清空高级评估器历史记录 | static async clearAdvancedHistory(context: Context): Promise<void> {
try {
const prefs = await HistoryManager.getPreferences(context);
await prefs.put(HistoryManager.ADVANCED_HISTORY_KEY, '[]');
await prefs.flush();
console.info('高级评估器历史记录已清空');
} catch (error) {
console.error('清... | 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 clearAdvancedHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#... | static async clearAdvancedHistory(context: Context): Promise<void> {
try {
const prefs = await HistoryManager.getPreferences(context);
await prefs.put(HistoryManager.ADVANCED_HISTORY_KEY, '[]');
await prefs.flush();
console.info('高级评估器历史记录已清空');
} catch (error) {
console.error('清... | https://github.com/qiuhaotc/Sunshine_HarmonyOS | 9e52d0a474a6cf8e4312ecd14f67e43b498b719d | github |
apap6628114/nga_oh | entry/src/main/ets/parser/nga/html-thread/PostArgScanner.ets | arkts | splitTopLevelArgs | 在已去除外层括号的参数体字符串中,按顶层逗号切分。
识别 `'` 与 `"` 字符串、`()` 与 `[]` 嵌套深度;仅在 depth===0 的逗号处切分。
`\` 转义下一字符。各片段做 trim。
@param s 已去除外层括号的参数体(如 `0,'a',1,[...]`)
@returns 顶层参数片段数组 | function splitTopLevelArgs(s: string): string[] {
const args: string[] = [];
let depth: number = 0;
let inString: boolean = false;
let stringChar: string = '';
let current: string = '';
for (let i: number = 0; i < s.length; i++) {
const ch: string = s[i];
if (inString) {
current += ch;
i... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left splitTopLevelArgs AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left s AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R... | function splitTopLevelArgs(s: string): string[] {
const args: string[] = [];
let depth: number = 0;
let inString: boolean = false;
let stringChar: string = '';
let current: string = '';
for (let i: number = 0; i < s.length; i++) {
const ch: string = s[i];
if (inString) {
current += ch;
i... | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/parser/nga/html-thread/PostArgScanner.ets#L45-L84 | 22f2ef5eb1cc32528503416166cc2482ea997995 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/Windows11Config.ets | arkts | validateWindows11Config | 检查配置是否满足Windows 11要求 | static validateWindows11Config(memory: number, diskSize: number): { valid: boolean; issues: string[] } {
const issues: string[] = [];
if (memory < this.REQUIREMENTS.minMemoryMB) {
issues.push(`内存不足:需要至少 ${this.REQUIREMENTS.minMemoryMB}MB,当前 ${memory}MB`);
}
if (diskSize < this.REQUIREM... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left validateWindows11Config AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left memory AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi... | static validateWindows11Config(memory: number, diskSize: number): { valid: boolean; issues: string[] } {
const issues: string[] = [];
if (memory < this.REQUIREMENTS.minMemoryMB) {
issues.push(`内存不足:需要至少 ${this.REQUIREMENTS.minMemoryMB}MB,当前 ${memory}MB`);
}
if (diskSize < this.REQUIREM... | https://github.com/AetheriumSimulator/qemu-hmos | 9c7c0231bc3c843a6d2e5564f5a3a6d6dfaf6a21 | github |
Joker-x-dev/CoolMallArkTS | core/network/src/main/ets/datasource/goods/GoodsNetworkDataSourceImpl.ets | arkts | getGoodsInfo | 获取商品信息
@param id 商品ID
@returns 商品信息响应 | async getGoodsInfo(id: string): Promise<NetworkResponse<Goods>> {
const resp: AxiosResponse<NetworkResponse<Goods>> =
await NetworkClient.http.get("goods/info/info", { params: { id } });
return resp.data;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getGoodsInfo AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left id AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | async getGoodsInfo(id: string): Promise<NetworkResponse<Goods>> {
const resp: AxiosResponse<NetworkResponse<Goods>> =
await NetworkClient.http.get("goods/info/info", { params: { id } });
return resp.data;
} | https://github.com/Joker-x-dev/CoolMallArkTS | e2f1e1465b844216a118da80f55541962e7da94f | github |
codelably/HCompass | core/network/src/main/ets/AxiosHttpClient.ets | arkts | constructor | 构造函数
@param config 网络配置 | constructor(config?: Partial<NetworkConfig>) {
this.config = ObjectAssign({} as NetworkConfig, DEFAULT_NETWORK_CONFIG, config);
this.axiosInstance = axios.create({
baseURL: this.config.baseUrl,
timeout: this.config.timeout,
headers: this.config.headers
});
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expr... | constructor(config?: Partial<NetworkConfig>) {
this.config = ObjectAssign({} as NetworkConfig, DEFAULT_NETWORK_CONFIG, config);
this.axiosInstance = axios.create({
baseURL: this.config.baseUrl,
timeout: this.config.timeout,
headers: this.config.headers
});
} | https://github.com/codelably/HCompass | abc3ab6673380c191bff0170b81b2795bff1796a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/GlobalAnimationSystem.ets | arkts | stopAnimation | 停止指定动画 | public stopAnimation(animationId: string): void {
const state = this.activeAnimations.get(animationId);
if (state) {
state.isPlaying = false;
state.isCompleted = true;
this.triggerCallback(animationId, 'cancel');
this.removeAnimationState(animationId);
logger.debug(TAG, `停止动画: $... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left stopAnimation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left animationId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri... | public stopAnimation(animationId: string): void {
const state = this.activeAnimations.get(animationId);
if (state) {
state.isPlaying = false;
state.isCompleted = true;
this.triggerCallback(animationId, 'cancel');
this.removeAnimationState(animationId);
logger.debug(TAG, `停止动画: $... | https://github.com/DaLongZhuaZi/manxia | 1d13e08edd9777c3888d0802559a25e0ae61369c | github |
openharmony-tpc/openharmony_tpc_samples | OhosVideoCache/entry/src/main/ets/pages/DiyCacheCountPage.ets | arkts | setErrorCallback | 设置错误监听 | setErrorCallback(): void {
this.avPlayer?.on('error', (error) => {
Logger.error(TAG, 'error happened,message is :' + error.message);
// 当error上报时自动播放下一个视频或者音频 this.nextVideo();
})
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setErrorCallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | setErrorCallback(): void {
this.avPlayer?.on('error', (error) => {
Logger.error(TAG, 'error happened,message is :' + error.message);
// 当error上报时自动播放下一个视频或者音频 this.nextVideo();
})
} | https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git | 47415e1134db35c8ac49e80e87df4caebfcd1ecc | gitee |
openharmony/distributedhardware_distributed_hardware_fwk | application/entry/src/main/ets/utils/TipsJumpUtils.ets | arkts | jumpTipsByUri | Jump to the specified page of Tips by uri
@param startAbleContext:common.UIAbilityContext | common.ServiceExtensionContext
@param uri: uri format:hwtips://?funNum=xxx&type=xxx
@param moduleName: phone_widget: jump phone, pc_widget: jump pc | public static jumpTipsByUri(context: startAbleContext, uri: string, moduleName: string = MODULE_NAME_PHONE) {
if (moduleName !== MODULE_NAME_PHONE && moduleName !== MODULE_NAME_PC) {
hilog.error(DOMAIN_ID, TAG, `unknown moduleName, supported value:"${MODULE_NAME_PHONE}" or "${MODULE_NAME_PC}"`);
retur... | 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 jumpTipsByUri AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left :... | public static jumpTipsByUri(context: startAbleContext, uri: string, moduleName: string = MODULE_NAME_PHONE) {
if (moduleName !== MODULE_NAME_PHONE && moduleName !== MODULE_NAME_PC) {
hilog.error(DOMAIN_ID, TAG, `unknown moduleName, supported value:"${MODULE_NAME_PHONE}" or "${MODULE_NAME_PC}"`);
retur... | https://gitee.com/openharmony/distributedhardware_distributed_hardware_fwk.git | 85776e43e8a689aabf4a779bba06c82cfe8c21e3 | gitee |
HunZiLei/ArkTS_PokePomodoro | entry/src/main/ets/pages/customCpt/home.ets | arkts | pullRefreshState | 下拉刷新状态
0下拉刷新、1松开刷新、2正在刷新、3刷新成功 | pullRefreshState(state:number){
switch (state) {
case 0:
// 初始状态
this.pullRefreshText = '下拉刷新'
this.pullRefreshImage = $r("app.media.ic_pull_refresh_down")
this.isCanRefresh = false
this.isRefreshing = false
break;
case 1:
this.pullRefreshText = '松... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left pullRefreshState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left state AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#R... | pullRefreshState(state:number){
switch (state) {
case 0:
// 初始状态
this.pullRefreshText = '下拉刷新'
this.pullRefreshImage = $r("app.media.ic_pull_refresh_down")
this.isCanRefresh = false
this.isRefreshing = false
break;
case 1:
this.pullRefreshText = '松... | https://github.com/HunZiLei/ArkTS_PokePomodoro | e4bb7b333de6986ec938b8e80e9b91c7117fb195 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelDataManager.ets | arkts | getBookByUrl | 通过URL获取书籍 | async getBookByUrl(sourceId: string, bookUrl: string): Promise<NovelBook | null> {
const store = this.getStore();
const rs = await store.querySql(
'SELECT * FROM novel_book WHERE sourceId = ? AND bookUrl = ? ORDER BY lastReadTime DESC, updateTime DESC',
[sourceId, bookUrl]
);
const books =... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getBookByUrl AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left AST#:#Left ... | async getBookByUrl(sourceId: string, bookUrl: string): Promise<NovelBook | null> {
const store = this.getStore();
const rs = await store.querySql(
'SELECT * FROM novel_book WHERE sourceId = ? AND bookUrl = ? ORDER BY lastReadTime DESC, updateTime DESC',
[sourceId, bookUrl]
);
const books =... | https://github.com/DaLongZhuaZi/manxia | d87558ebd800067a6dfd7e302a2f6c13c67e8692 | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/app/tabs/classes/meowTabInfo.ets | arkts | searchCancel | Cancel current search. | searchCancel() {
try {
this.controller?.clearMatches();
this.isSearching = false;
this.inputSearchKey = '';
this.searchedSearchKey = '';
this.searchResultCount = 0;
this.currentSearchResultIdx = 0;
this.searchIsDone = true;
} catch (e) {
meow(`Failed to cancel f... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left searchCancel 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 ... | searchCancel() {
try {
this.controller?.clearMatches();
this.isSearching = false;
this.inputSearchKey = '';
this.searchedSearchKey = '';
this.searchResultCount = 0;
this.currentSearchResultIdx = 0;
this.searchIsDone = true;
} catch (e) {
meow(`Failed to cancel f... | https://github.com/awaLiny2333/LinysBrowser_NEXT | 33bd2853a9072ae93c47fb81e6ed6b42f1d30c81 | github |
openharmony-sig/qr-code-generator | library/src/main/ets/components/MainPage/qrcodegen.ets | arkts | drawAlignmentPattern | Draws a 5*5 alignment pattern, with the center module
at (x, y). All modules must be in bounds. | private drawAlignmentPattern(x: int, y: int): void {
for (let dy = -2; dy <= 2; dy++) {
for (let dx = -2; dx <= 2; dx++)
this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left drawAlignmentPattern AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | private drawAlignmentPattern(x: int, y: int): void {
for (let dy = -2; dy <= 2; dy++) {
for (let dx = -2; dx <= 2; dx++)
this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);
}
} | https://gitee.com/openharmony-sig/qr-code-generator.git | 9c6f944ad670d6128f2006fa41610ff59b80f6ab | gitee |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/TemplateBuilder.ets | arkts | build | 构建最终条目
@returns 构建完成的KdbxEntry | build(): KdbxEntry {
// 更新创建时间
this.entry.times.creationTime = new Date();
this.entry.times.lastModTime = new Date();
this.entry.times.lastAccessTime = new Date();
return this.entry;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left KdbxEntry AST#identifier#Right AST#ERROR#Right AST#state... | build(): KdbxEntry {
// 更新创建时间
this.entry.times.creationTime = new Date();
this.entry.times.lastModTime = new Date();
this.entry.times.lastAccessTime = new Date();
return this.entry;
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateBuilder.ets#L279-L286 | c1bf4fae1c0d668f9d26f5de1e5cf4e80777778b | github |
honjow/Next2V | shared/src/main/ets/components/markdown/MarkdownCodeInternals.ets | arkts | highlightLine | Two-pass generic tokenizer: first extract string literals, then split the rest by
common delimiters and classify each piece (keyword, type, number, etc.). | function highlightLine(code: string): CodeToken[] {
const commentIndex = _lineCommentIndex(code || '');
if (commentIndex >= 0) {
const before = highlightLine((code || '').slice(0, commentIndex));
before.push({ type: 'comment', text: (code || '').slice(commentIndex) } as CodeToken);
return before;
}
... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left highlightLine AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left code AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri... | function highlightLine(code: string): CodeToken[] {
const commentIndex = _lineCommentIndex(code || '');
if (commentIndex >= 0) {
const before = highlightLine((code || '').slice(0, commentIndex));
before.push({ type: 'comment', text: (code || '').slice(commentIndex) } as CodeToken);
return before;
}
... | https://github.com/honjow/Next2V | dd1f0cdff6dfd3cc1559a5cec9ab7826697998cd | github |
richshaw2015/nds | ohos/entry/src/test/InputValidation.test.ets | arkts | truncateMessage | 截断消息到最大长度
@param message 消息字符串
@returns 截断后的消息 | function truncateMessage(message: string): string {
const MAX_MESSAGE_LENGTH = 26;
return message.substring(0, MAX_MESSAGE_LENGTH);
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left truncateMessage AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left message AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST... | function truncateMessage(message: string): string {
const MAX_MESSAGE_LENGTH = 26;
return message.substring(0, MAX_MESSAGE_LENGTH);
} | https://github.com/richshaw2015/nds | 41dd3b452a0667cec3c91fcf34ae0b79063e5064 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets | arkts | searchByAuthor | 通过作者ID搜索作品列表
@param authorId 作者ID
@param page 页码
@returns 搜索结果 | async searchByAuthor(authorId: string, page: number = 1): Promise<EngineResult<SearchResult>> {
if (!this.config) {
logger.error(TAG, '配置未加载,无法执行作者搜索');
throw new MangaSourceError(
MangaSourceErrorCode.CONFIG_NOT_LOADED,
'配置未加载'
);
}
const startTime = Date.now();
log... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left searchByAuthor AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left authorId AST#identifier#Right ... | async searchByAuthor(authorId: string, page: number = 1): Promise<EngineResult<SearchResult>> {
if (!this.config) {
logger.error(TAG, '配置未加载,无法执行作者搜索');
throw new MangaSourceError(
MangaSourceErrorCode.CONFIG_NOT_LOADED,
'配置未加载'
);
}
const startTime = Date.now();
log... | https://github.com/DaLongZhuaZi/manxia | 12b2e10d64e0dbbea69170f0c6e52beec6165c96 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/core/DeviceManager.ets | arkts | getDevice | 获取设备信息
@param deviceId 设备ID
@returns DeviceInfo | undefined 设备信息 | public getDevice(deviceId: string): DeviceInfo | undefined {
return this.devices.get(deviceId);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDevice AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Righ... | public getDevice(deviceId: string): DeviceInfo | undefined {
return this.devices.get(deviceId);
} | https://github.com/LJ666-ui/harmony-health-care | 454f2d6f13f748cf8b67027f5daf3900d3657f3d | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/usbdriver/AbstractDualSenseController.ets | arkts | stop | 停止控制器 | stop(): void {
if (this.stopped) {
return;
}
console.info(`${TAG} 停止控制器`);
this.stopped = true;
this.markStopped();
// 先发送振动停止命令(必须在 DDK 释放前,否则无法发送)
this.rumble(0, 0);
// 保存 DDK 状态,再停止 DDK 轮询器
const wasDdkPolling = this.useDdkPolling;
if (this.ddkPoller) {
th... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left stop 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#ERROR#Left AST... | stop(): void {
if (this.stopped) {
return;
}
console.info(`${TAG} 停止控制器`);
this.stopped = true;
this.markStopped();
// 先发送振动停止命令(必须在 DDK 释放前,否则无法发送)
this.rumble(0, 0);
// 保存 DDK 状态,再停止 DDK 轮询器
const wasDdkPolling = this.useDdkPolling;
if (this.ddkPoller) {
th... | https://github.com/AlkaidLab/moonlight-harmony | a4d8b56e418749c0760c3cd1804ce973f5d3d674 | github |
Cool_foolisher1/ArkTSRepository | GuardianAssistant/entry/src/main/ets/pages/Tabs/HomeTabsComp.ets | arkts | togglePrivacyEntry | 长按切换隐私空间入口 | togglePrivacyEntry() {
// 长按时才切换持久化状态
// this.isHidePrivacy = !this.isHidePrivacy
// 隐私空间
const privacyItem: IconItem = {
title: '隐私空间',
icon: $r('app.media.ic_home_shortcut_yskj'),
// 判断当前有没有设置隐私空间密码
// 1. 如果有,就打开校验密码页
// 2. 如果没有,就打开设置密码页
url: this.privacySetti... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left togglePrivacyEntry 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... | togglePrivacyEntry() {
// 长按时才切换持久化状态
// this.isHidePrivacy = !this.isHidePrivacy
// 隐私空间
const privacyItem: IconItem = {
title: '隐私空间',
icon: $r('app.media.ic_home_shortcut_yskj'),
// 判断当前有没有设置隐私空间密码
// 1. 如果有,就打开校验密码页
// 2. 如果没有,就打开设置密码页
url: this.privacySetti... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 8985857cb2edef7932836485b0323b7aca780828 | gitcode |
openharmony/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/XAxisRenderer.ets | arkts | renderLimitLines | retrurn the LimitLines draw data.
@param c | public renderLimitLines(): Paint[] {
let limitLines: JArrayList<LimitLine> = this.mXAxis.getLimitLines();
if (limitLines == null ||
limitLines.size() <= 0 ||
!this.mAxis.isDrawLimitLinesBehindDataEnabled()) {
return [];
}
let limitPaint: Paint[] = [];
let posit... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left renderLimitLines 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 Paint... | public renderLimitLines(): Paint[] {
let limitLines: JArrayList<LimitLine> = this.mXAxis.getLimitLines();
if (limitLines == null ||
limitLines.size() <= 0 ||
!this.mAxis.isDrawLimitLinesBehindDataEnabled()) {
return [];
}
let limitPaint: Paint[] = [];
let posit... | https://gitee.com/openharmony/developtools_profiler.git | 691dad702381be0986fa0575ac6b4cf4a31c643b | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | with | Creates a copy with replaced value on index
@param { int } index - index to change
@param { BigInt } value - value to set
@returns { BigUint64Array } - an BigUint64Array with replaced value on index
@throws { RangeError } - If the index exceeds the array range, throw an exception
@syscap SystemCapability.Utils.Lang
@Fa... | public with(index: int, value: BigInt): BigUint64Array {
let res = new BigUint64Array(this)
res.setUnsafeClamp(index, value.getULong())
return res
} | 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: BigInt): BigUint64Array {
let res = new BigUint64Array(this)
res.setUnsafeClamp(index, value.getULong())
return res
} | https://gitcode.com/iop123123/arkts-static-skills | 8cb80f1928135897c526d35c77d95239d8ab96aa | gitcode |
Tlntin/home-cloud-shield | entry/src/main/ets/serviceextability/MyVpnExtAbility.ets | arkts | parseUpstreamList | Keep only valid, de-duplicated resolver entries. Full mode also allows
DoH/DoT/hostname forms; the lightweight engine is restricted to IP literals. | private parseUpstreamList(content: string): string {
const allowAdvanced: boolean = this.filterMode === FILTER_MODE_FULL;
const valid: string[] = [];
for (const raw of content.split(/[\s,;]+/)) {
const entry: string = raw.trim();
if (entry.length === 0 || entry === UPSTREAM_AUTO_MARKER || vali... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseUpstreamList 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 string AST#s... | private parseUpstreamList(content: string): string {
const allowAdvanced: boolean = this.filterMode === FILTER_MODE_FULL;
const valid: string[] = [];
for (const raw of content.split(/[\s,;]+/)) {
const entry: string = raw.trim();
if (entry.length === 0 || entry === UPSTREAM_AUTO_MARKER || vali... | https://github.com/Tlntin/home-cloud-shield/blob/bfd8d549ccb3e55bdfc30fa7687b31d52e4c1cc0/entry/src/main/ets/serviceextability/MyVpnExtAbility.ets#L1246-L1259 | 9f68be0041a26736604ceb1eaac645c135a97dca | github |
Tencent-RTC/TUIKit_Harmony | call/src/main/ets/manager/AudioRouteManager.ets | arkts | isBluetoothHeadsetConnected | v1 stub. TODO: integrate @ohos.bluetooth / @ohos.multimedia.audio device routing. | static isBluetoothHeadsetConnected(): boolean {
return false;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isBluetoothHeadsetConnected 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#Le... | static isBluetoothHeadsetConnected(): boolean {
return false;
} | https://github.com/Tencent-RTC/TUIKit_Harmony | 08b5268753918cb6495e43545adbfe17fc80e78a | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.