From df7efefc497c1c21259642865de9ad81555baef1 Mon Sep 17 00:00:00 2001 From: wangqing Date: Wed, 14 Sep 2022 10:59:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- build-tools/api_check_plugin/src/api_check_plugin.js | 5 +++-- build-tools/api_check_plugin/src/check_spelling.js | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build-tools/api_check_plugin/src/api_check_plugin.js b/build-tools/api_check_plugin/src/api_check_plugin.js index fb1b8d7b79..6db6667e11 100644 --- a/build-tools/api_check_plugin/src/api_check_plugin.js +++ b/build-tools/api_check_plugin/src/api_check_plugin.js @@ -15,8 +15,9 @@ const path = require("path"); const fs = require("fs"); -// const ts = require(path.resolve(__dirname, "../node_modules/typescript")); -const ts = require("typescript"); +const ts = require(path.resolve(__dirname, "../node_modules/typescript")); +// used in local test +// const ts = require("typescript"); const { checkAPIDecorators } = require("./check_decorator"); const { checkSpelling } = require("./check_spelling"); const { hasAPINote } = require("./utils"); diff --git a/build-tools/api_check_plugin/src/check_spelling.js b/build-tools/api_check_plugin/src/check_spelling.js index fef1330055..09509b5cf6 100644 --- a/build-tools/api_check_plugin/src/check_spelling.js +++ b/build-tools/api_check_plugin/src/check_spelling.js @@ -17,8 +17,10 @@ const ts = require("typescript"); const fs = require("fs"); const { hasAPINote, getAPINote, overwriteIndexOf } = require("./utils"); const result = require("../check_result.json"); - -const content = fs.readFileSync("../plugin/dictionaries.txt", "utf-8"); +const path =require('path'); +const content = fs.readFileSync(path.resolve(__dirname,"../plugindictionaries.txt"), "utf-8"); +// used in local test +// const content = fs.readFileSync("../plugin/dictionaries.txt", "utf-8"); const dictionariesArr = content.split("\n"); const dictionariesSet = new Set(dictionariesArr); -- Gitee From 0f3624e9f94e54c1ef2845277a64e42af3f1d71a Mon Sep 17 00:00:00 2001 From: wangqing Date: Wed, 14 Sep 2022 11:08:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8D=81=E4=B8=AAapi=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- api/@ohos.ability.dataUriUtils.d.ts | 12 +- api/@ohos.ability.errorCode.d.ts | 8 +- api/@ohos.ability.wantConstant.d.ts | 252 +----------------- api/@ohos.abilityAccessCtrl.d.ts | 101 +------ api/@ohos.accessibility.config.d.ts | 8 - api/@ohos.accessibility.d.ts | 10 +- api/@ohos.account.appAccount.d.ts | 16 +- api/@ohos.application.AbilityConstant.d.ts | 9 +- ...ication.AccessibilityExtensionAbility.d.ts | 5 +- api/@ohos.application.Configuration.d.ts | 8 +- 10 files changed, 11 insertions(+), 418 deletions(-) diff --git a/api/@ohos.ability.dataUriUtils.d.ts b/api/@ohos.ability.dataUriUtils.d.ts index af7b680500..4064aacf8d 100644 --- a/api/@ohos.ability.dataUriUtils.d.ts +++ b/api/@ohos.ability.dataUriUtils.d.ts @@ -29,17 +29,7 @@ declare namespace dataUriUtils { * @param uri Indicates the uri object from which the ID is to be obtained. * @return Returns the ID attached to the end of the path component; */ - function getId(uri: string): number - - /** - * Attaches the given ID to the end of the path component of the given uri. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param uri Indicates the uri string from which the ID is to be obtained. - * @param id Indicates the ID to attach. - * @return Returns the uri object with the given ID attached. - */ + function attachId(uri: string, id: number): string /** diff --git a/api/@ohos.ability.errorCode.d.ts b/api/@ohos.ability.errorCode.d.ts index 155f039766..f1c03c36ef 100644 --- a/api/@ohos.ability.errorCode.d.ts +++ b/api/@ohos.ability.errorCode.d.ts @@ -26,12 +26,8 @@ export enum ErrorCode { */ PERMISSION_DENY = -3, - /** - * Ability not found. - * @since 6 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - ABILITY_NOT_FOUND = -2, + + /** * Invalid parameter. diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts index c0b1cc914c..6561e5dc78 100644 --- a/api/@ohos.ability.wantConstant.d.ts +++ b/api/@ohos.ability.wantConstant.d.ts @@ -21,257 +21,7 @@ * @permission N/A */ declare namespace wantConstant { - /** - * the constant for action of the want - * @name Action - * @since 6 - * @syscap SystemCapability.Ability.AbilityBase - * @permission N/A - */ - export enum Action { - /** - * Indicates the action of backing home. - * - * @since 6 - */ - ACTION_HOME = "ohos.want.action.home", - - /** - * Indicates the action of starting a Page ability that displays a keypad. - * - * @since 6 - */ - ACTION_DIAL = "ohos.want.action.dial", - - /** - * Indicates the action of starting a Page ability for search. - * - * @since 6 - */ - ACTION_SEARCH = "ohos.want.action.search", - - /** - * Indicates the action of starting a Page ability that provides wireless network settings, for example, - * Wi-Fi options. - * - * @since 6 - */ - ACTION_WIRELESS_SETTINGS = "ohos.settings.wireless", - - /** - * Indicates the action of starting a Page ability that manages installed applications. - * - * @since 6 - */ - ACTION_MANAGE_APPLICATIONS_SETTINGS = "ohos.settings.manage.applications", - - /** - * Indicates the action of starting a Page ability that displays details of a specified application. - * - *

