From c62f854e31c82bbcafc09b1507edead1d2d8a124 Mon Sep 17 00:00:00 2001 From: yangbo_404 Date: Sun, 31 Aug 2025 11:54:02 +0800 Subject: [PATCH 1/2] add process dynamic&static tool Signed-off-by: yangbo_404 --- build-tools/process_dynamic/blackList.json | 20 + build-tools/process_dynamic/package.json | 15 + .../process_dynamic/process_dynamic.js | 417 ++++++++++++++++++ .../process_dynamic/ut/base/base_01.d.ts | 74 ++++ .../process_dynamic/ut/base/base_02.d.ts | 77 ++++ .../process_dynamic/ut/base/base_03.d.ts | 77 ++++ .../process_dynamic/ut/base/base_04.d.ts | 77 ++++ .../process_dynamic/ut/base/base_05.d.ets | 75 ++++ .../process_dynamic/ut/base/base_06.d.ts | 78 ++++ .../process_dynamic/ut/base/base_07.d.ts | 77 ++++ .../process_dynamic/ut/base/base_08.d.ts | 78 ++++ .../process_dynamic/ut/base/base_09.d.ts | 75 ++++ .../process_dynamic/ut/base/base_10.d.ts | 75 ++++ .../process_dynamic/ut/base/base_11.d.ts | 78 ++++ build-tools/process_dynamic/ut/base/readme.md | 11 + .../ut/p0Kit/file_api_since_01.d.ts | 74 ++++ .../ut/p0Kit/file_api_since_02.d.ts | 75 ++++ .../ut/p0Kit/file_api_since_03.d.ts | 77 ++++ .../file_arkts_1.1&1.2_api_since_01.d.ts | 75 ++++ .../file_arkts_1.1&1.2_api_since_02.d.ts | 76 ++++ .../file_arkts_1.1&1.2_api_since_03.d.ts | 78 ++++ .../ut/p0Kit/file_arkts_1.2_api_since_01.d.ts | 93 ++++ .../ut/p0NotKit/file_api_since_01.d.ts | 74 ++++ .../ut/p0NotKit/file_api_since_02.d.ts | 75 ++++ .../ut/p0NotKit/file_api_since_03.d.ts | 77 ++++ .../file_arkts_1.1&1.2_api_since_01.d.ts | 75 ++++ .../file_arkts_1.1&1.2_api_since_02.d.ts | 76 ++++ .../file_arkts_1.1&1.2_api_since_03.d.ts | 78 ++++ .../p0NotKit/file_arkts_1.2_api_since_01.d.ts | 93 ++++ .../ut/sameFile/dets_static/base_01.d.ets | 74 ++++ .../sameFile/dets_static/base_01.static.d.ets | 74 ++++ .../ut/sameFile/dts_dets/base_01.d.ets | 74 ++++ .../ut/sameFile/dts_dets/base_01.d.ts | 74 ++++ .../ut/sameFile/dts_dets_static/base_01.d.ets | 74 ++++ .../ut/sameFile/dts_dets_static/base_01.d.ts | 74 ++++ .../dts_dets_static/base_01.static.d.ets | 74 ++++ .../ut/sameFile/dts_static/base_01.d.ts | 74 ++++ .../sameFile/dts_static/base_01.static.d.ets | 74 ++++ 38 files changed, 3066 insertions(+) create mode 100644 build-tools/process_dynamic/blackList.json create mode 100644 build-tools/process_dynamic/package.json create mode 100644 build-tools/process_dynamic/process_dynamic.js create mode 100644 build-tools/process_dynamic/ut/base/base_01.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_02.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_03.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_04.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_05.d.ets create mode 100644 build-tools/process_dynamic/ut/base/base_06.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_07.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_08.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_09.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_10.d.ts create mode 100644 build-tools/process_dynamic/ut/base/base_11.d.ts create mode 100644 build-tools/process_dynamic/ut/base/readme.md create mode 100644 build-tools/process_dynamic/ut/p0Kit/file_api_since_01.d.ts create mode 100644 build-tools/process_dynamic/ut/p0Kit/file_api_since_02.d.ts create mode 100644 build-tools/process_dynamic/ut/p0Kit/file_api_since_03.d.ts create mode 100644 build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_01.d.ts create mode 100644 build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_02.d.ts create mode 100644 build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_03.d.ts create mode 100644 build-tools/process_dynamic/ut/p0Kit/file_arkts_1.2_api_since_01.d.ts create mode 100644 build-tools/process_dynamic/ut/p0NotKit/file_api_since_01.d.ts create mode 100644 build-tools/process_dynamic/ut/p0NotKit/file_api_since_02.d.ts create mode 100644 build-tools/process_dynamic/ut/p0NotKit/file_api_since_03.d.ts create mode 100644 build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_01.d.ts create mode 100644 build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_02.d.ts create mode 100644 build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_03.d.ts create mode 100644 build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.2_api_since_01.d.ts create mode 100644 build-tools/process_dynamic/ut/sameFile/dets_static/base_01.d.ets create mode 100644 build-tools/process_dynamic/ut/sameFile/dets_static/base_01.static.d.ets create mode 100644 build-tools/process_dynamic/ut/sameFile/dts_dets/base_01.d.ets create mode 100644 build-tools/process_dynamic/ut/sameFile/dts_dets/base_01.d.ts create mode 100644 build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.d.ets create mode 100644 build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.d.ts create mode 100644 build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.static.d.ets create mode 100644 build-tools/process_dynamic/ut/sameFile/dts_static/base_01.d.ts create mode 100644 build-tools/process_dynamic/ut/sameFile/dts_static/base_01.static.d.ets diff --git a/build-tools/process_dynamic/blackList.json b/build-tools/process_dynamic/blackList.json new file mode 100644 index 0000000000..8d9daf1d59 --- /dev/null +++ b/build-tools/process_dynamic/blackList.json @@ -0,0 +1,20 @@ +{ + "files": [ + "api/graphics3d/SceneResources.d.ts", + "api/graphics3d/Scene.d.ts", + "api/@ohos.usbManager.d.ts", + "api/arkui/component/animation.d.ets", + "api/arkui/component/mediaCachedImage.d.ets", + "api/arkui/component/pasteButton.d.ets", + "api/arkui/component/saveButton.d.ets", + "api/arkui/component/securityComponent.d.ets", + "api/arkui/external/resource.d.ets", + "api/arkui/runtime-api/@koalaui.runtime.common.d.ets", + "api/arkui/runtime-api/@koalaui.runtime.states.Disposable.d.ets", + "api/arkui/runtime-api/@koalaui.runtime.states.State.d.ets", + "api/arkui/runtime-api/@koalaui.runtime.tree.IncrementalNode.d.ets", + "api/arkui/runtime-api/@koalaui.runtime.tree.ReadonlyTreeNode.d.ets", + "api/arkui/UserView.d.ets", + "api/@ohos.arkui.component.d.ets" + ] +} \ No newline at end of file diff --git a/build-tools/process_dynamic/package.json b/build-tools/process_dynamic/package.json new file mode 100644 index 0000000000..4fdc3c759e --- /dev/null +++ b/build-tools/process_dynamic/package.json @@ -0,0 +1,15 @@ +{ + "name": "process_dynamic", + "version": "1.0.0", + "description": "", + "main": "process_dynamic.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "fs": "^0.0.1-security", + "path": "^0.12.7" + } +} diff --git a/build-tools/process_dynamic/process_dynamic.js b/build-tools/process_dynamic/process_dynamic.js new file mode 100644 index 0000000000..06f30d39b5 --- /dev/null +++ b/build-tools/process_dynamic/process_dynamic.js @@ -0,0 +1,417 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const fs = require('fs'); +const path = require('path'); +const blackList = require('./blackList.json'); +// 转换配置 +const DirType = { + undefined: 'dynamic', + 1.1: 'dynamic', + 1.2: 'static', + static: 'static', + '1.1&1.2': 'dynamic&static', +}; +// P0级别KIT,需要将动态接口转换为dynamic +const HIGH_LEVEL_KIT_SET = new Set([ + 'ArkUI', + 'BasicServicesKit', + 'AbilityKit', + 'ArkData', + 'ArkTS', + 'TelephonyKit', + 'ArkGraphics2D', + 'ArkGraphics3D', + 'ArkWeb', + 'ConnectivityKit', + 'NetworkKit', + 'CameraKit', + 'CoreFileKit', + 'AudioKit', + 'MediaLibraryKit', + 'InputKit', + 'ImageKit', + 'MediaKit', + 'AVSessionKit', + 'NotificationKit', + 'LocalizationKit', + 'IMEKit', + 'DeviceCertificateKit', + 'CryptoArchitectureKit', + 'PerformanceAnalysisKit', + 'IPCKit', + 'DistributedServiceKit', + 'BackgroundTasksKit', + 'SensorServiceKit', + 'LocationKit', + 'AccessibilityKit', + 'FormKit', + 'TestKit', + 'UserAuthenticationKit', + 'RemoteCommunicationKit', + 'NearLinkKit', + 'UIDesignKit', + 'ServiceCollaborationKit', + 'NetworkBoostKit', +]); +// 非P0级别KIT的API文件,需要将动态接口转换为dynamic +const SPEC_KIT_FILE_SET = new Set([ + '@hms.graphic.apsManager.d.ts', + '@hms.userIAM.fingerAuthManager.d.ts', + '@hms.theme.themeManager.d.ts', + '@hms.security.dlpHideInfo.d.ts', + '@hms.security.superPrivacyManager.d.ts', + '@hms.core.findDevice.findNetwork.d.ts', + '@hms.security.appLock.d.ts', + '@hms.utilityApplication.parentControl.d.ts', + '@hms.hiviewdfx.helpsfwk.d.ts', + '@hms.xrGlassesService.xrGlassesAppService.d.ts', + '@hms.hiviewdfx.infosec.d.ts', + '@hms.multimedia.mediaImageLoader.d.ts', + '@hms.telephony.vsim.d.ts', + '@hms.virtService.bmsBrokerAdapter.d.ts', +]); +// 脚本输入 +const inputDir = process.argv[2] ? process.argv[2] : ''; +// 脚本输出 +const outDir = process.argv[3] ? process.argv[3] : ''; +// 全局文件级arkts标签 +let currentArkts = undefined; +// 记录调试数据 +const debugInfoMap = new Map(); + +main(); +function main() { + const apiFiles = []; + readFile(path.join(inputDir, 'api'), apiFiles); + readFile(path.join(inputDir, 'arkts'), apiFiles); + readFile(path.join(inputDir, 'kits'), apiFiles); + apiFiles.forEach((filePath) => { + let content = fs.readFileSync(filePath, 'utf-8'); // 文件内容 + const relativeFilePath = path.relative(inputDir, filePath).replace(/\\/g, '/'); + // 非api文件,直接打印输出 + if (!isEtsFile(filePath) && !isTsFile(filePath) && !isStaticFile(filePath)) { + writeFile(getOutFilePath(filePath), content); + return; + } + if (blackList.files.includes(relativeFilePath)) { + console.log("当前文件工具不支持直接输出", relativeFilePath); + writeFile(getOutFilePath(filePath), content); + return; + } + currentArkts = getCurrentFileType(filePath); + let kitName = ''; + let fileAndKitComment = getFileAndKitComment(content); + // 处理文件级arkts标签 + if (fileAndKitComment.match(/.*\@arkts (.*)\r?\n/g)) { + currentArkts = currentArkts || RegExp.$1.replace(/\s/g, ''); + content = content.replace( + fileAndKitComment, + fileAndKitComment.replace(/(.*\@arkts )(.*)(\r?\n)/g, ``) + ); + } + // 收集kit名称 + if (content.match(/\@kit (.*)\r?\n/g)) { + kitName = RegExp.$1.replace(/\s/g, ''); + } + content = processConent(filePath, content, kitName); + writeFile(getOutFilePath(filePath), content); + }); + + // 打印工具日志 + debugInfoMap.forEach((value, key) => { + console.log(key, value); + }); +} + +/** + * 处理文件内容 + * + * @param {string} content + * @returns + */ +function processConent(filePath, content, kitName) { + content = content.replace(/(\s*\/\*\*(?:(?!\/\*\*)[\s\S])*?@since[\s\S]*?\*\/\s*?)+/g, (substring, p1) => { + return substring.replace(p1, () => getNewCommont(p1, kitName, filePath)); + }); + //修改if arkts + content = content.replace(/(if arkts )(1\.1&1\.2|1\.1|1\.2)/g, (substring, p1, p2) => { + return `${p1}${DirType[p2]}`; + }); + return content; +} + +/** + * 获取同名文件类型(1.1/1.2) + * @param {string} filePath + * @returns + */ +function getCurrentFileType(filePath) { + let sameFilePath = ''; + if (isStaticFile(filePath)) { + return '1.2'; + } else if (isEtsFile(filePath)) { + sameFilePath = filePath.replace(/\.d\.ets$/g, '.d.ts'); + if (fs.existsSync(sameFilePath)) { + return '1.2'; + } + sameFilePath = filePath.replace(/\.d\.ets$/g, '.static.d.ets'); + if (fs.existsSync(sameFilePath)) { + return '1.1'; + } + } else if (isTsFile(filePath)) { + sameFilePath = filePath.replace(/\.d\.ts$/g, '.d.ets'); + if (fs.existsSync(sameFilePath)) { + return '1.1'; + } + sameFilePath = filePath.replace(/\.d\.ts$/g, '.static.d.ets'); + if (fs.existsSync(sameFilePath)) { + return '1.1'; + } + } + return undefined; +} + +// 判断是否为.d.ets文件 +function isEtsFile(filePath) { + return filePath.endsWith('.d.ets'); +} + +// 判断是否为.d.ts文件 +function isTsFile(filePath) { + return filePath.endsWith('.d.ts'); +} + +// 判断是否为.static.d.ets文件 +function isStaticFile(filePath) { + return filePath.endsWith('.static.d.ets'); +} + +/** + * 获取转换后JSDoc + * @param substring + * @param currentArkts + * @param filePath + */ +function getNewCommont(substring, kitName, filePath) { + const relativePath = path.relative(inputDir, filePath); + // 获取版本信息 + const sinceInfo = getSinceInfo(substring, currentArkts); + // 收集不同场景调试信息 + let sinceInfoStr = getSinceInfoString(sinceInfo); + if (debugInfoMap.has(sinceInfoStr)) { + debugInfoMap.set(sinceInfoStr, debugInfoMap.get(sinceInfoStr) + 1); + } else { + debugInfoMap.set(sinceInfoStr, 1); + } + if (!HIGH_LEVEL_KIT_SET.has(kitName) && !SPEC_KIT_FILE_SET.has(relativePath) && !sinceInfo.apiArkts && + !currentArkts) { // 若非P0接口,直接返回当前JSDoc信息 + return substring; + } + if (isStaticFile(filePath)) { + return substring; + } + const sinceTagContent = parseSinceTagContent(sinceInfo); + substring = substring.replace(/(.*@since\s+).*/g, sinceTagContent); + if (sinceInfo.apiArkts) { + substring = substring.replace(/.*\*\s+@arkts\s+\S*\s*(\r|\n)/g, ''); + } + return substring; +} + +// 判断是否需要转换为dynamic&static标记 +function needParse2Static(arktsVersionObj, version) { + return arktsVersionObj && arktsVersionObj['1.1'] === arktsVersionObj['1.2'] || + !arktsVersionObj && Number(version) >= 20; +} + +// 转换@since标签文本 +function parseSinceTagContent(sinceInfo) { + const arktsVersionObj = sinceInfo.arktsSince; + let replaceVal = ``; + if (sinceInfo.toDynamic) { // 转换为@since xx dynamic + replaceVal += `$1${sinceInfo.since || arktsVersionObj['1.1']} ${DirType['1.1']}`; + } + if (sinceInfo.toDynamic && sinceInfo.toStatic) { + replaceVal += '\n'; + } + if (sinceInfo.toStatic) { // 转换为@since xx static + replaceVal += `$1`; + if (sinceInfo.since && Number(sinceInfo.since) >= 20) { + replaceVal += `${sinceInfo.since}`; + } else if (arktsVersionObj) { + replaceVal += `${arktsVersionObj['1.2']}`; + } else { + replaceVal += `22`; + } + replaceVal += ` ${DirType['1.2']}`; + } + // 转换为@since xx dynamic&static + if (sinceInfo.toDynamic && sinceInfo.toStatic && needParse2Static(arktsVersionObj, sinceInfo.since)) { + replaceVal = `$1${sinceInfo.since || arktsVersionObj['1.2']} ${DirType['1.1&1.2']}`; + } + return replaceVal; +} + +/** + * typeof sinceInfoObj + * @typedef sinceInfoObj + * @type {object} + * @property {string} currentArkts - currentArkts. + * @property {string} apiArkts - apiArkts. + * @property {number} since - since ID. + * @property {object} arktsSince - arkts since object. + * @property {boolean} toDynamic - to dynamic. + * @property {boolean} toStatic - to static. + * @property {number} dynamicSince - dynamic since ID. + * @property {number} staticSince - static since ID. + */ + +/** + * 获取jsDoc中关于since的信息,用于拆分 + * + * @param {string} jsDocStr + * @return { sinceInfoObj } + */ +function getSinceInfo(jsDocStr, currentArkts) { + /** @type {sinceInfoObj} */ + let sinceInfo = { + toDynamic: false, + toStatic: false, + currentArkts: currentArkts, + }; + const sinceStr = jsDocStr.match(/\*\s+\@since\s+(.*)/)?.[1]; + if (!isNaN(sinceStr)) { + // 纯数字 + sinceInfo.since = Number(sinceStr); + } else { + // arkts对象 + try { + sinceInfo.arktsSince = JSON.parse(sinceStr.replace(/(arkts|\s)/g, '').replace(/'/g, '"')); + } catch (error) { + // 不是json对象 + sinceInfo.since = sinceStr; + } + } + + const arktsStr = jsDocStr.match(/\*\s+\@arkts\s+(\S+)/)?.[1]; + if (arktsStr) { + sinceInfo.apiArkts = arktsStr; + currentArkts = arktsStr; + } + switch (currentArkts) { + case undefined: + case '1.1': + sinceInfo.toDynamic = true; + break; + case '1.1&1.2': + sinceInfo.toDynamic = true; + case '1.2': + case 'static': + sinceInfo.toStatic = true; + break; + default: + console.log(`${arktsStr ? 'api级' : '文件级'}处理 arkts 标签异常`); + break; + } + return sinceInfo; +} + +/** + * 获取sinceInfo字符串 判断场景 + * + * @param {sinceInfoObj} sinceInfo + */ +function getSinceInfoString(sinceInfo) { + let sinceInfoStr = `文件级atkst标签:${sinceInfo.currentArkts},`; + try { + sinceInfoStr += `api节点atkts标签:${sinceInfo.apiArkts},`; + sinceInfoStr += `since标签:${Boolean(sinceInfo.since)},`; + sinceInfoStr += `since arkts标签:${Boolean(sinceInfo.arktsSince?.['1.1'])},`; + sinceInfoStr += `toDynamic:${sinceInfo.toDynamic},`; + sinceInfoStr += `toStatic:${sinceInfo.toStatic},`; + } catch (error) { + console.log(error); + } + return sinceInfoStr; +} +/** + * + * 防止@file和@kit段注释丢失 + * @param {string} fileFullText + * @returns {string} + * + */ +function getFileAndKitComment(fileFullText) { + let fileAndKitComment = ''; + let pattern = /\/\*\*\s*\*\s*@file[\s\S]*?@kit[\s\S]*?\*\//; + let comment = fileFullText.match(pattern); + if (comment) { + fileAndKitComment = comment[0]; + } + return fileAndKitComment; +} + +/** + * 获取当前文件相对于outFir的输出路径 + * + * @param { string } filePath + * @return { string } + */ +function getOutFilePath(filePath) { + const relativePath = path.relative(inputDir, filePath); + const outFilePath = path.resolve(outDir, relativePath); + return outFilePath; +} + +/** + * 读取目录下所有文件 + * @param {string} dir 文件目录 + * @param {Array} utFiles 所有文件 + */ +function readFile(dir, utFiles) { + try { + const files = fs.readdirSync(dir); + files.forEach((element) => { + const filePath = path.join(dir, element); + const status = fs.statSync(filePath); + if (status.isDirectory()) { + readFile(filePath, utFiles); + } else { + utFiles.push(filePath); + } + }); + } catch (e) { + console.log('ETS ERROR: ' + e); + } +} + +function writeFile(url, data, option) { + fs.mkdir(path.dirname(url), { recursive: true }, (err) => { + if (err) { + console.log(`ERROR FOR CREATE PATH ${err}`); + } else { + if (data === '') { + fs.rmSync(url); + return; + } + fs.writeFileSync(url, data, option, (err) => { + if (err) { + console.log(`ERROR FOR CREATE FILE ${err}`); + } + }); + } + }); +} diff --git a/build-tools/process_dynamic/ut/base/base_01.d.ts b/build-tools/process_dynamic/ut/base/base_01.d.ts new file mode 100644 index 0000000000..1f7ebcf878 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_01.d.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_02.d.ts b/build-tools/process_dynamic/ut/base/base_02.d.ts new file mode 100644 index 0000000000..0ff19f6ff0 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_02.d.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_03.d.ts b/build-tools/process_dynamic/ut/base/base_03.d.ts new file mode 100644 index 0000000000..5d89cbd02c --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_03.d.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_04.d.ts b/build-tools/process_dynamic/ut/base/base_04.d.ts new file mode 100644 index 0000000000..09c0747f45 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_04.d.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_05.d.ets b/build-tools/process_dynamic/ut/base/base_05.d.ets new file mode 100644 index 0000000000..df8907df36 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_05.d.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_06.d.ts b/build-tools/process_dynamic/ut/base/base_06.d.ts new file mode 100644 index 0000000000..f7479ec5bd --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_06.d.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_07.d.ts b/build-tools/process_dynamic/ut/base/base_07.d.ts new file mode 100644 index 0000000000..21f4a8c426 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_07.d.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_08.d.ts b/build-tools/process_dynamic/ut/base/base_08.d.ts new file mode 100644 index 0000000000..7930f59c71 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_08.d.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_09.d.ts b/build-tools/process_dynamic/ut/base/base_09.d.ts new file mode 100644 index 0000000000..c45f83d553 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_09.d.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_10.d.ts b/build-tools/process_dynamic/ut/base/base_10.d.ts new file mode 100644 index 0000000000..58387a3ff7 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_10.d.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/base_11.d.ts b/build-tools/process_dynamic/ut/base/base_11.d.ts new file mode 100644 index 0000000000..8eeb423207 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/base_11.d.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/base/readme.md b/build-tools/process_dynamic/ut/base/readme.md new file mode 100644 index 0000000000..f5fd52c905 --- /dev/null +++ b/build-tools/process_dynamic/ut/base/readme.md @@ -0,0 +1,11 @@ +base_01:文件级atkst标签:undefined,api节点atkts标签:undefined,since标签:true,since arkts标签:false,toDynamic:true,toStatic:false, +base_02:文件级atkst标签:undefined,api节点atkts标签:1.1&1.2,since标签:false,since arkts标签:true,toDynamic:true,toStatic:true, +base_03:文件级atkst标签:undefined,api节点atkts标签:1.2,since标签:true,since arkts标签:false,toDynamic:false,toStatic:true, +base_04:文件级atkst标签:undefined,api节点atkts标签:1.1&1.2,since标签:true,since arkts标签:false,toDynamic:true,toStatic:true, +base_05:文件级atkst标签:1.2,api节点atkts标签:undefined,since标签:true,since arkts标签:false,toDynamic:false,toStatic:true, +base_06:文件级atkst标签:1.1&1.2,api节点atkts标签:1.1&1.2,since标签:false,since arkts标签:true,toDynamic:true,toStatic:true, +base_07:文件级atkst标签:undefined,api节点atkts标签:1.1,since标签:true,since arkts标签:false,toDynamic:true,toStatic:false, +base_08:文件级atkst标签:1.2,api节点atkts标签:1.2,since标签:true,since arkts标签:false,toDynamic:false,toStatic:true, +base_09:文件级atkst标签:1.1&1.2,api节点atkts标签:undefined,since标签:false,since arkts标签:true,toDynamic:true,toStatic:true, +base_10:文件级atkst标签:1.1&1.2,api节点atkts标签:undefined,since标签:true,since arkts标签:false,toDynamic:true,toStatic:true, +base_11:文件级atkst标签:1.1&1.2,api节点atkts标签:1.1&1.2,since标签:true,since arkts标签:false,toDynamic:true,toStatic:true, diff --git a/build-tools/process_dynamic/ut/p0Kit/file_api_since_01.d.ts b/build-tools/process_dynamic/ut/p0Kit/file_api_since_01.d.ts new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0Kit/file_api_since_01.d.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0Kit/file_api_since_02.d.ts b/build-tools/process_dynamic/ut/p0Kit/file_api_since_02.d.ts new file mode 100644 index 0000000000..506c95a0db --- /dev/null +++ b/build-tools/process_dynamic/ut/p0Kit/file_api_since_02.d.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0Kit/file_api_since_03.d.ts b/build-tools/process_dynamic/ut/p0Kit/file_api_since_03.d.ts new file mode 100644 index 0000000000..c6f0175ae6 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0Kit/file_api_since_03.d.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_01.d.ts b/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_01.d.ts new file mode 100644 index 0000000000..5b3fde727f --- /dev/null +++ b/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_01.d.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_02.d.ts b/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_02.d.ts new file mode 100644 index 0000000000..87bfded797 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_02.d.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_03.d.ts b/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_03.d.ts new file mode 100644 index 0000000000..f5a768e087 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.1&1.2_api_since_03.d.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.2_api_since_01.d.ts b/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.2_api_since_01.d.ts new file mode 100644 index 0000000000..148e70c1bb --- /dev/null +++ b/build-tools/process_dynamic/ut/p0Kit/file_arkts_1.2_api_since_01.d.ts @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + * @arkts 1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, def: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0NotKit/file_api_since_01.d.ts b/build-tools/process_dynamic/ut/p0NotKit/file_api_since_01.d.ts new file mode 100644 index 0000000000..1f7ebcf878 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0NotKit/file_api_since_01.d.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0NotKit/file_api_since_02.d.ts b/build-tools/process_dynamic/ut/p0NotKit/file_api_since_02.d.ts new file mode 100644 index 0000000000..8c5a9e74a3 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0NotKit/file_api_since_02.d.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0NotKit/file_api_since_03.d.ts b/build-tools/process_dynamic/ut/p0NotKit/file_api_since_03.d.ts new file mode 100644 index 0000000000..0ff19f6ff0 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0NotKit/file_api_since_03.d.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_01.d.ts b/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_01.d.ts new file mode 100644 index 0000000000..58387a3ff7 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_01.d.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_02.d.ts b/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_02.d.ts new file mode 100644 index 0000000000..3021b9b5fd --- /dev/null +++ b/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_02.d.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_03.d.ts b/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_03.d.ts new file mode 100644 index 0000000000..f7479ec5bd --- /dev/null +++ b/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.1&1.2_api_since_03.d.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.1&1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.2_api_since_01.d.ts b/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.2_api_since_01.d.ts new file mode 100644 index 0000000000..3fe3271015 --- /dev/null +++ b/build-tools/process_dynamic/ut/p0NotKit/file_arkts_1.2_api_since_01.d.ts @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit NotKit + * @arkts 1.2 + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, def: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dets_static/base_01.d.ets b/build-tools/process_dynamic/ut/sameFile/dets_static/base_01.d.ets new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dets_static/base_01.d.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dets_static/base_01.static.d.ets b/build-tools/process_dynamic/ut/sameFile/dets_static/base_01.static.d.ets new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dets_static/base_01.static.d.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dts_dets/base_01.d.ets b/build-tools/process_dynamic/ut/sameFile/dts_dets/base_01.d.ets new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dts_dets/base_01.d.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dts_dets/base_01.d.ts b/build-tools/process_dynamic/ut/sameFile/dts_dets/base_01.d.ts new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dts_dets/base_01.d.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.d.ets b/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.d.ets new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.d.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.d.ts b/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.d.ts new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.d.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.static.d.ets b/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.static.d.ets new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dts_dets_static/base_01.static.d.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dts_static/base_01.d.ts b/build-tools/process_dynamic/ut/sameFile/dts_static/base_01.d.ts new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dts_static/base_01.d.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; diff --git a/build-tools/process_dynamic/ut/sameFile/dts_static/base_01.static.d.ets b/build-tools/process_dynamic/ut/sameFile/dts_static/base_01.static.d.ets new file mode 100644 index 0000000000..605819ab53 --- /dev/null +++ b/build-tools/process_dynamic/ut/sameFile/dts_static/base_01.static.d.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit BasicServicesKit + */ + +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 8 + */ +/** + * The interface of system parameters class. + * + * @namespace systemParameterEnhance + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ +declare namespace systemParameterEnhance { + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { string } the value of the parameter. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getSync(key: string, def?: string): string; + + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 9 + */ + function get(key: string, callback: AsyncCallback): void; +} + +export default systemParameterEnhance; -- Gitee From 487a22bb03a8ab7c0bfd375fb4d3063bb8eae1b1 Mon Sep 17 00:00:00 2001 From: yangbo_404 Date: Sun, 31 Aug 2025 12:13:16 +0800 Subject: [PATCH 2/2] fix handleApiFile tool to parse dynamic&static Signed-off-by: yangbo_404 --- build-tools/handleApiFiles.js | 79 ++++++++++++------- build-tools/process_dynamic/blackList.json | 20 ----- .../process_dynamic/ignoreApiFile.json | 30 +++++++ .../process_dynamic/process_dynamic.js | 37 +++------ 4 files changed, 92 insertions(+), 74 deletions(-) delete mode 100644 build-tools/process_dynamic/blackList.json create mode 100644 build-tools/process_dynamic/ignoreApiFile.json diff --git a/build-tools/handleApiFiles.js b/build-tools/handleApiFiles.js index 1301616b12..10cd699309 100755 --- a/build-tools/handleApiFiles.js +++ b/build-tools/handleApiFiles.js @@ -233,24 +233,26 @@ function isHandleFullPath(fullPath, apiRelativePath, type) { * @returns */ function handleArktsDefinition(type, fileContent) { - let regx = /\/\*\*\* if arkts 1\.1 \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; - let regx2 = /\/\*\*\* if arkts 1\.2 \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; - let regx3 = /\/\*\*\* if arkts 1\.1\&1\.2 \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; - fileContent = fileContent.replace(regx, (substring, p1) => { - return type === 'ets' ? p1 : ''; + const REGX_DYNAMIC = /\/\*\*\* if arkts (1\.1|dynamic) \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; + const REGX_STATIC = /\/\*\*\* if arkts (1\.2|static) \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; + const REGX_DYNAMIC_STATIC = /\/\*\*\* if arkts (1.1&1.2|dynamic&static) \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; + fileContent = fileContent.replace(REGX_DYNAMIC, (substring, p1, p2) => { + return type === 'ets' ? p2 : ''; }); - fileContent = fileContent.replace(regx2, (substring, p1) => { + fileContent = fileContent.replace(REGX_STATIC, (substring, p1, p2) => { + // todo if arkts 特殊用法 if (type === 'ets2') { - return p1.replace(/(\s*)(\*\s\@since)/g, '$1* @arkts 1.2$1$2'); + return p2.replace(/(\s*)(\*\s\@since)/g, '$1* @arkts 1.2$1$2'); } else { return ''; } }); - fileContent = fileContent.replace(regx3, (substring, p1) => { + fileContent = fileContent.replace(REGX_DYNAMIC_STATIC, (substring, p1, p2) => { + // todo if arkts 特殊用法 if (type === 'ets') { - return p1; + return p2; } else { - return p1.replace(/(\s*)(\*\s\@since)/g, '$1* @arkts 1.2$1$2'); + return p2.replace(/(\s*)(\*\s\@since)/g, '$1* @arkts 1.2$1$2'); } }); return fileContent; @@ -288,8 +290,8 @@ function handleFileInFirstType(apiRelativePath, fullPath, type, output) { fileContent = handleArktsDefinition(type, fileContent); const sourceFile = ts.createSourceFile(path.basename(apiRelativePath), fileContent, ts.ScriptTarget.ES2017, true); - const secondRegx = /(?:@arkts1.2only|@arkts\s+>=\s*1.2|@arkts\s*1.2)/; - const thirdRegx = /(?:\*\s*@arkts\s+1.1&1.2\s*(\r|\n)\s*)/; + const secondRegx = /(?:\*\s(@arkts\s1.2|@arkts\sstatic)\s*(\r|\n)\s*)/; + const thirdRegx = /(?:\*\s(@arkts\s1\.1&1\.2|@arkts\sdynamic&static)\s*(\r|\n)\s*)/; if (sourceFile.statements.length === 0) { // reference文件识别不到首段jsdoc,全文匹配1.2标签,有的话直接删除 if (secondRegx.test(sourceFile.getFullText())) { @@ -357,10 +359,23 @@ function handleNoTagFileInFirstType(sourceFile, outputPath, fileContent) { * @returns */ function deleteArktsTag(fileContent) { - const arktsTagRegx = /\*\s*@arkts\s+1.1&1.2\s*(\r|\n)\s*|\*\s*@arkts\s*1.2s*(\r|\n)\s*|\*\s*@arkts\s*1.1s*(\r|\n)\s*/g; + const arktsTagRegx = /\*\s*@arkts\s(1\.1|1\.2|1\.1&1\.2|dynamic|static|dynamic&static)\s*(\r|\n)\s*/g; fileContent = fileContent.replace(arktsTagRegx, (substring, p1) => { return ''; }); + const arktsSinceTagRegx = /\*\s*@since\s\S*\s(dynamic&static|dynamic|static)\s*(\r|\n)\s*/g; + // 处理@since xx dynamic&static格式标签文本 + fileContent = fileContent.replace(arktsSinceTagRegx, (substring, p1) => { + if (dirType === DirType.typeOne && substring.indexOf('dynamic') !== -1) { + substring = substring.replace(/\sdynamic(&static)?/g, ''); + } else if ((dirType === DirType.typeTwo || dirType === DirType.typeThree) && substring.indexOf('static') !== -1) { + substring = substring.replace(/\s(dynamic&)?static/g, ''); + } else { + substring = ''; + } + return substring; + }); + return fileContent; } @@ -388,7 +403,9 @@ function deleteUnsportedTag(fileContent) { function handleSinceInFirstType(fileContent) { const regx = /@since\s+arkts\s*(\{.*\})/g; fileContent = fileContent.replace(regx, (substring, p1) => { - return '@since ' + JSON.parse(p1.replace(/'/g, '"'))['1.1']; + const versionObj = JSON.parse(p1.replace(/'/g, '"')); + const dynamicVersion = versionObj['1.1'] || versionObj['dynamic']; + return '@since ' + dynamicVersion; }); return fileContent; } @@ -400,9 +417,9 @@ function handleSinceInFirstType(fileContent) { * @returns */ function handleFileInSecondType(apiRelativePath, fullPath, type, output) { - const secondRegx = /(?:@arkts1.2only|@arkts\s+>=\s*1.2|@arkts\s*1.2)/; - const thirdRegx = /(?:\*\s*@arkts\s+1.1&1.2\s*(\r|\n)\s*)/; - const arktsRegx = /\/\*\*\* if arkts (1.1&)?1.2 \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; + const secondRegx = /(?:\*\s(@arkts\s1.2|@arkts\sstatic|@since\s\S*\sstatic)\s*(\r|\n)\s*)/; + const thirdRegx = /(?:\*\s(@arkts\s1\.1&1\.2|@arkts\sdynamic&static|@since\s\S*\sdynamic&static)\s*(\r|\n)\s*)/; + const arktsRegx = /\/\*\*\* if arkts ((1.1|dynamic)&)?(1.2|static) \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; let fileContent = fs.readFileSync(fullPath, 'utf-8'); let sourceFile = ts.createSourceFile(path.basename(fullPath), fileContent, ts.ScriptTarget.ES2017, true); const outputPath = output ? path.join(output, apiRelativePath) : fullPath; @@ -413,7 +430,7 @@ function handleFileInSecondType(apiRelativePath, fullPath, type, output) { //删除使用/*** if arkts 1.2 */ fileContent = handleArktsDefinition(type, fileContent); sourceFile = ts.createSourceFile(path.basename(fullPath), fileContent, ts.ScriptTarget.ES2017, true); - const regx = /(?:@arkts1.1only|@arkts\s+<=\s+1.1)/; + const regx = /(?:\*\s(@arkts\s1\.1|@since\s\S\sdynamic)\s*(\r|\n)\s*)/; if (sourceFile.statements.length === 0) { // 有1.2标签的文件,删除标记 @@ -504,7 +521,7 @@ function handlehasTagFile(sourceFile, outputPath) { */ function handleNoTagFileInSecondType(sourceFile, outputPath, fullPath) { dirType = DirType.typeThree; - const arktsTagRegx = /\*\s*@arkts\s+1.1&1.2\s*(\r|\n)\s*|@arkts\s*1.2/g; + const arktsTagRegx = /\*\s*(@arkts\s(1.1&)?1.2|@since\s\S*\s(dynamic&)?static)\s*(\r|\n)\s*/g; const fileContent = sourceFile.getFullText(); let newContent = ''; // API未标@arkts 1.2或@arkts 1.1&1.2标签,删除文件 @@ -595,14 +612,14 @@ function processStructDeclaration(node) { * @param {*} outputPath */ function saveApiByArktsDefinition(sourceFile, fileContent, outputPath) { - const regx = /\/\*\*\* if arkts (1.1&)?1.2 \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; + const regx = /\/\*\*\* if arkts ((1\.1|dynamic)&)?(1\.2|static) \*\/\s*([\s\S]*?)\s*\/\*\*\* endif \*\//g; const regex = /\/\*\r?\n\s*\*\s*Copyright[\s\S]*?\*\//g; const copyrightMessage = fileContent.match(regex)[0]; const firstNode = sourceFile.statements.find(statement => { return !ts.isExpressionStatement(statement); }); let fileJsdoc = firstNode ? getFileJsdoc(firstNode) + '*/\n' : ''; - let newContent = copyrightMessage + fileJsdoc + Array.from(fileContent.matchAll(regx), match => match[2]).join('\n'); + let newContent = copyrightMessage + fileJsdoc + Array.from(fileContent.matchAll(regx), match => match[4]).join('\n'); writeFile(outputPath, saveLatestJsDoc(newContent)); } @@ -884,26 +901,30 @@ function processImportDeclaration(statement, needExportName) { * @returns */ function judgeIsDeleteApi(node) { - const notesContent = node.getFullText().replace(node.getText(), '').replace(/[\s]/g, ''); + // 删除api适配arkts标签 + const notesContent = node.getFullText().replace(node.getText(), ''); + if (notesContent.replace(/\s/g, '') === '') { + return false; + } const notesArr = notesContent.split(/\/\*\*/); const notesStr = notesArr[notesArr.length - 1]; - const sinceArr = notesStr.match(/@since\d+/); + const sinceArr = notesStr.match(/@since\s*\d+/); let sinceVersion = 20; if (dirType === DirType.typeOne) { - return /@arkts1\.2(?!\d)/g.test(notesStr); + return /@arkts\s*1\.2/g.test(notesStr) || (/@since\s\S*\sstatic/g.test(notesStr) && !/@since\s\S*\sdynamic/g.test(notesStr)); } if (sinceArr) { - sinceVersion = sinceArr[0].replace('@since', ''); + sinceVersion = sinceArr[0].replace(/@since\s*/, ''); } if (dirType === DirType.typeTwo) { - return (/@deprecated/g.test(notesStr) && sinceVersion < 20) || /@arkts<=1.1/g.test(notesStr); + return (/@deprecated/g.test(notesStr) && sinceVersion < 20) || /@arkts\s*1\.1(?!&1\.2)/g.test(notesStr) || (/@since\s\S*\sdynamic/g.test(notesStr) && !/@since\s\S*\s(dynamic&)?static/g.test(notesStr)); } if (dirType === DirType.typeThree) { - return !/@arkts1\.2\*|@arkts1\.1&1\.2\*/g.test(notesStr); + return !/@arkts\s*(1\.1&)?1\.2/g.test(notesStr) && !/@since\s\S*\s(dynamic&)?static/g.test(notesStr); } return false; @@ -918,7 +939,9 @@ function judgeIsDeleteApi(node) { function handleSinceInSecondType(fileContent) { const regx = /@since\s+arkts\s*(\{.*\})/g; fileContent = fileContent.replace(regx, (substring, p1) => { - return '@since ' + JSON.parse(p1.replace(/'/g, '"'))['1.2']; + const versionObj = JSON.parse(p1.replace(/'/g, '"')); + const staticVersion = versionObj['1.2'] || versionObj['static']; + return '@since ' + staticVersion; }); return fileContent; } diff --git a/build-tools/process_dynamic/blackList.json b/build-tools/process_dynamic/blackList.json deleted file mode 100644 index 8d9daf1d59..0000000000 --- a/build-tools/process_dynamic/blackList.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "files": [ - "api/graphics3d/SceneResources.d.ts", - "api/graphics3d/Scene.d.ts", - "api/@ohos.usbManager.d.ts", - "api/arkui/component/animation.d.ets", - "api/arkui/component/mediaCachedImage.d.ets", - "api/arkui/component/pasteButton.d.ets", - "api/arkui/component/saveButton.d.ets", - "api/arkui/component/securityComponent.d.ets", - "api/arkui/external/resource.d.ets", - "api/arkui/runtime-api/@koalaui.runtime.common.d.ets", - "api/arkui/runtime-api/@koalaui.runtime.states.Disposable.d.ets", - "api/arkui/runtime-api/@koalaui.runtime.states.State.d.ets", - "api/arkui/runtime-api/@koalaui.runtime.tree.IncrementalNode.d.ets", - "api/arkui/runtime-api/@koalaui.runtime.tree.ReadonlyTreeNode.d.ets", - "api/arkui/UserView.d.ets", - "api/@ohos.arkui.component.d.ets" - ] -} \ No newline at end of file diff --git a/build-tools/process_dynamic/ignoreApiFile.json b/build-tools/process_dynamic/ignoreApiFile.json new file mode 100644 index 0000000000..62f77291cc --- /dev/null +++ b/build-tools/process_dynamic/ignoreApiFile.json @@ -0,0 +1,30 @@ +{ + "files": [ + "api/arkui/runtime-api@koalaui.runtime.tree.ReadonlyTreeNode.d.ets", + "api/arkui/runtime-api@koalaui.runtime.tree.IncrementalNode.d.ets", + "api/arkui/runtime-api@koalaui.runtime.states.State.d.ets", + "api/arkui/runtime-api@koalaui.runtime.states.Disposable.d.ets", + "api/arkui/runtime-api@koalaui.runtime.common.d.ets", + "api/arkui/external/resource.d.ets", + "api/arkui/component/securityComponent.d.ets", + "api/arkui/component/saveButton.d.ets", + "api/arkui/component/progress.d.ets", + "api/arkui/component/pasteButton.d.ets", + "api/arkui/component/mediaCachedImage.d.ets", + "api/arkui/component/imageCommon.d.ets", + "api/arkui/component/image.d.ets", + "api/arkui/component/animation.d.ets", + "api/arkui/UserView.d.ets", + "api/@ohos.util.d.ets", + "api/@internal/component/ets/web.d.ets", + "api/@ohos.usbManager.d.ets", + "api/@ohos.arkui.component.d.ets", + "api/common/full/canvaspattern.d.ets", + "api/@internal/ets/global.d.ets", + "api/@system.router.d.ets", + "api/@system.prompt.d.ets", + "api/@system.app.d.ets", + "api/@ohos.uiExtensionHost.d.ets", + "api/@ohos.prompt.d.ets" + ] +} \ No newline at end of file diff --git a/build-tools/process_dynamic/process_dynamic.js b/build-tools/process_dynamic/process_dynamic.js index 06f30d39b5..52451b6cc7 100644 --- a/build-tools/process_dynamic/process_dynamic.js +++ b/build-tools/process_dynamic/process_dynamic.js @@ -15,7 +15,7 @@ const fs = require('fs'); const path = require('path'); -const blackList = require('./blackList.json'); +const ignoreApiFileConfig = require('./ignoreApiFile.json'); // 转换配置 const DirType = { undefined: 'dynamic', @@ -67,22 +67,7 @@ const HIGH_LEVEL_KIT_SET = new Set([ 'NetworkBoostKit', ]); // 非P0级别KIT的API文件,需要将动态接口转换为dynamic -const SPEC_KIT_FILE_SET = new Set([ - '@hms.graphic.apsManager.d.ts', - '@hms.userIAM.fingerAuthManager.d.ts', - '@hms.theme.themeManager.d.ts', - '@hms.security.dlpHideInfo.d.ts', - '@hms.security.superPrivacyManager.d.ts', - '@hms.core.findDevice.findNetwork.d.ts', - '@hms.security.appLock.d.ts', - '@hms.utilityApplication.parentControl.d.ts', - '@hms.hiviewdfx.helpsfwk.d.ts', - '@hms.xrGlassesService.xrGlassesAppService.d.ts', - '@hms.hiviewdfx.infosec.d.ts', - '@hms.multimedia.mediaImageLoader.d.ts', - '@hms.telephony.vsim.d.ts', - '@hms.virtService.bmsBrokerAdapter.d.ts', -]); +const SPEC_KIT_FILE_SET = new Set([]); // 脚本输入 const inputDir = process.argv[2] ? process.argv[2] : ''; // 脚本输出 @@ -100,14 +85,14 @@ function main() { readFile(path.join(inputDir, 'kits'), apiFiles); apiFiles.forEach((filePath) => { let content = fs.readFileSync(filePath, 'utf-8'); // 文件内容 - const relativeFilePath = path.relative(inputDir, filePath).replace(/\\/g, '/'); // 非api文件,直接打印输出 if (!isEtsFile(filePath) && !isTsFile(filePath) && !isStaticFile(filePath)) { writeFile(getOutFilePath(filePath), content); return; } - if (blackList.files.includes(relativeFilePath)) { - console.log("当前文件工具不支持直接输出", relativeFilePath); + const relativeFilePath = path.relative(inputDir, filePath).replace(/\\/g, '/'); + if (ignoreApiFileConfig.files.includes(relativeFilePath)) { + console.log('当前文件工具不支持直接输出', relativeFilePath); writeFile(getOutFilePath(filePath), content); return; } @@ -126,7 +111,7 @@ function main() { if (content.match(/\@kit (.*)\r?\n/g)) { kitName = RegExp.$1.replace(/\s/g, ''); } - content = processConent(filePath, content, kitName); + content = processContent(filePath, content, kitName); writeFile(getOutFilePath(filePath), content); }); @@ -142,7 +127,7 @@ function main() { * @param {string} content * @returns */ -function processConent(filePath, content, kitName) { +function processContent(filePath, content, kitName) { content = content.replace(/(\s*\/\*\*(?:(?!\/\*\*)[\s\S])*?@since[\s\S]*?\*\/\s*?)+/g, (substring, p1) => { return substring.replace(p1, () => getNewCommont(p1, kitName, filePath)); }); @@ -343,7 +328,7 @@ function getSinceInfoString(sinceInfo) { sinceInfoStr += `toDynamic:${sinceInfo.toDynamic},`; sinceInfoStr += `toStatic:${sinceInfo.toStatic},`; } catch (error) { - console.log(error); + console.error(error); } return sinceInfoStr; } @@ -394,14 +379,14 @@ function readFile(dir, utFiles) { } }); } catch (e) { - console.log('ETS ERROR: ' + e); + console.error('ETS ERROR: ' + e); } } function writeFile(url, data, option) { fs.mkdir(path.dirname(url), { recursive: true }, (err) => { if (err) { - console.log(`ERROR FOR CREATE PATH ${err}`); + console.error(`ERROR FOR CREATE PATH ${err}`); } else { if (data === '') { fs.rmSync(url); @@ -409,7 +394,7 @@ function writeFile(url, data, option) { } fs.writeFileSync(url, data, option, (err) => { if (err) { - console.log(`ERROR FOR CREATE FILE ${err}`); + console.error(`ERROR FOR CREATE FILE ${err}`); } }); } -- Gitee