diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index e415e528a9b2f726a1eb5db28f3975f2c898ebb2..dcd2c01ac83f2e2837cf544051376a73e5f8532b 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -489,6 +489,39 @@ declare class HttpAuthHandler { handleCancel(): void; } +/** + * Defines the client certificate request result, related to {@link onClientAuthenticationRequest} method. + * @since 9 + */ + declare class ClientAuthenticationHandler { + /** + * Constructor. + * @since 9 + */ + constructor(); + + /** + * Confirm to use the specified private key and client certificate chain. + * @param priKeyFile The file that store private key. + * @param certChainFile The file that store client certificate chain. + * + * @since 9 + */ + confirm(priKeyFile : string, certChainFile : string): void; + + /** + * Cancel this certificate request. + * @since 9 + */ + cancel(): void; + + /** + * Ignore this certificate request temporarily. + * @since 9 + */ + ignore(): void; +} + /** * Defines the accessible resource type, related to {@link onPermissionRequest} method. * @since 9 @@ -1260,6 +1293,12 @@ declare class WebCookie { * @since 9 */ clearSslCache(): void; + + /** + * Clears the client authentication certificate cache in the Web. + * @since 9 + */ + clearClientAuthenticationCache(): void; } /** @@ -1733,6 +1772,15 @@ declare class WebAttribute extends CommonMethod { * @since 9 */ onSslErrorEventReceive(callback: (event: { handler: SslErrorHandler, error: SslError }) => void): WebAttribute; + + /** + * Triggered when the Web page needs ssl client certificate from the user. + * @param callback The triggered callback when needs ssl client certificate from the user. + * + * @since 9 + */ + onClientAuthenticationRequest(callback: (event: {handler : ClientAuthenticationHandler, host : string, port : number, + keyTypes : Array, issuers : Array}) => void): WebAttribute; } declare const Web: WebInterface; diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index b0f9efcbb54fa33ab37dff6c2e15bc487f295475..88a0bce3ec0759de5aaf5797f4e2ba0c3f38de34 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Want from "../../@ohos.application.want"; +import Want from "../../@ohos.application.Want"; import ResultSet from "../../data/rdb/resultSet"; import { AbilityInfo } from "../../bundle/abilityInfo"; import { DataAbilityResult } from "../../ability/dataAbilityResult"; diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index f2e673e613ade315cb8443524f635d5d17c8e21d..944d6d321bf4df658cc2725939bf90ecf744ea0c 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -15,7 +15,7 @@ import { AsyncCallback } from './basic'; import { Callback } from './basic'; -import Want from './@ohos.application.want'; +import Want from './@ohos.application.Want'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { AbilityResult } from './ability/abilityResult'; import { AppVersionInfo as _AppVersionInfo } from './app/appVersionInfo'; diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts index d282b6d82c424c70c9f978eeb4ad95e8807201f5..04321ffcd7a9455510aa33a4ccfaa8ab1c040658 100644 --- a/api/@ohos.ability.particleAbility.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -18,7 +18,7 @@ import { StartAbilityParameter } from './ability/startAbilityParameter'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { NotificationRequest } from './notification/notificationRequest'; import { ConnectOptions } from './ability/connectOptions'; -import Want from './@ohos.application.want'; +import Want from './@ohos.application.Want'; /** * A Particle Ability represents an ability with service. diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts index 5a858dbad2758da173e1d9fd58634d0f7f672373..c0b1cc914c9152cf9a6000715cd2366be197dabc 100644 --- a/api/@ohos.ability.wantConstant.d.ts +++ b/api/@ohos.ability.wantConstant.d.ts @@ -230,7 +230,47 @@ declare namespace wantConstant { * @since 9 * @systemapi Hide this for inner system use. */ - ACTION_MARKET_CROWDTEST = "ohos.want.action.marketCrowdTest" + 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" } /** diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 5a1421291fbc5182d6b0ac298fe1bfdd0a0bd9ff..414600dfeecfdd1b5b40cd138224b3eadc843bad 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -144,6 +144,7 @@ import { AsyncCallback, Callback } from './basic'; /** * Enum for permision state change type. + * @systemapi * @since 9 */ export enum PermissionStateChangeType { @@ -159,8 +160,8 @@ import { AsyncCallback, Callback } from './basic'; /** * Indicates the information of permission state change. - * * @name PermissionStateChangeInfo + * @systemapi * @since 9 */ interface PermissionStateChangeInfo { diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts index 1ac81d2c7d6d617f8692aaae18a96fae7bf2022a..c24bf532c557c5fe52ca6ce3d9c39932c45d9d0c 100644 --- a/api/@ohos.application.FormExtension.d.ts +++ b/api/@ohos.application.FormExtension.d.ts @@ -78,9 +78,9 @@ export default class FormExtension { * @since 9 * @syscap SystemCapability.Ability.Form * @param newStatus Indicates the form events occurred. The key in the {@code Map} object indicates the form ID, - * and the value indicates the event type, which can be either {@link formManager#VisibilityType#FORM_VISIBLE} - * or {@link formManager#VisibilityType#FORM_INVISIBLE}. {@link formManager#VisibilityType#FORM_VISIBLE} - * means that the form becomes visible, and {@link formManager#VisibilityType#FORM_INVISIBLE} + * and the value indicates the event type, which can be either {@link formInfo#VisibilityType#FORM_VISIBLE} + * or {@link formInfo#VisibilityType#FORM_INVISIBLE}. {@link formInfo#VisibilityType#FORM_VISIBLE} + * means that the form becomes visible, and {@link formInfo#VisibilityType#FORM_INVISIBLE} * means that the form becomes invisible. * @return - * @StageModelOnly diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index 8cc1d9a98ccdb0b7105fa96e8b49e149702e337d..834a8ef58d767279399e56eec2936495cedce034 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -29,6 +29,37 @@ import { ProcessRunningInformation as _ProcessRunningInformation } from './appli * @permission N/A */ declare namespace appManager { + /** + * @name ApplicationState + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @permission N/A + */ + export enum ApplicationState { + STATE_CREATE, + STATE_FOREGROUND, + STATE_ACTIVE, + STATE_BACKGROUND, + STATE_DESTROY + } + + + /** + * @name ProcessState + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @permission N/A + */ + export enum ProcessState { + STATE_CREATE, + STATE_FOREGROUND, + STATE_ACTIVE, + STATE_BACKGROUND, + STATE_DESTROY + } + /** * Register application state observer. * diff --git a/api/@ohos.application.formInfo.d.ts b/api/@ohos.application.formInfo.d.ts index 1d8157081d0feb08c3d1e4e7b6e1d2cf27a475a2..46c60e52744dacff91de00ec1ec7d58cabe75a3b 100644 --- a/api/@ohos.application.formInfo.d.ts +++ b/api/@ohos.application.formInfo.d.ts @@ -495,5 +495,27 @@ declare namespace formInfo { */ Dimension_2_1, } + /** + * The visibility of a form. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + interface VisibilityType { + /** + * Indicates the type of the form is visible. + * Often used as a condition variable in function OnVisibilityChanged() to specify actions only on forms that are + * changing to visible. + * @since 9 + */ + FORM_VISIBLE: number, + /** + * Indicates the type of the form is invisible. + * Often used as a condition variable in function OnVisibilityChanged() to specify actions only on forms that are + * changing to invisible. + * @since 9 + */ + FORM_INVISIBLE: number + } } export default formInfo; \ No newline at end of file diff --git a/api/@ohos.application.formProvider.d.ts b/api/@ohos.application.formProvider.d.ts index 049443064be8a1e353b21762ce4c37e7ce856f99..8cf49dc98ac620e949508fa4fb3626613416f911 100644 --- a/api/@ohos.application.formProvider.d.ts +++ b/api/@ohos.application.formProvider.d.ts @@ -16,6 +16,7 @@ import { AsyncCallback } from "./basic"; import formBindingData from "./@ohos.application.formBindingData"; import formInfo from "./@ohos.application.formInfo"; +import Want from './@ohos.application.Want'; /** * interface of formProvider. diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index 0b8907dcc1a4cb352e9c6c3277305f46c7773332..3931a0aeaa132f260f13e734ba050ff121896529 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -304,7 +304,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a signed, big-endian 64-bit integer */ - readBigInt64BE(offset?: number): number; + readBigInt64BE(offset?: number): bigint; /** * Reads a signed, little-endian 64-bit integer from buf at the specified offset @@ -313,7 +313,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a signed, little-endian 64-bit integer */ - readBigInt64LE(offset?: number): number; + readBigInt64LE(offset?: number): bigint; /** * Reads a unsigned, big-endian 64-bit integer from buf at the specified offset @@ -322,7 +322,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a unsigned, big-endian 64-bit integer */ - readBigUInt64BE(offset?: number): number; + readBigUInt64BE(offset?: number): bigint; /** * Reads a unsigned, little-endian 64-bit integer from buf at the specified offset @@ -331,7 +331,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a unsigned, little-endian 64-bit integer */ - readBigUInt64LE(offset?: number): number; + readBigUInt64LE(offset?: number): bigint; /** * Reads a 64-bit, big-endian double from buf at the specified offset @@ -511,7 +511,7 @@ declare namespace buffer { * @param [end = buf.length] Where the new Buffer will end (not inclusive) * @return Returns a new Buffer that references the same memory as the original */ - subarray(start: number, end: number): Buffer; + subarray(start?: number, end?: number): Buffer; /** * Interprets buf as an array of unsigned 16-bit integers and swaps the byte order in-place. @@ -575,7 +575,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written */ - writeBigInt64BE(value: number, offset?: number): number; + writeBigInt64BE(value: bigint, offset?: number): number; /** * Writes value to buf at the specified offset as little-endian. @@ -585,7 +585,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written */ - writeBigInt64LE(value: number, offset?: number): number; + writeBigInt64LE(value: bigint, offset?: number): number; /** * Writes value to buf at the specified offset as big-endian. @@ -595,7 +595,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written */ - writeBigUInt64BE(value: number, offset?: number): number; + writeBigUInt64BE(value: bigint, offset?: number): number; /** * Writes value to buf at the specified offset as little-endian. @@ -605,7 +605,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written */ - writeBigUInt64LE(value: number, offset?: number): number; + writeBigUInt64LE(value: bigint, offset?: number): number; /** * Writes value to buf at the specified offset as big-endian. @@ -804,7 +804,7 @@ declare namespace buffer { * endings: One of either 'transparent' or 'native'. * type: The Blob content-type */ - constructor(sources: string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[] , options: Object); + constructor(sources: string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[] , options?: Object); /** * The total size of the Blob in bytes diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 9d2bfd75d3f014880f12b2be75cef1c9a3ddd921..468be9fb97238214a070f680c72daccf4123437f 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -24,7 +24,7 @@ import { ExtensionAbilityInfo as _ExtensionAbilityInfo } from './bundle/extensio import { PermissionDef as _PermissionDef } from './bundle/PermissionDef'; import { ElementName as _ElementName } from './bundle/elementName'; import { DispatchInfo as _DispatchInfo } from './bundle/dispatchInfo'; -import Want from './@ohos.application.want'; +import Want from './@ohos.application.Want'; import image from './@ohos.multimedia.image'; import pack from './bundle/packInfo'; import * as _PackInfo from './bundle/packInfo'; diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index 1a2ca8aa49ddac78a6e83b78da6d07759b9ae0e9..c823454d849b08d260a86fdad8dbfabd88a985b5 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -474,8 +474,8 @@ declare namespace bundleState { * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. */ - function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; - function registerGroupCallBack(callback: Callback): Promise; + function registerGroupCallBack(groupCallback: Callback, callback: AsyncCallback): void; + function registerGroupCallBack(groupCallback: Callback): Promise; /** * unRegister callback from service. diff --git a/api/@ohos.configPolicy.d.ts b/api/@ohos.configPolicy.d.ts index d12690c30faca84069c5fedcbef457ed789f20f1..ab4827cd50137c6835c04fb9395f8b6631a725e8 100644 --- a/api/@ohos.configPolicy.d.ts +++ b/api/@ohos.configPolicy.d.ts @@ -19,6 +19,7 @@ import {AsyncCallback} from "./basic"; * Provides file path related APIS. * * @since 8 + * @systemapi * @syscap SystemCapability.Customization.ConfigPolicy */ declare namespace configPolicy { diff --git a/api/@ohos.contact.d.ts b/api/@ohos.contact.d.ts index b286bac9432d62b5d165310f892e5f810cb09699..c1cb9c658face1c952326a1446e7cbea268db18e 100644 --- a/api/@ohos.contact.d.ts +++ b/api/@ohos.contact.d.ts @@ -39,7 +39,7 @@ declare namespace contact { * * @return Returns the contact list which user select; * returns empty contact list if user not select. - * @syscap SystemCapability.Applications.ContactsData, SystemCapability.Applications.Contacts + * @syscap SystemCapability.Applications.Contacts * @permission ohos.permission.READ_CONTACTS */ function selectContact(callback: AsyncCallback>): void; diff --git a/api/@ohos.effectKit.d.ts b/api/@ohos.effectKit.d.ts index 3164c81f25eaf2dbc74468ec04119524e0653e97..78ffb0c148c94351fdceebeff7ce3583c8e7371d 100644 --- a/api/@ohos.effectKit.d.ts +++ b/api/@ohos.effectKit.d.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +import { AsyncCallback } from './basic'; +import image from './@ohos.multimedia.image'; + /** * @name effectKit * @since 9 diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts index 03fb19c9007e5ea96bdc021bd86a9a8a5040a9dc..273c97f1174fee9f4667838aebe769b198c0706e 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterpriseDeviceManager.d.ts @@ -15,7 +15,7 @@ import { AsyncCallback, Callback } from "./basic"; import { DeviceSettingsManager as _DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager"; -import Want from "./@ohos.application.want"; +import Want from "./@ohos.application.Want"; /** * enterprise device manager. diff --git a/api/@ohos.fileExtensionInfo.d.ts b/api/@ohos.fileExtensionInfo.d.ts index 877d5c4c2ef4e25ab184698512156ccc38bfc4b3..d016f74bc52af58ac158def2e5bc16b1992e198b 100644 --- a/api/@ohos.fileExtensionInfo.d.ts +++ b/api/@ohos.fileExtensionInfo.d.ts @@ -18,12 +18,14 @@ * * @since 9 * @syscap SystemCapability.FileManagement.UserFileService + * @systemapi */ declare namespace fileExtensionInfo { /** * DeviceType Indicates the type of device connected to the fileaccess server. * @since 9 * @syscap SystemCapability.FileManagement.UserFileService + * @systemapi * @StageModelOnly */ enum DeviceType { @@ -40,6 +42,7 @@ declare namespace fileExtensionInfo { * Indicates the supported capabilities of the device. * @since 9 * @syscap SystemCapability.FileManagement.UserFileService + * @systemapi * @StageModelOnly */ namespace DeviceFlag { @@ -51,6 +54,7 @@ declare namespace fileExtensionInfo { * Indicate the supported capabilities of the file or directory. * @since 9 * @syscap SystemCapability.FileManagement.UserFileService + * @systemapi * @StageModelOnly */ namespace DocumentFlag { diff --git a/api/@ohos.fileio.d.ts b/api/@ohos.fileio.d.ts index 46e416e0050f3945cec446c6f50c02190cf38b33..e13dae4b53d4765a96485a94704bd981a2d218a3 100644 --- a/api/@ohos.fileio.d.ts +++ b/api/@ohos.fileio.d.ts @@ -1160,6 +1160,7 @@ declare interface Filter { /** * @type {Array} * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi * @since 9 * @readonly */ @@ -1167,6 +1168,7 @@ declare interface Filter { /** * @type {Array} * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi * @since 9 * @readonly */ @@ -1174,6 +1176,7 @@ declare interface Filter { /** * @type {Array} * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi * @since 9 * @readonly */ @@ -1181,6 +1184,7 @@ declare interface Filter { /** * @type {number} * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi * @since 9 * @readonly */ @@ -1188,6 +1192,7 @@ declare interface Filter { /** * @type {number} * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi * @since 9 * @readonly */ @@ -1195,6 +1200,7 @@ declare interface Filter { /** * @type {boolean} * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi * @since 9 * @readonly */ diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index ad31470548326a71072f5f033a80691786475118..8fdc6979627bbbe8998c64d2c733e92516ed7151 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -47,6 +47,18 @@ declare namespace connection { function getDefaultNet(callback: AsyncCallback): void; function getDefaultNet(): Promise; + /** + * Obtains the data network that is activated by default. + * + *

To call this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. + * + * @return Returns the {@link NetHandle} object; + * returns {@code null} if the default network is not activated. + * @permission ohos.permission.GET_NETWORK_INFO + * @since 9 + */ + function getDefaultNetSync(): NetHandle; + /** * Obtains the list of data networks that are activated. * diff --git a/api/@ohos.pasteboard.d.ts b/api/@ohos.pasteboard.d.ts index cf7e702fcd7952bb01f411e0e996508b3ad7890d..6ef00195f9217f8bfb44fda61b4fd0f2d51b22a0 100644 --- a/api/@ohos.pasteboard.d.ts +++ b/api/@ohos.pasteboard.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ import { AsyncCallback } from './basic'; -import Want from './@ohos.application.want'; +import Want from './@ohos.application.Want'; import { image } from './@ohos.multimedia.image'; /** diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index f264256223c464b862d896303e0620daf961d2d2..834ca7614cd182895019a59207a51a9df001b8f8 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback } from './basic'; -import Want from './@ohos.application.want'; +import Want from './@ohos.application.Want'; /** * Plugin component template property. diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 2a48ba7418b654723231e5e6e2f6c91b4b92c33c..a0a6b2abafeef8e2c88bb600337284ca92bd7a74 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -131,27 +131,64 @@ declare namespace call { function formatPhoneNumberToE164(phoneNumber: string, countryCode: string): Promise; /** - * @systemapi Hide this for inner system use. + * Answers the incoming call. + * + * @param callId Indicates the identifier of the call to answer. * @permission ohos.permission.ANSWER_CALL + * @systemapi Hide this for inner system use. * @since 7 */ function answer(callId: number, callback: AsyncCallback): void; - function answer(callId: number): Promise; + function answer(callId?: number): Promise; /** + * Answers the incoming call without callId. + * + * @permission ohos.permission.ANSWER_CALL + * @systemapi Hide this for inner system use. + * @since 9 + */ + function answer(callback: AsyncCallback): void; + + /** + * Hangups the foreground call. + * + * @param callId Indicates the identifier of the call to hangup. * @systemapi Hide this for inner system use. * @since 7 */ function hangup(callId: number, callback: AsyncCallback): void; - function hangup(callId: number): Promise; + function hangup(callId?: number): Promise; /** + * Hangups the foreground call without callId. + * + * @systemapi Hide this for inner system use. + * @since 9 + */ + function hangup(callback: AsyncCallback): void; + + /** + * Rejects the incoming call. + * + * @param callId Indicates the identifier of the call to reject. + * @param options Indicates the text message to reject. * @systemapi Hide this for inner system use. * @since 7 */ function reject(callId: number, callback: AsyncCallback): void; function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void; - function reject(callId: number, options?: RejectMessageOptions): Promise; + function reject(callId?: number, options?: RejectMessageOptions): Promise; + + /** + * Rejects the incoming call without callId. + * + * @param options Indicates the text message to reject. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function reject(callback: AsyncCallback): void; + function reject(options: RejectMessageOptions, callback: AsyncCallback): void; /** * @systemapi Hide this for inner system use. @@ -274,6 +311,26 @@ declare namespace call { */ function off(type: 'callDisconnectedCause', callback?: Callback): void; + /** + * Observe the result of MMI code + * + * @param type Indicates the observer type. + * @param callback Return the result of MMI code. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function on(type: 'mmiCodeResult', callback: Callback): void; + + /** + * Unobserve the result of MMI code + * + * @param type Indicates the observer type. + * @param callback Return the result of MMI code. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function off(type: 'mmiCodeResult', callback?: Callback): void; + /** * @systemapi Hide this for inner system use. * @since 8 @@ -339,11 +396,26 @@ declare namespace call { function cancelMuted(): Promise; /** + * Set the audio device + * + * @param device Indicates the device of audio. + * @param callback Returns {@code true} if the request is successful; returns {@code false} otherwise. * @systemapi Hide this for inner system use. * @since 8 */ function setAudioDevice(device: AudioDevice, callback: AsyncCallback): void; - function setAudioDevice(device: AudioDevice): Promise; + + /** + * Set the audio device with options. + * + * @param device Indicates the device of audio. + * @param options Indicates additional information, such as address of bluetooth. + * @param callback Returns {@code true} if the request is successful; returns {@code false} otherwise. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setAudioDevice(device: AudioDevice, options: AudioDeviceOptions, callback: AsyncCallback): void; + function setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise; /** * @systemapi Hide this for inner system use. @@ -397,10 +469,11 @@ declare namespace call { * @since 8 */ export enum AudioDevice { - DEVICE_MIC, + DEVICE_EARPIECE, DEVICE_SPEAKER, DEVICE_WIRED_HEADSET, - DEVICE_BLUETOOTH_SCO + DEVICE_BLUETOOTH_SCO, + DEVICE_MIC, } /** @@ -678,6 +751,36 @@ declare namespace call { countryCode?: string; } + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export interface AudioDeviceOptions { + bluetoothAddress?: string; + } + + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export interface MmiCodeResults { + /** Indicates the result of MMI code. */ + result: MmiCodeResult; + /** Indicates the message of MMI code. */ + message: string; + } + + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export enum MmiCodeResult { + /** Indicates the result of MMI code with successfully. */ + MMI_CODE_SUCCESS = 0, + /** Indicates the result of MMI code with failed. */ + MMI_CODE_FAILED = 1 + } + /** * @systemapi Hide this for inner system use. * @since 8 diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index a82b90e3dd203f02940c831c92af55e69c970de6..1ca3ce823f77aed38d4cfc72243670bd0c3022db 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -31,6 +31,17 @@ declare namespace data { function getDefaultCellularDataSlotId(callback: AsyncCallback): void; function getDefaultCellularDataSlotId(): Promise; + /** + * Checks whether cellular data services are enabled. + * + *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. + * + * @return Returns default cellular data slot id. + * @permission ohos.permission.GET_NETWORK_INFO + * @since 9 + */ + function getDefaultCellularDataSlotIdSync(): number; + /** * Switches cellular data services to another card, without changing the default settings. * diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 0975e3245b9eae7d943b97b1e216e6172098bba6..6c15700681d72bad69ebcd75f15e3b33db20b47a 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -67,11 +67,23 @@ declare namespace radio { /** * Proactively requests to update location information. * - * @systemapi Hide this for inner system use. + * @param { number } [ slotId ] - indicates the card slot index number. + * @param { AsyncCallback } callback - the callback of sendUpdateCellLocationRequest. + * @systemapi * @since 8 */ function sendUpdateCellLocationRequest(callback: AsyncCallback): void; - function sendUpdateCellLocationRequest(): Promise; + function sendUpdateCellLocationRequest(slotId: number, callback: AsyncCallback): void; + + /** + * Proactively requests to update location information. + * + * @param { number } [ slotId ] - indicates the card slot index number. + * @returns { Promise } the promise returned by the function. + * @systemapi + * @since 8 + */ + function sendUpdateCellLocationRequest(slotId?: number): Promise; /** * @permission ohos.permission.LOCATION @@ -780,4 +792,4 @@ declare namespace radio { } } -export default radio; \ No newline at end of file +export default radio; diff --git a/api/@ohos.vibrator.d.ts b/api/@ohos.vibrator.d.ts index 13911f22c23cad4b954a98580c7867da1c188199..47d82fae0be23d9c29aaeaa0560c00027613e206 100755 --- a/api/@ohos.vibrator.d.ts +++ b/api/@ohos.vibrator.d.ts @@ -20,14 +20,6 @@ import { AsyncCallback } from './basic'; * @since 8 * @syscap SystemCapability.Sensors.MiscDevice * @import import vibrator from '@ohos.vibrator' - * @permission ohos.permission.VIBRATE - */ -/** - * This module provides the capability to control motor vibration. - * - * @since 9 - * @syscap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@ohos.vibrator' */ declare namespace vibrator { /** diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 27e0b6bfe490fa812a5129de4a8aa2d14ad87799..48a996a4816d4cb917332e965b0ca0d4c0b1f803 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback , Callback} from './basic'; -import Want from './@ohos.application.want'; +import Want from './@ohos.application.Want'; import { WantAgentInfo as _WantAgentInfo } from './wantAgent/wantAgentInfo'; import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; diff --git a/api/ability/want.d.ts b/api/ability/want.d.ts index 51e6579928be2ea6d566a121d3e9dcebabba2b50..dffea8ddf4591fc075983acb301b60f4182907ce 100644 --- a/api/ability/want.d.ts +++ b/api/ability/want.d.ts @@ -20,6 +20,7 @@ * @syscap SystemCapability.Ability.AbilityBase * @permission N/A * @deprecated since 9 + * @useinstead ohos.application.Want */ export declare interface Want { /** diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 4febfbf618f68d3c89d0bdefc89d8abdc5b34232..2cce1451eee205b3de3a4296fc8edf05d2c1fa1f 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -/// +/// import { AbilityInfo } from "../bundle/abilityInfo"; import { AbilityResult } from "../ability/abilityResult"; diff --git a/api/application/ApplicationStateObserver.d.ts b/api/application/ApplicationStateObserver.d.ts index 320238f2cadf66d4561a10c75860925bb53098fd..71cab9a6b377e4695fd7af99c284b0ec5b970f0c 100644 --- a/api/application/ApplicationStateObserver.d.ts +++ b/api/application/ApplicationStateObserver.d.ts @@ -69,6 +69,17 @@ export default class ApplicationStateObserver { * @return - */ onProcessDied(processData: ProcessData): void; + + /** + * Called when process state changes. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param processData Process info. + * @systemapi hide for inner use. + * @return - + */ + onProcessStateChanged(processData: ProcessData): void; } /** diff --git a/api/application/MissionListener.d.ts b/api/application/MissionListener.d.ts index 661dabf7633d514e3dbc84828dee5c8e08747fea..e80aaa7d62eabd8f11d8abe2074723f7c85276ec 100644 --- a/api/application/MissionListener.d.ts +++ b/api/application/MissionListener.d.ts @@ -65,6 +65,16 @@ import image from "../@ohos.multimedia.image"; */ onMissionMovedToFront(mission: number): void; + /** + * Called by system when mission label has changed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of the mission whose label has changed. + * @return - + */ + onMissionLabelUpdated(mission: number): void; + /** * Called by system when mission icon has changed. * diff --git a/api/application/MissionSnapshot.d.ts b/api/application/MissionSnapshot.d.ts index 3fa0dd05878ad1bb7db96bcb761bfd91b50b15f7..eec0f49c6b443ed78d9a3078aea8f6f4693a018c 100644 --- a/api/application/MissionSnapshot.d.ts +++ b/api/application/MissionSnapshot.d.ts @@ -14,7 +14,7 @@ */ import { ElementName } from '../bundle/elementName'; -import { image } from '../@ohos.multimedia.image'; +import image from '../@ohos.multimedia.image'; /** * Mission snapshot corresponding to mission. diff --git a/api/application/ProcessData.d.ts b/api/application/ProcessData.d.ts index e96fe473aeb76300f0dc17f7c8fed921f104fadf..2aa6580101e3c60d4a3a74719ff0435542c43257 100644 --- a/api/application/ProcessData.d.ts +++ b/api/application/ProcessData.d.ts @@ -48,4 +48,31 @@ export default class ProcessData { * @systemapi hide for inner use. */ uid: number; + + /** + * The process state. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + */ + state: number; + + /** + * Whether the process is continuous task. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + */ + isContinuousTask: boolean; + + /** + * Whether the process is keep alive. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + */ + isKeepAlive: boolean; } \ No newline at end of file diff --git a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts b/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts index d670189b3989d3e3427297f25d1b789c339aad24..c29c0dda15f0914d3d49df606b81687b93eea872 100644 --- a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts +++ b/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback, Callback } from "./../basic"; -import Want from "./../@ohos.application.want"; +import Want from "./../@ohos.application.Want"; /** * @name Offers set settings policies on the devices. diff --git a/api/wantAgent/triggerInfo.d.ts b/api/wantAgent/triggerInfo.d.ts index 20e1d1b009044078a276802aa1a8f1a268289daa..8da1a958774314f90eba6d9e5d60220c033c720b 100644 --- a/api/wantAgent/triggerInfo.d.ts +++ b/api/wantAgent/triggerInfo.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Want from '../@ohos.application.want'; +import Want from '../@ohos.application.Want'; /** * Provides the information required for triggering a WantAgent. diff --git a/api/wantAgent/wantAgentInfo.d.ts b/api/wantAgent/wantAgentInfo.d.ts index 52cc3383bd51cb4d89a0e53e7e76d2b23a6e34ec..7f06e33be5b77e6cee22d65c194194cd74610d18 100644 --- a/api/wantAgent/wantAgentInfo.d.ts +++ b/api/wantAgent/wantAgentInfo.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Want from '../@ohos.application.want'; +import Want from '../@ohos.application.Want'; import wantAgent from '../@ohos.wantAgent' /** diff --git a/build-tools/api_check_plugin/code_style_rule.json b/build-tools/api_check_plugin/code_style_rule.json index 981c5daeb396911086e11883b7106c70dfa49ef5..e2650026eba03bb60751763fb20404a4192cf0d0 100644 --- a/build-tools/api_check_plugin/code_style_rule.json +++ b/build-tools/api_check_plugin/code_style_rule.json @@ -99,5 +99,10 @@ "name", "undocumented" ] - } + }, + "namingWhitelist": [ + "Symbol", + "StageModelOnly", + "FAModelOnly" + ] } \ No newline at end of file diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index 5e11d86b6c218a75a57387d9ef07e159478efe84..d8eb1b248f9f3680278c0c8f76cea6e53f0117c4 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -27,6 +27,7 @@ function checkEntry(url) { removeDir(path.resolve(__dirname, "node_modules")); } catch (error) { // catch error + result = error; } return result; } diff --git a/build-tools/api_check_plugin/plugin/dictionaries.txt b/build-tools/api_check_plugin/plugin/dictionaries.txt index 3c1f9e2c8b3dcfda6e97564b0fcc40f5c6d055fb..0456908e3bc9b5d2bb71c538a3a52a8d9e16bc81 100644 --- a/build-tools/api_check_plugin/plugin/dictionaries.txt +++ b/build-tools/api_check_plugin/plugin/dictionaries.txt @@ -14935,6 +14935,7 @@ damped dampen dampener damper +damping dampness damsel damselfly @@ -30629,6 +30630,7 @@ indubitable indubitableness indubitably induce +induced inducement inducer inducible @@ -51536,6 +51538,7 @@ replaces replacewith replacing replay +replayed replenish replenishment replete 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 fb1b8d7b792baded54b648438caaab318e3d77a4..e5e215041b93c92501b6e18ebcc9648e7e7e7905 100644 --- a/build-tools/api_check_plugin/src/api_check_plugin.js +++ b/build-tools/api_check_plugin/src/api_check_plugin.js @@ -15,10 +15,10 @@ 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")); const { checkAPIDecorators } = require("./check_decorator"); const { checkSpelling } = require("./check_spelling"); +const { checkAPINameOfHump } = require("./check_hump"); const { hasAPINote } = require("./utils"); let result = require("../check_result.json"); @@ -61,6 +61,9 @@ function checkAPICodeStyleCallback(fileName) { } function checkAllNode(node, sourcefile, fileName) { + if (!ts.isImportDeclaration) { + + } if (hasAPINote(node)) { // check decorator checkAPIDecorators(node, sourcefile, fileName); @@ -70,6 +73,8 @@ function checkAllNode(node, sourcefile, fileName) { if (ts.isIdentifier(node)) { // check variable spelling checkSpelling(node, sourcefile, fileName); + // check hump naming + checkAPINameOfHump(node, sourcefile, fileName); } node.getChildren().forEach((item) => checkAllNode(item, sourcefile, fileName)); } @@ -77,6 +82,6 @@ function checkAllNode(node, sourcefile, fileName) { function scanEntry(url) { // scan entry checkAPICodeStyle(url); - return JSON.stringify(result.scanResult); + return result.scanResult; } exports.scanEntry = scanEntry; diff --git a/build-tools/api_check_plugin/src/check_decorator.js b/build-tools/api_check_plugin/src/check_decorator.js index fbc2dc44aa6b348237e55b4d2f886db76a642b75..b19060bd28e87ccaf5ab660eb6a67560deca3d77 100644 --- a/build-tools/api_check_plugin/src/check_decorator.js +++ b/build-tools/api_check_plugin/src/check_decorator.js @@ -14,8 +14,8 @@ */ const rules = require("../code_style_rule.json"); -const result = require("../check_result.json"); -const { getAPINote } = require("./utils"); +const { addAPICheckErrorLogs } = require('./compile_info'); +const { getAPINote, error_type } = require("./utils"); // duplicate removal const API_ERROR_DECORATOR_POS = new Set([]); @@ -47,22 +47,8 @@ function checkAPIDecorators(node, sourcefile, fileName) { if (hasCodeStyleError) { API_ERROR_DECORATOR_POS.add(node.pos); - const checkFailFileNameSet = new Set(result.apiFiles); - if (!checkFailFileNameSet.has(fileName)) { - result.apiFiles.push(fileName); - } - const posOfNode = sourcefile.getLineAndCharacterOfPosition(node.pos); - const errorMessage = { - "error_type": "unknow decorator", - "file": fileName, - "pos": node.pos, - "column": posOfNode.character + 1, - "line": posOfNode.line + 1, - "error_info": errorInfo - }; - const scanResultSet = new Set(result.scanResult); - scanResultSet.add(errorMessage); - result.scanResult = [...scanResultSet]; + errorInfo += `.`; + addAPICheckErrorLogs(node, sourcefile, fileName, error_type.UNKNOW_DECORATOR, errorInfo); } } } diff --git a/build-tools/api_check_plugin/src/check_hump.js b/build-tools/api_check_plugin/src/check_hump.js new file mode 100644 index 0000000000000000000000000000000000000000..fd6b16c12b0854d7e69a807f95875508ab9933e8 --- /dev/null +++ b/build-tools/api_check_plugin/src/check_hump.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021-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. + */ + +const path = require('path'); +const ts = require(path.resolve(__dirname, "../node_modules/typescript")); +const { error_type } = require('./utils'); +const rules = require("../code_style_rule.json"); +const { addAPICheckErrorLogs } = require('./compile_info'); + +function checkAPINameOfHump(node, sourcefile, fileName) { + let errorInfo = ''; + if (node.parent && !ts.isImportClause(node.parent) && !ts.isImportSpecifier(node.parent) && + (ts.isInterfaceDeclaration(node.parent) || ts.isClassDeclaration(node.parent) || + ts.isEnumDeclaration(node.parent))) { + if (!checkLargeHump(node.escapedText.toString())) { + errorInfo = `This moduleName [${node.escapedText.toString()}] should be used by large hump.`; + } + } else if (!node.parent || (!ts.isImportClause(node.parent) && !ts.isImportSpecifier(node.parent) && + !ts.isTypeReferenceNode(node.parent) && !ts.isQualifiedName(node.parent) && + !ts.isTypeParameterDeclaration(node.parent))) { + if (!checkSmallHump(node.escapedText.toString())) { + errorInfo = `This moduleName [${node.escapedText.toString()}] should be used by small hump.`; + } + } + if (errorInfo !== '') { + addAPICheckErrorLogs(node, sourcefile, fileName, error_type.NAMING_ERRORS, errorInfo); + } +} +exports.checkAPINameOfHump = checkAPINameOfHump; + +function checkAPIFileName(sourcefile, fileName) { + const moduleNames = new Set([]); + const exportAssignments = new Set([]); + sourcefile.statements.forEach((statement, index) => { + if (ts.isModuleDeclaration(statement) && statement.name && ts.isIdentifier(statement.name)) { + moduleNames.add(statement.name.escapedText.toString()); + } + if (ts.isExportAssignment(statement) && statement.expression && ts.isIdentifier(statement.expression)) { + exportAssignments.add(statement.expression.escapedText.toString()); + } + }); + if (exportAssignments.size > 1) { + addAPICheckErrorLogs(sourcefile, sourcefile, fileName, error_type.NAMING_ERRORS, + `This API file can only have one export default statement.`); + } else if (exportAssignments.size === 1) { + const basename = path.basename(fileName); + if (/^@ohos|@system/g.test(basename)) { + for (const exportAssignment of exportAssignments) { + const lastModuleName = basename.split('.').at(-1); + if (moduleNames.has(exportAssignment) && !checkSmallHump(lastModuleName)) { + addAPICheckErrorLogs(sourcefile, sourcefile, fileName, error_type.NAMING_ERRORS, + `This API file should be named by small hump.`); + } else if (!checkLargeHump(lastModuleName)) { + addAPICheckErrorLogs(sourcefile, sourcefile, fileName, error_type.NAMING_ERRORS, + `This API file should be named by large hump.`); + } + } + } else if (!checkSmallHump(basename)) { + addAPICheckErrorLogs(sourcefile, sourcefile, fileName, error_type.NAMING_ERRORS, + `This API file should be named by small hump.`); + } + } +} + +function spliteByHump(word) { + let firstBasicWord = word; + if (/(? { - const posOfNode = sourceFile.getLineAndCharacterOfPosition(diagnosis.pos); - diagnosis.column = posOfNode.character + 1; - diagnosis.line = posOfNode.line + 1; - diagnosis.messageText = ``; - formatDiagnosises.push(diagnosis); - }); -} \ No newline at end of file +function addAPICheckErrorLogs(node, sourcefile, fileName, errorType, errorInfo) { + const checkFailFileNameSet = new Set(result.apiFiles); + if (!checkFailFileNameSet.has(fileName)) { + result.apiFiles.push(fileName); + } + const posOfNode = sourcefile.getLineAndCharacterOfPosition(node.pos); + // const errorMessage = { + // "error_type": "misspell words", + // "file": fileName, + // "pos": node.pos, + // "column": posOfNode.character + 1, + // "line": posOfNode.line + 1, + // "error_info": `Error basic words in [${nodeText}]: ${errorWords}. ` + + // `Do you want to spell it as [${suggest}]?` + // }; + const errorMessage = `API check error of [${errorType}] in ${fileName}(line:${posOfNode.line + 1}, col:` + + `${posOfNode.character + 1}): ${errorInfo}`; + const scanResultSet = new Set(result.scanResult); + scanResultSet.add(errorMessage); + result.scanResult = [...scanResultSet]; +} +exports.addAPICheckErrorLogs = addAPICheckErrorLogs; diff --git a/build-tools/api_check_plugin/src/utils.js b/build-tools/api_check_plugin/src/utils.js index 96a03ca44b4c561c6cf9a868e61b4b84586f02d1..7658f2858b3628ad88885d7a8c539b0f1c851920 100644 --- a/build-tools/api_check_plugin/src/utils.js +++ b/build-tools/api_check_plugin/src/utils.js @@ -65,3 +65,10 @@ function overwriteIndexOf(item, array) { return indexArr; } exports.overwriteIndexOf = overwriteIndexOf; + +const error_type = { + UNKNOW_DECORATOR: 'unknow decorator', + MISSPELL_WORDS: 'misspell words', + NAMING_ERRORS: 'naming errors' +} +exports.error_type = error_type; diff --git a/build-tools/api_check_plugin/test/test.js b/build-tools/api_check_plugin/test/test.js index 85170b8813b40b1c2921d5e581a92265ef211e01..2eb34f2776b52d69ae7c1e557b257eba320ffb5a 100644 --- a/build-tools/api_check_plugin/test/test.js +++ b/build-tools/api_check_plugin/test/test.js @@ -22,7 +22,7 @@ function checkEntryLocalText(url) { result = scanEntry(url); const { removeDir } = require(path.resolve(__dirname, "../src/utils")); removeDir(path.resolve(__dirname, "../node_modules")); - console.log(result) + console.log(JSON.stringify(result)) } checkEntryLocalText("./mdFiles.txt");