You must specify the application bundle name in the {@code package} attribute of the {@code Intent} - * containing this action. - * - * @since 6 - */ - ACTION_APPLICATION_DETAILS_SETTINGS = "ohos.settings.application.details", - - /** - * Indicates the action of starting a Page ability for setting an alarm clock. - * - * @since 6 - */ - ACTION_SET_ALARM = "ohos.want.action.setAlarm", - - /** - * Indicates the action of starting a Page ability that displays all alarm - * clocks. - * - * @since 6 - */ - ACTION_SHOW_ALARMS = "ohos.want.action.showAlarms", - - /** - * Indicates the action of starting a Page ability for snoozing an alarm clock. - * - * @since 6 - */ - ACTION_SNOOZE_ALARM = "ohos.want.action.snoozeAlarm", - - /** - * Indicates the action of starting a Page ability for deleting an alarm clock. - * - * @since 6 - */ - ACTION_DISMISS_ALARM = "ohos.want.action.dismissAlarm", - - /** - * Indicates the action of starting a Page ability for dismissing a timer. - * - * @since 6 - */ - ACTION_DISMISS_TIMER = "ohos.want.action.dismissTimer", - - /** - * Indicates the action of starting a Page ability for sending a sms. - * - * @since 6 - */ - ACTION_SEND_SMS = "ohos.want.action.sendSms", - - /** - * Indicates the action of starting a Page ability for opening contacts or pictures. - * - * @since 6 - */ - ACTION_CHOOSE = "ohos.want.action.choose", - - /** - * Indicates the action of starting a Page ability for take a picture. - * - * @since 8 - */ - ACTION_IMAGE_CAPTURE = "ohos.want.action.imageCapture", - - /** - * Indicates the action of starting a Page ability for Take a video. - * - * @since 8 - */ - ACTION_VIDEO_CAPTURE = "ohos.want.action.videoCapture", - - /** - * Indicates the action of showing the application selection dialog box. - * - * @since 6 - */ - ACTION_SELECT = "ohos.want.action.select", - - /** - * Indicates the action of sending a single data record. - * - * @since 6 - */ - ACTION_SEND_DATA = "ohos.want.action.sendData", - - /** - * Indicates the action of sending multiple data records. - * - * @since 6 - */ - ACTION_SEND_MULTIPLE_DATA = "ohos.want.action.sendMultipleData", - - /** - * Indicates the action of requesting the media scanner to scan files and adding the files to the media library. - * - * @since 6 - */ - ACTION_SCAN_MEDIA_FILE = "ohos.want.action.scanMediaFile", - - /** - * Indicates the action of viewing data. - * - * @since 6 - */ - ACTION_VIEW_DATA = "ohos.want.action.viewData", - - /** - * Indicates the action of editing data. - * - * @since 6 - */ - ACTION_EDIT_DATA = "ohos.want.action.editData", - - /** - * Indicates the choices you will show with {@link #ACTION_PICKER}. - * - * @since 6 - */ - INTENT_PARAMS_INTENT = "ability.want.params.INTENT", - - /** - * Indicates the CharSequence dialog title when used with a {@link #ACTION_PICKER}. - * - * @since 6 - */ - INTENT_PARAMS_TITLE = "ability.want.params.TITLE", - - /** - * Indicates the action of select file. - * - * @since 7 - */ - ACTION_FILE_SELECT = "ohos.action.fileSelect", - - /** - * Indicates the URI holding a stream of data associated with the Intent when used with a {@link #ACTION_SEND_DATA}. - * - * @since 7 - */ - PARAMS_STREAM = "ability.params.stream", - - /** - * Indicates the action of providing oauth service. - * - * @since 8 - */ - ACTION_APP_ACCOUNT_OAUTH = "ohos.account.appAccount.action.oauth", - - /** - * Indicates the action of an application downloaded from the application market. - * - * @since 9 - * @systemapi Hide this for inner system use. - */ - ACTION_MARKET_DOWNLOAD = "ohos.want.action.marketDownload", - - /** - * Indicates the action of an application crowdtested from the application market. - * - * @since 9 - * @systemapi Hide this for inner system use. - */ - ACTION_MARKET_CROWDTEST = "ohos.want.action.marketCrowdTest", - - /** - * Indicates the param of sandbox flag. - * - * @since 9 - * @systemapi Hide this for inner system use. - */ - DLP_PARAMS_SANDBOX = "ohos.dlp.params.sandbox", - - /** - * Indicates the param of dlp bundle name. - * - * @since 9 - * @systemapi Hide this for inner system use. - */ - DLP_PARAMS_BUNDLE_NAME = "ohos.dlp.params.bundleName", - - /** - * Indicates the param of dlp module name. - * - * @since 9 - * @systemapi Hide this for inner system use. - */ - DLP_PARAMS_MODULE_NAME = "ohos.dlp.params.moduleName", - - /** - * Indicates the param of dlp ability name. - * - * @since 9 - * @systemapi Hide this for inner system use. - */ - DLP_PARAMS_ABILITY_NAME = "ohos.dlp.params.abilityName", - - /** - * Indicates the param of dlp bundle index. - * - * @since 9 - * @systemapi Hide this for inner system use. - */ - DLP_PARAMS_INDEX = "ohos.dlp.params.index" - } + /** * the constant for Entity of the want diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 5a1421291f..a8dc807200 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -26,106 +26,7 @@ import { AsyncCallback, Callback } from './basic'; */ function createAtManager(): AtManager; - /** - * Provides methods for managing access_token. - * @name AtManager - */ - interface AtManager { - /** - * Checks whether a specified application has been granted the given permission. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be verified. - * @return Returns permission verify result. - * @since 8 - */ - verifyAccessToken(tokenID: number, permissionName: string): Promise; - - /** - * Checks whether a specified application has been granted the given permission synchronously. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be verified. - * @return Returns permission verify result - * @since 9 - */ - verifyAccessTokenSync(tokenID: number, permissionName: string): GrantStatus; - - /** - * Grants a specified user_grant permission to the given application. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be granted. - * @param permissionFlag Flag of permission state. - * @permission ohos.permission.GRANT_SENSITIVE_PERMISSIONS. - * @systemapi - * @since 8 - */ - grantUserGrantedPermission(tokenID: number, permissionName: string, permissionFlag: number): Promise; - grantUserGrantedPermission(tokenID: number, permissionName: string, permissionFlag: number, callback: AsyncCallback): void; - - /** - * Revokes a specified user_grant permission to the given application. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be revoked. - * @param permissionFlag Flag of permission state. - * @permission ohos.permission.REVOKE_SENSITIVE_PERMISSIONS. - * @systemapi - * @since 8 - */ - revokeUserGrantedPermission(tokenID: number, permissionName: string, permissionFlag: number): Promise; - revokeUserGrantedPermission(tokenID: number, permissionName: string, permissionFlag: number, callback: AsyncCallback): void; - - /** - * Queries specified permission flag of the given application. - * @param tokenID The tokenId of specified application. - * @param permissionName The permission name to be granted. - * @return Return permission flag. - * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS or ohos.permission.GRANT_SENSITIVE_PERMISSIONS or ohos.permission.REVOKE_SENSITIVE_PERMISSIONS. - * @systemapi - * @since 8 - */ - getPermissionFlags(tokenID: number, permissionName: string): Promise; - - /** - * Queries permission management version. - * @return Return permission version. - * @systemapi - * @since 9 - */ - getVersion(): Promise; - - /** - * Registers a permission state callback so that the application can be notified upon specified permission state of specified applications changes. - * @param tokenIDList A list of tokenids that specifies the applications to be listened on. The value in the list can be: - *

    - *
  • {@code empty} - Indicates that the application can be notified if the specified permission state of any applications changes. - *
  • - *
  • {@code non-empty} - Indicates that the application can only be notified if the specified permission state of the specified applications change. - *
  • - *
- * @param permissionNameList A list of permissions that specifies the permissions to be listened on. The value in the list can be: - *
    - *
  • {@code empty} - Indicates that the application can be notified if any permission state of the specified applications changes. - *
  • - *
  • {@code non-empty} - Indicates that the application can only be notified if the specified permission state of the specified applications changes. - *
  • - *
- * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS. - * @param callback Callback used to listen for the permission state changed event. - * @systemapi - * @since 9 - */ - on(type: 'permissionStateChange', tokenIDList: Array, permissionNameList: Array, callback: Callback): void; - - /** - * Unregisters a permission state callback so that the specified applications cannot be notified upon specified permissions state changes anymore. - * @param tokenIDList A list of tokenids that specifies the applications being listened on. it should correspond to the value registered by function of "on", whose type is "permissionStateChange". - * @param permissionNameList A list of permissions that specifies the permissions being listened on. it should correspond to the value registered by function of "on", whose type is "permissionStateChange". - * @param callback Callback used to listen for the permission state changed event. - * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS. - * @systemapi - * @since 9 - */ - off(type: 'permissionStateChange', tokenIDList: Array, permissionNameList: Array, callback?: Callback): void; - } + /** * GrantStatus. diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index 2dfac6d56a..e83b1168a9 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -27,14 +27,6 @@ declare namespace config { /** * Indicates the configuration of high-contrast text. */ - var highContrastText: Config; - /** - * Indicates the configuration of invert color. - */ - var invertColor: Config; - /** - * Indicates the configuration of daltonization color filter. - */ var daltonizationColorFilter: Config; /** * Indicates the configuration of content timeout. diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 50f45c0251..528d823642 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -32,15 +32,7 @@ declare namespace accessibility { */ type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual'; - /** - * The action that the ability can execute. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since 7 - */ - type Action = 'accessibilityFocus' | 'clearAccessibilityFocus' | 'focus' | 'clearFocus' | 'clearSelection' | - 'click' | 'longClick' | 'cut' | 'copy' | 'paste' | 'select' | 'setText' | 'delete' | - 'scrollForward' | 'scrollBackward' | 'setSelection'; - + /** * The type of the accessibility event. * @note windowsChange diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index de8c4c0c8e..15ed6de322 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -39,20 +39,8 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount */ interface AppAccountManager { - /** - * Adds the account name and extra information of this application to the account management service. - *

- * Only the owner of the application account has the permission to call this method. - * - * @since 7 - * @param name Indicates the name of the application account to add. - * @param extraInfo Indicates the extra information of the application account to add. - * The extra information cannot be sensitive information of the application account. - * @return void. - */ - addAccount(name: string, callback: AsyncCallback): void; - addAccount(name: string, extraInfo: string, callback: AsyncCallback): void; - addAccount(name: string, extraInfo?: string): Promise; + + /** * Adds an application account of a specified owner implicitly. diff --git a/api/@ohos.application.AbilityConstant.d.ts b/api/@ohos.application.AbilityConstant.d.ts index 2847a26649..b16071a0c4 100644 --- a/api/@ohos.application.AbilityConstant.d.ts +++ b/api/@ohos.application.AbilityConstant.d.ts @@ -30,14 +30,7 @@ declare namespace AbilityConstant { * @StageModelOnly */ export interface LaunchParam { - /** - * Indicates launch reason. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - launchReason: LaunchReason; + /** * Indicates last exit reason. diff --git a/api/@ohos.application.AccessibilityExtensionAbility.d.ts b/api/@ohos.application.AccessibilityExtensionAbility.d.ts index 4dc895a403..3e4e65384f 100644 --- a/api/@ohos.application.AccessibilityExtensionAbility.d.ts +++ b/api/@ohos.application.AccessibilityExtensionAbility.d.ts @@ -24,10 +24,7 @@ import { KeyEvent } from './@ohos.multimodalInput.keyEvent' * @syscap SystemCapability.BarrierFree.Accessibility.Core */ export default class AccessibilityExtensionAbility { - /** - * Indicates accessibility extension ability context. - */ - context: AccessibilityExtensionContext; + /** * Called when extension ability is connected. diff --git a/api/@ohos.application.Configuration.d.ts b/api/@ohos.application.Configuration.d.ts index b1c3861169..e3470b79f1 100644 --- a/api/@ohos.application.Configuration.d.ts +++ b/api/@ohos.application.Configuration.d.ts @@ -24,13 +24,7 @@ import ConfigurationConstant from "./@ohos.application.ConfigurationConstant"; * @permission N/A */ export interface Configuration { - /** - * Indicates the current language of the application. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityBase - */ - language?: string; + /** * Indicates the current colorMode of the application. -- Gitee