diff --git a/api/@internal/component/ets/grid_col.d.ts b/api/@internal/component/ets/grid_col.d.ts index 82f21622927f9445fb9526628e914417f6813659..cb493ec093033e36f73a172fd6722e372a6a935e 100644 --- a/api/@internal/component/ets/grid_col.d.ts +++ b/api/@internal/component/ets/grid_col.d.ts @@ -64,19 +64,19 @@ declare interface GridColOptions { * Sets the span of current gird-container item. * @since 9 */ - span?: GridColColumnOption; + span?: number | GridColColumnOption; /** * Sets the offset of current gird-container item. * @since 9 */ - offset?: GridColColumnOption; + offset?: number | GridColColumnOption; /** * Sets the order of current gird-container item. * @since 9 */ - order?: GridColColumnOption; + order?: number | GridColColumnOption; } @@ -92,7 +92,25 @@ interface GridColInterface { (optiion?: GridColOptions): GridColAttribute; } -declare class GridColAttribute extends CommonMethod {} +declare class GridColAttribute extends CommonMethod { + /** + * Sets the span of current gird-container item. + * @since 9 + */ + span(value: number | GridColColumnOption): GridRowAttribute; + + /** + * Sets the offset of current gird-container item. + * @since 9 + */ + offset(value: number | GridColColumnOption): GridRowAttribute; + + /** + * Sets the order of current gird-container item. + * @since 9 + */ + order(value: number | GridColColumnOption): GridRowAttribute; +} declare const GridCol: GridColInterface declare const GridColInstance: GridColAttribute; \ No newline at end of file diff --git a/api/@internal/component/ets/grid_row.d.ts b/api/@internal/component/ets/grid_row.d.ts index 8ce36fd3622e30022efff663ac8952acb36302b3..7418da6909a7ed6bec9c25fa2efac4f1b1d16f11 100644 --- a/api/@internal/component/ets/grid_row.d.ts +++ b/api/@internal/component/ets/grid_row.d.ts @@ -179,7 +179,7 @@ declare interface GridRowOptions { * grid-container layout column spacing. * @since 9 */ - gutter?: GetterOption; + gutter?: Length | GetterOption; /** * Sets the total number of columns in the current layout. @@ -214,18 +214,6 @@ interface GridRowInterface { } declare class GridRowAttribute extends CommonMethod { - /** - * Set the alignment of sub components in the vertical direction - * @since 9 - */ - verticalAlign(value: VerticalAlign): GridRowAttribute; - - /** - * Set the alignment of sub components in the horizontal direction - * @since 9 - */ - horizontalAlign(value: HorizontalAlign): GridRowAttribute; - /** * Callback triggered when the breakpoint changes * @since 9 diff --git a/api/@internal/component/ets/tabs.d.ts b/api/@internal/component/ets/tabs.d.ts index 509d578ff2c4dfef3bf4bc344923f42932ad0be0..fd878d5d054c6049f224323a2c18669b951fbca5 100644 --- a/api/@internal/component/ets/tabs.d.ts +++ b/api/@internal/component/ets/tabs.d.ts @@ -89,6 +89,12 @@ declare class TabsAttribute extends CommonMethod { */ vertical(value: boolean): TabsAttribute; + /** + * Called when determining the location of the bar chart. + * @since 9 + */ + barPosition(value: BarPosition): TabsAttribute; + /** * Called when judging whether page switching can be performed by sliding left and right. * @since 7 diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index f2b0c93a3ab1832e567521d3739245d1836f51f5..ffb8faf6bca9a2372b00e93545aee89d4fcc88b4 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -342,7 +342,7 @@ declare class HitTestValue { * Defines the http auth request result, related to {@link onHttpAuthRequest} method. * @since 9 */ -declare class WebHttpAuthResult { +declare class HttpAuthHandler { /** * Constructor. * @since 9 @@ -1364,7 +1364,7 @@ declare class WebAttribute extends CommonMethod { * * @since 9 */ - onHttpAuthRequest(callback: (event?: { result: WebHttpAuthResult }) => boolean): WebAttribute; + onHttpAuthRequest(callback: (event?: { handler: HttpAuthHandler, host: string, realm: string }) => boolean): WebAttribute; /** * Triggered when the resouces loading is intercepted. diff --git a/api/@ohos.ability.ability.d.ts b/api/@ohos.ability.ability.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..44be58f12e8b9ef4cb8065dcefc71c68003f576b --- /dev/null +++ b/api/@ohos.ability.ability.d.ts @@ -0,0 +1,82 @@ +/* + * 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. + */ + +import { DataAbilityHelper as _DataAbilityHelper } from './ability/dataAbilityHelper'; +import { PacMap as _PacMap } from './ability/dataAbilityHelper'; +import { DataAbilityOperation as _DataAbilityOperation } from './ability/dataAbilityOperation'; +import { DataAbilityResult as _DataAbilityResult } from './ability/dataAbilityResult'; +import { AbilityResult as _AbilityResult } from './ability/abilityResult'; +import { ConnectOptions as _ConnectOptions } from './ability/connectOptions'; +import { StartAbilityParameter as _StartAbilityParameter } from './ability/startAbilityParameter'; + +/** + * The class of an ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + */ +declare namespace ability { + + /** + * DataAbilityHelper + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * + * @since 9 + * @FAModelOnly + */ + export type DataAbilityHelper = _DataAbilityHelper + + /** + * Defines a PacMap object for storing a series of values. + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export type PacMap = _PacMap + + /** + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + */ + export type DataAbilityOperation = _DataAbilityOperation + + /** + * @name DataAbilityResult + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + */ + export type DataAbilityResult = _DataAbilityResult + + /** + * @since 9 + * @syscap SystemCapability.Ability.AbilityBase + */ + export type AbilityResult = _AbilityResult + + /** + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type ConnectOptions = _ConnectOptions + + /** + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + */ + export type StartAbilityParameter = _StartAbilityParameter +} + +export default ability; \ No newline at end of file diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 109bd803f56e15295baed2d2383c769baac7872f..f2e673e613ade315cb8443524f635d5d17c8e21d 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -18,9 +18,11 @@ import { Callback } from './basic'; import Want from './@ohos.application.want'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { AbilityResult } from './ability/abilityResult'; +import { AppVersionInfo as _AppVersionInfo } from './app/appVersionInfo'; import { Context as _Context } from './app/context'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; +import { ProcessInfo as _ProcessInfo } from './app/processInfo'; import window from './@ohos.window'; /** @@ -224,6 +226,21 @@ declare namespace featureAbility { * @import import abilityManager from 'app/context' * @FAModelOnly */ - export type Context = _Context + export type Context = _Context + + /** + * Defines an AppVersionInfo object. + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type AppVersionInfo = _AppVersionInfo + + /** + * @name This class saves process information about an application + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import ProcessInfo from 'app/processInfo' + */ + export type ProcessInfo = _ProcessInfo } export default featureAbility; diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7d3632e72757855eef1badb40fb1fd04e7970d7 --- /dev/null +++ b/api/@ohos.accessibility.config.d.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +import accessibility from './@ohos.accessibility'; +import { AsyncCallback } from './basic'; + +/** + * Configuration of the accessibility. + * + * @since 9 + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + */ +declare namespace config { + /** + * Enable the acceessibility extension ability. + * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * @param capability Indicates the ability. + */ + function enableAbility(name: string, capability: Array): Promise; + function enableAbility(name: string, capability: Array, callback: AsyncCallback): void; + + /** + * Disable the acceessibility extension ability. + * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. + */ + function disableAbility(name: string): Promise; + function disableAbility(name: string, callback: AsyncCallback): void; +} +export default config; \ No newline at end of file diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 8a89bbc773dd031738df5eb734d28273a913024c..4642593dcdb25587737924c8f6627cf53612f86e 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -44,7 +44,7 @@ export interface OnReleaseCallBack { * @return rpc.Sequenceable * @StageModelOnly */ -export interface CaleeCallBack { +export interface CalleeCallBack { (indata: rpc.MessageParcel): rpc.Sequenceable; } @@ -123,7 +123,7 @@ export interface Callee { * @return - * @StageModelOnly */ - on(method: string, callback: CaleeCallBack): void; + on(method: string, callback: CalleeCallBack): void; /** * Unregister data listener callback. diff --git a/api/@ohos.application.Configuration.d.ts b/api/@ohos.application.Configuration.d.ts index fe7a55934c9c1f7f675500592799cccfba783978..b1c3861169ad7dcd36bd1e5e1940b4cfc8228cb6 100644 --- a/api/@ohos.application.Configuration.d.ts +++ b/api/@ohos.application.Configuration.d.ts @@ -63,4 +63,12 @@ export interface Configuration { * @syscap SystemCapability.Ability.AbilityBase */ displayId?: number; + + /** + * Indicates whether a pointer type device has connected. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityBase + */ + hasPointerDevice?: boolean; } diff --git a/api/@ohos.application.abilityDelegatorRegistry.d.ts b/api/@ohos.application.abilityDelegatorRegistry.d.ts index cd7a48c6b10060fc550ca180aad6b6e4a93355c0..ad936320c56840c0517b6d5d55d041aab539644d 100644 --- a/api/@ohos.application.abilityDelegatorRegistry.d.ts +++ b/api/@ohos.application.abilityDelegatorRegistry.d.ts @@ -13,8 +13,10 @@ * limitations under the License. */ -import { AbilityDelegator } from './application/abilityDelegator'; -import { AbilityDelegatorArgs } from './application/abilityDelegatorArgs'; +import { AbilityDelegator as _AbilityDelegator } from './application/abilityDelegator'; +import { AbilityDelegatorArgs as _AbilityDelegatorArgs } from './application/abilityDelegatorArgs'; +import { AbilityMonitor as _AbilityMonitor } from './application/abilityMonitor'; +import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult'; /** * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered @@ -57,6 +59,43 @@ declare namespace abilityDelegatorRegistry { BACKGROUND, DESTROY, } + + /** + * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegator from 'application/abilityDelegator.d' + */ + export type AbilityDelegator = _AbilityDelegator + + /** + * Store unit testing-related parameters, including test case names, and test runner name. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegatorArgs from 'application/abilityDelegatorArgs.d' + */ + export type AbilityDelegatorArgs = _AbilityDelegatorArgs + + /** + * Provide methods for matching monitored Ability objects that meet specified conditions. + * The most recently matched Ability objects will be saved in the AbilityMonitor object. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityMonitor from 'application/abilityMonitor.d' + */ + export type AbilityMonitor = _AbilityMonitor + + /** + * A object that records the result of shell command executes. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import ShellCmdResult from 'application/shellCmdResult.d' + */ + export type ShellCmdResult = _ShellCmdResult } export default abilityDelegatorRegistry; \ No newline at end of file diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index 1546b095a45657e84908068ad75eec0d05927704..a7a44ce1e9a4c0cd72c316ae9cfde377f74a087f 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -15,8 +15,8 @@ import { AsyncCallback } from './basic'; import { Configuration } from './@ohos.application.Configuration'; -import { AbilityRunningInfo } from './application/AbilityRunningInfo'; -import { ExtensionRunningInfo } from './application/ExtensionRunningInfo'; +import { AbilityRunningInfo as _AbilityRunningInfo } from './application/AbilityRunningInfo'; +import { ExtensionRunningInfo as _ExtensionRunningInfo } from './application/ExtensionRunningInfo'; import { ElementName } from './bundle/elementName'; /** @@ -91,6 +91,24 @@ declare namespace abilityManager { */ function getTopAbility(): Promise; function getTopAbility(callback: AsyncCallback): void; + + /** + * The class of an ability running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + export type AbilityRunningInfo = _AbilityRunningInfo + + /** + * The class of an extension running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + export type ExtensionRunningInfo = _ExtensionRunningInfo } export default abilityManager; \ No newline at end of file diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index a116e01990c216652bfb601333d4d062b628654b..753939eebb9f255d892627174cf221b07008f9f7 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -14,9 +14,11 @@ */ import { AsyncCallback } from './basic'; -import ApplicationStateObserver from './application/ApplicationStateObserver'; -import AppStateData from './application/AppStateData'; -import { ProcessRunningInfo } from './application/ProcessRunningInfo'; +import * as _ApplicationStateObserver from './application/ApplicationStateObserver'; +import * as _AbilityStateData from './application/AbilityStateData'; +import * as _AppStateData from './application/AppStateData'; +import * as _ProcessData from './application/ProcessData'; +import { ProcessRunningInfo as _ProcessRunningInfo } from './application/ProcessRunningInfo'; /** * This module provides the function of app manager service. @@ -139,6 +141,50 @@ declare namespace appManager { */ function getAppMemorySize(): Promise; function getAppMemorySize(callback: AsyncCallback): void; + + /** + * The ability or extension state data. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + */ + export type AbilityStateData = _AbilityStateData.default + + /** + * The application state data. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + */ + export type AppStateData = _AppStateData.default + + /** + * The application state observer. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + */ + export type ApplicationStateObserver = _ApplicationStateObserver.default + + /** + * The process data. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @systemapi hide for inner use. + */ + export type ProcessData = _ProcessData.default + + /** + * The class of an process running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type ProcessRunningInfo = _ProcessRunningInfo } export default appManager; diff --git a/api/@ohos.application.context.d.ts b/api/@ohos.application.context.d.ts index b08a47da8082bf137d20573fee0e2a719f10a49f..cae84c127a276814734bf67b0dca81780e7a3d09 100755 --- a/api/@ohos.application.context.d.ts +++ b/api/@ohos.application.context.d.ts @@ -20,6 +20,8 @@ import * as _BaseContext from './application/BaseContext'; import * as _Context from './application/Context'; import * as _ExtensionContext from './application/ExtensionContext'; import * as _FormExtensionContext from './application/FormExtensionContext'; +import * as _EventHub from './application/EventHub'; +import * as _PermissionRequestResult from './application/PermissionRequestResult'; /** * The context of an application. It allows access to application-specific resources. @@ -94,6 +96,42 @@ declare namespace context { * @StageModelOnly */ export type FormExtensionContext = _FormExtensionContext.default + + /** + * File area mode + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export enum AreaMode { + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + EL1 = 0, + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + EL2 = 1 + } + + /** + * The event center of a context, support the subscription and publication of events. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export type EventHub = _EventHub.default + + /** + * The result of requestPermissionsFromUser with asynchronous callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export type PermissionRequestResult = _PermissionRequestResult.default } export default context; \ No newline at end of file diff --git a/api/@ohos.application.errorManager.d.ts b/api/@ohos.application.errorManager.d.ts index 490cac91f4ec94a26d2428de5bed4ca9e05a32b9..dda4361c792b435dc9a79088111180181cbd6216 100644 --- a/api/@ohos.application.errorManager.d.ts +++ b/api/@ohos.application.errorManager.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback } from './basic'; -import ErrorObserver from './application/ErrorObserver'; +import * as _ErrorObserver from './application/ErrorObserver'; /** * This module provides the function of error manager. @@ -46,6 +46,14 @@ declare namespace errorManager { */ function unregisterErrorObserver(observerId: number, callback: AsyncCallback): void; function unregisterErrorObserver(observerId: number): Promise; + + /** + * The observer will be called by system when an error occurs. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type ErrorObserver = _ErrorObserver.default } export default errorManager; diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts index 6506633bcaf2e1fc005a99d47dde11118883dabb..3f43e85ddc99b2646f8bb7b1cb80c07b05a882f0 100644 --- a/api/@ohos.application.missionManager.d.ts +++ b/api/@ohos.application.missionManager.d.ts @@ -14,9 +14,9 @@ */ import { AsyncCallback } from './basic'; -import { MissionInfo } from './application/MissionInfo'; -import { MissionListener } from './application/MissionListener'; -import { MissionSnapshot } from './application/MissionSnapshot'; +import { MissionInfo as _MissionInfo } from './application/MissionInfo'; +import { MissionListener as _MissionListener } from './application/MissionListener'; +import { MissionSnapshot as _MissionSnapshot } from './application/MissionSnapshot'; import StartOptions from "./@ohos.application.StartOptions"; /** @@ -153,6 +153,34 @@ declare namespace missionManager { function moveMissionToFront(missionId: number, callback: AsyncCallback): void; function moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback): void; function moveMissionToFront(missionId: number, options?: StartOptions): Promise; + + /** + * Mission information corresponding to ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @systemapi hide for inner use. + */ + export type MissionInfo = _MissionInfo + + /** + * MissionListener registered by app. + * + * @name MissionListener + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @systemapi hide for inner use. + */ + export type MissionListener = _MissionListener + + /** + * Mission snapshot corresponding to mission. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @systemapi hide for inner use. + */ + export type MissionSnapshot = _MissionSnapshot } export default missionManager; \ No newline at end of file diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 0b2eff47d641a924da0e2dcaff70dcd78bb5046d..c27071385fc983bd4d8d1e4909538f0ab5e0b3c8 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -896,7 +896,7 @@ declare namespace bundle { * @systemapi Hide this for inner system use */ function setDisposedStatus(bundleName: string, status: number, callback: AsyncCallback): void; - function setDisposedStatus(bundleName: string, status: number,): Promise; + function setDisposedStatus(bundleName: string, status: number): Promise; /** * Obtains the disposed status of a specified bundle. diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 9b00d6108b26a3b218ee92b893ef0f7d8105561f..5734f84a1c09bbd9e54277056ff124a7b8a96cae 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -254,6 +254,12 @@ declare namespace commonEvent { */ COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED", + /** + * this commonEvent means the user has cleared the package cache. + * @since 9 + */ + COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED", + /** * this commonEvent means the packages have been suspended. */ diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index b69caae78a93afd2cebc4836f387a137293341f6..9dc938384c488116ccabeba2b3546d29dfaa21ab 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -57,7 +57,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @Note: if swap the area, you should close all the KV store and use the new Context to create the KVManager - * @StageModelOnly */ context: Context; } diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index 56c14d6488e668727d08b12e6eb7553e4ac752f8..d8a755e11c027b7b3a0ae7f528d2da1609a0cc62 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -305,7 +305,7 @@ declare namespace geolocation { function sendCommand(command: LocationCommand) : Promise; /** - * Obtain the current country code. + * obtain the current country code. * * @since 9 * @syscap SystemCapability.Location.Location.Core @@ -321,19 +321,23 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @systemapi * @param scenario Indicates the scenarios where location simulation is required. - * @param callback Indicates whether the position simulation function is enabled. + * @param callback Indicates a callback function, which is used to report the result + * of enabling the location simulation function. If the enabling fails, the error message will + * be carried in the first parameter err of AsyncCallback, If enabling succeeds, no data will be returned. */ function enableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback) : void; function enableLocationMock(scenario?: LocationRequestScenario) : Promise; /** - * diable the geographical location simulation function. + * disable the geographical location simulation function. * * @since 9 * @syscap SystemCapability.Location.Location.Core * @systemapi * @param scenario Indicates the scenarios where location simulation is required. - * @param callback Indicates whether the position simulation function is enabled. + * @param callback Indicates a callback function, which is used to report the result + * of disabling the location simulation function. If the disabling fails, the error message will + * be carried in the first parameter err of AsyncCallback, If disabling succeeds, no data will be returned. */ function disableLocationMock(scenario?: LocationRequestScenario, callback: AsyncCallback) : void; function disableLocationMock(scenario?: LocationRequestScenario) : Promise; @@ -345,7 +349,9 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @systemapi * @param config Indicates the configuration parameters for location simulation. - * @param callback Indicates whether the parameters of the location simulation function are set successfully. + * @param callback Indicates a callback function, which is used to report the result of setting + * the simulation locations. If the setting fails, the error message will be carried in the first + * parameter err of AsyncCallback. If the setting succeeds, no data will be returned. */ function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback) : void; function setMockedLocations(config: LocationMockConfig) : Promise; @@ -356,7 +362,9 @@ declare namespace geolocation { * @since 9 * @syscap SystemCapability.Location.Location.Core * @systemapi - * @param callback Indicates whether the reverse geocoding simulation function is enabled. + * @param callback Indicates a callback function, which is used to report the result + * of enabling the reverse geocode simulation function. If the enabling fails, the error message will + * be carried in the first parameter err of AsyncCallback, If enabling succeeds, no data will be returned. */ function enableReverseGeocodingMock(callback: AsyncCallback) : void; function enableReverseGeocodingMock() : Promise; @@ -367,7 +375,9 @@ declare namespace geolocation { * @since 9 * @syscap SystemCapability.Location.Location.Core * @systemapi - * @param callback Indicates whether the reverse geocoding simulation function is enabled. + * @param callback Indicates a callback function, which is used to report the result + * of disabling the reverse geocode simulation function. If the disabling fails, the error message will + * be carried in the first parameter err of AsyncCallback, If disabling succeeds, no data will be returned. */ function disableReverseGeocodingMock(callback: AsyncCallback) : void; function disableReverseGeocodingMock() : Promise; @@ -379,7 +389,10 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @systemapi * @param mockInfos Indicates the set of locations and place names to be simulated. - * @param callback Indicates whether the parameters of the reverse geocoding simulation are set successfully. + * @param callback Indicates a callback function, which is used to report the result of setting + * the configuration parameters for simulating reverse geocoding. If the setting fails, + * the error message will be carried in the first parameter err of AsyncCallback. + * If the setting succeeds, no data will be returned. */ function setReverseGeocodingMockInfo(mockInfos: Array, callback: AsyncCallback) : void; function setReverseGeocodingMockInfo(mockInfos: Array) : Promise; @@ -631,7 +644,7 @@ declare namespace geolocation { addressUrl?: string; /** - * Indicates the amount of additional descriptive information. + * Indicates additional information. * @since 7 */ descriptions?: Array; @@ -751,7 +764,7 @@ declare namespace geolocation { additionSize?: number; /** - * Indicates whether it is an mock GeoAddress + * Indicates whether it is an mock location. * @since 9 */ isFromMock: Boolean; @@ -797,7 +810,7 @@ declare namespace geolocation { export enum GeoLocationErrorCode { /** * Indicates function not supported. - * @since 7 + * @since 9 */ NOT_SUPPORTED = 100, @@ -826,13 +839,13 @@ declare namespace geolocation { LOCATOR_ERROR, /** - * Indicates operation failure caused by abnormal position switch. + * Indicates operation failure caused by abnormal location switch. * @since 7 */ LOCATION_SWITCH_ERROR, /** - * Indicates failed to get the last cache location. + * Indicates failed to get the last known location. * @since 7 */ LAST_KNOWN_LOCATION_ERROR, diff --git a/api/@ohos.hiSysEvent.d.ts b/api/@ohos.hiSysEvent.d.ts index 77c93c4358519ae9198734eb6e3934f2d5327c37..78bacbc2791048c9d7f64116a1e97dab19471b49 100644 --- a/api/@ohos.hiSysEvent.d.ts +++ b/api/@ohos.hiSysEvent.d.ts @@ -23,7 +23,6 @@ import { AsyncCallback } from './basic'; * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @import import hiSysEvent from '@ohos.hiSysEvent' - * @permission ohos.permission.READ_DFX_SYSEVENT * @since 9 */ declare namespace hiSysEvent { @@ -77,7 +76,7 @@ declare namespace hiSysEvent { /** * Definition of written system event information. * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -106,7 +105,7 @@ declare namespace hiSysEvent { /** * Write system event. * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @static * @param {SysEventInfo} info system event information to be written. @@ -122,7 +121,7 @@ declare namespace hiSysEvent { * * @enum {number} * @readonly - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -130,7 +129,7 @@ declare namespace hiSysEvent { /** * whole word match * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -139,7 +138,7 @@ declare namespace hiSysEvent { /** * prefix match * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -148,7 +147,7 @@ declare namespace hiSysEvent { /** * regular match * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -158,7 +157,7 @@ declare namespace hiSysEvent { /** * Definition listener rule for system event information. * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -187,7 +186,7 @@ declare namespace hiSysEvent { /** * Definition wathcer for system event information. * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -200,7 +199,7 @@ declare namespace hiSysEvent { /** * receive system event. * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @param {SysEventInfo} info system event information of receive. * @return {void} return void. @@ -211,7 +210,7 @@ declare namespace hiSysEvent { /** * hisysevent service shutdown. * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @return {void} return void. * @since 9 @@ -224,7 +223,7 @@ declare namespace hiSysEvent { * * @enum {number} * @readonly - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -248,7 +247,7 @@ declare namespace hiSysEvent { /** * Definition event for query system event information * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -267,7 +266,7 @@ declare namespace hiSysEvent { /** * Definition query result handler * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @since 9 */ @@ -275,7 +274,7 @@ declare namespace hiSysEvent { /** * handle query result, the query result will be send in serval times. * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @param {SysEventInfo[]} infos system event information of query result. * @param {number[]} seqs sequeue of infos. @@ -287,7 +286,7 @@ declare namespace hiSysEvent { /** * notify Querier execute query has finished. * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @param {number} reason 0 success, 1 fail. * @param {number} total the total number of query result. @@ -300,7 +299,7 @@ declare namespace hiSysEvent { /** * add watcher to watch system event * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @permission ohos.permission.READ_DFX_SYSEVENT * @param {Watcher} watcher watch system event @@ -312,7 +311,7 @@ declare namespace hiSysEvent { /** * remove watcher * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @permission ohos.permission.READ_DFX_SYSEVENT * @param {Watcher} wathcer watch system event @@ -324,7 +323,7 @@ declare namespace hiSysEvent { /** * query system event * - * @syscap SystemCapability.HiviewDFX.hiSysEvent + * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @permission ohos.permission.READ_DFX_SYSEVENT * @param {QueryArg} queryArg common arguments of query system event diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 7a47e7b3c78875c1cddc6f816403de0c477d8554..0dbd6256dc16364303a7c284f7a57a8e45c7864e 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -59,43 +59,10 @@ declare namespace inputMethod { */ function switchInputMethod(target: InputMethodProperty): Promise; - /** - * Get current input method - * @since 9 - * @return The InputMethodProperty object of the current input method - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly - */ - function getCurrentInputMethod(): InputMethodProperty; - /** * @since 8 */ interface InputMethodSetting { - /** - * List input methods - * @since 9 - * @param enable : - * if true, collect enabled input methods. - * if false, collect disabled input methods. - * @return - - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly - */ - listInputMethod(enable: boolean, callback: AsyncCallback>): void; - - /** - * List input methods - * @since 9 - * @param enable : - * if true, collect enabled input methods. - * if false, collect disabled input methods. - * @return - - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly - */ - listInputMethod(enable: boolean): Promise>; - /** * @since 8 */ diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index 51f2366f931b501d6349d5f4cc04a4f883efb97f..82e19e796c967b3321e0de9287849d0795fbf8d4 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -58,13 +58,6 @@ declare namespace inputMethodEngine { const OPTION_MULTI_LINE: number; const OPTION_NO_FULLSCREEN: number; - /** - * The window styles for inputmethod ability. - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - */ - const WINDOW_TYPE_INPUT_METHOD_FLOAT: number; - function getInputMethodEngine(): InputMethodEngine; function createKeyboardDelegate(): KeyboardDelegate; @@ -113,28 +106,6 @@ declare namespace inputMethodEngine { getEditorAttribute(callback: AsyncCallback): void; getEditorAttribute(): Promise; - - /** - * Move curosr from input method. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @param direction Indicates the distance of cursor to be moved. - * @return - - * @StageModelOnly - */ - moveCursor(direction: number, callback: AsyncCallback): void; - - /** - * Move curosr from input method. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @param direction Indicates the distance of cursor to be moved. - * @return - - * @StageModelOnly - */ - moveCursor(direction: number): Promise; } interface KeyboardDelegate { @@ -164,83 +135,6 @@ declare namespace inputMethodEngine { readonly keyCode: number; readonly keyAction: number; } - - /** - * The extension context class of input method. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly - */ - class InputMethodExtensionContext extends ExtensionContext { - - /** - * Input method extension uses this method to start a specific ability. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @param want Indicates the ability to start. - * @param options Indicates the start options. - * @return - - * @StageModelOnly - */ - startAbility(want: Want, callback: AsyncCallback): void; - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; - startAbility(want: Want, options?: StartOptions): Promise; - - /** - * Destroy the input method extension. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @return - - * @StageModelOnly - */ - terminateSelf(callback: AsyncCallback): void; - terminateSelf(): Promise; - - } - - /** - * The extension ability class of input method. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly - */ - class InputMethodExtensionAbility { - - /** - * Indicates input method extension ability context. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly - */ - context: InputMethodExtensionContext; - - /** - * Called back when a input method extension is started for initialization. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @param want Indicates the want of created service extension. - * @return - - * @StageModelOnly - */ - onCreate(want: Want): void; - - /** - * Called back before a input method extension is destroyed. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @return - - * @StageModelOnly - */ - onDestroy(): void; - - } } export default inputMethodEngine; diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 682810e42a1e44d52631ad591eff152b5944fbd4..6564ea82b2891e761b2a924d57a0166e6420497d 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -518,14 +518,14 @@ declare namespace image { /** * PixelMap expected format. - * @since 8 + * @since 9 * @syscap SystemCapability.Multimedia.Image.Core */ sourcePixelFormat?: PixelMapFormat; /** * PixelMap size. - * @since 8 + * @since 9 * @syscap SystemCapability.Multimedia.Image.Core */ sourceSize?: Size; diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index c64a819c92c42e0996db2ba368eb350cfb4adf68..9d9547f1801a8494716303b86f4e5f98e9f59299 100644 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -1118,7 +1118,7 @@ declare namespace media { /** * select a specified bitrate to playback, only valid for HLS protocal network stream. Defaulty, the * player will select the appropriate bitrate according to the network connection speed. The - * available bitrates list reported by {@link #on('availablebitratesCollected')}. Set it to select + * available bitrates list reported by {@link #on('availableBitratesCollect')}. Set it to select * a specified bitrate. If the specified bitrate is not in the list of available bitrates, the player * will select the minimal and closest one from the available bitrates list. * @since 9 @@ -1131,7 +1131,7 @@ declare namespace media { /** * select a specified bitrate to playback, only valid for HLS protocal network stream. Defaulty, the * player will select the appropriate bitrate according to the network connection speed. The - * available bitrates list reported by {@link #on('availablebitratesCollected')}. Set it to select + * available bitrates list reported by {@link #on('availableBitratesCollect')}. Set it to select * a specified bitrate. If the specified bitrate is not in the list of available bitrates, the player * will select the minimal and closest one from the available bitrates list. * @since 9 @@ -1194,7 +1194,7 @@ declare namespace media { * @param type Type of the playback event to listen for. * @param callback Callback used to listen for the playback event return available bitrates. */ - on(type: 'availableBitratesCollected', callback: (bitrates: Array) => void): void + on(type: 'availableBitratesCollect', callback: (bitrates: Array) => void): void; /** * Listens for playback error events. @@ -1229,7 +1229,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoPlayer */ - VIDEO_SCALE_TYPE_FIT_CROP + VIDEO_SCALE_TYPE_FIT_CROP = 1, } /** diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index 237ac9e7896e5482c8579cf74b494f94edfe236d..1e88f91157c86dc99a2bf1900c955b8ad158a04f 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -15,7 +15,7 @@ /** * Resize direction for the window. - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ enum ResizeDirection{ @@ -30,7 +30,7 @@ } /** * Enumerates the string value match pattern. - * + * @syscap SystemCapability.Test.UiTest * @since 8 */ enum MatchPattern{ @@ -66,7 +66,7 @@ /** * Describes the window mode of the tested window - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ enum WindowMode{ @@ -78,7 +78,7 @@ /** * Represents the point on the device screen. - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ declare interface Point { @@ -88,7 +88,7 @@ declare interface Point { /** * Represents the rectangle area on the device screen. - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ declare interface Rect { @@ -100,7 +100,7 @@ declare interface Rect { /** * Represents filer condition to get the window . - * + * @syscap SystemCapability.Test.UiTest * @since 9 */ declare interface WindowFilter { diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 5660d49567e4b9648f41aa5cc0a54619438703eb..28777bbadca8686283814ca1144ea5eb43a7c596 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -15,8 +15,8 @@ import { AsyncCallback , Callback} from './basic'; import Want from './@ohos.application.want'; -import { WantAgentInfo } from './wantAgent/wantAgentInfo'; -import { TriggerInfo } from './wantAgent/triggerInfo'; +import { WantAgentInfo as _WantAgentInfo } from './wantAgent/wantAgentInfo'; +import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; /** * Provide the method obtain trigger, cancel, and compare and to obtain @@ -229,6 +229,24 @@ declare namespace wantAgent { */ extraInfo?: {[key: string]: any}; } + + /** + * Provides the information required for triggering a WantAgent. + * + * @name TriggerInfo + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type TriggerInfo = _TriggerInfo + + /** + * Provides the information required for triggering a WantAgent. + * + * @name WantAgentInfo + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type WantAgentInfo = _WantAgentInfo } /** diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 21ad360b0075b96d9e2d898de7b3d453a4eb83c9..0ed2e6f197cffce33600823716ab446334f327ed 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -142,7 +142,9 @@ declare namespace wifi { *

This method adds one configuration at a time. After this configuration is added, * your device will determine whether to connect to the hotspot. * + * @param config - candidate config. * @return Returns {@code networkId} if the configuration is added; returns {@code -1} otherwise. + * * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO @@ -156,13 +158,15 @@ declare namespace wifi { * *

This method removes one configuration at a time. * + * @param networkId - Network ID which will be removed. + * @return Returns {@code true} if the candidate hotspot configuration is removed, returns {@code false} otherwise. + * * @since 9 - * @throws {TypedError | Error} when failed to remove the hotspot configuration. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO */ - function removeCandidateConfig(networkId: number): Promise; - function removeCandidateConfig(networkId: number, callback: AsyncCallback): void; + function removeCandidateConfig(networkId: number): Promise; + function removeCandidateConfig(networkId: number, callback: AsyncCallback): void; /** * Obtains the list of all existing candidate Wi-Fi configurations which added by ourself. @@ -170,6 +174,7 @@ declare namespace wifi { *

You can obtain only the Wi-Fi configurations you created on your own application. * * @return Returns the list of all existing Wi-Fi configurations you created on your application. + * * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION @@ -182,13 +187,15 @@ declare namespace wifi { * *

This method connect to a configuration at a time. * - * @param {number} networkId - Network ID which will be connected. - * @throws {TypedError | Error} when failed connect to the hotspot configuration + * @param networkId - Network ID which will be connected. + * Returns {@code true} if the operation is successful, returns {@code false} otherwise. The connect result + * will be indicated by the call back function of wifi connection change. + * * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO */ - function connectToCandidateConfig(networkId: number): void; + function connectToCandidateConfig(networkId: number): boolean; /** * Connects to Wi-Fi network. @@ -1070,8 +1077,13 @@ declare namespace wifi { /* @systemapi */ staticIp: IpConfig; - /** EAP config info */ - /* @systemapi */ + /** + * EAP config info. + * + * @since 9 + * @systemapi + * @syscap SystemCapability.Communication.WiFi.STA + */ eapConfig: WifiEapConfig; } @@ -1149,13 +1161,28 @@ declare namespace wifi { /** Channel width */ channelWidth: number; - /** Center frequency */ + /** + * Center frequency 0. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ centerFrequency0: number; - /** Center frequency */ + /** + * Center frequency 1. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ centerFrequency1: number; - /** Information elements */ + /** + * Information elements. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ infoElems: Array; /** Time stamp */ @@ -1184,19 +1211,44 @@ declare namespace wifi { /** Simultaneous Authentication of Equals (SAE) */ WIFI_SEC_TYPE_SAE = 4, - /** EAP authentication */ + /** + * EAP authentication. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_EAP = 5, - /** SUITE_B_192 192 bit level */ + /** + * SUITE_B_192 192 bit level. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_EAP_SUITE_B = 6, - /** Opportunististic Wireless Encryption */ + /** + * Opportunististic Wireless Encryption. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_OWE = 7, - /** WAPI certificate to be specified */ + /** + * WAPI certificate to be specified. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_WAPI_CERT = 8, - /** WAPI pre-shared key to be specified */ + /** + * WAPI pre-shared key to be specified. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ WIFI_SEC_TYPE_WAPI_PSK = 9, } @@ -1243,7 +1295,12 @@ declare namespace wifi { /* @systemapi */ snr: number; - /** Type of macAddress: 0 - real mac, 1 - random mac. */ + /** + * Type of macAddress: 0 - real mac, 1 - random mac. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ macType: number; /** The Wi-Fi MAC address of a device. */ diff --git a/api/ability/want.d.ts b/api/ability/want.d.ts index 7a0de81e061428530ad5e4698035175a61b32c56..51e6579928be2ea6d566a121d3e9dcebabba2b50 100644 --- a/api/ability/want.d.ts +++ b/api/ability/want.d.ts @@ -19,6 +19,7 @@ * @since 6 * @syscap SystemCapability.Ability.AbilityBase * @permission N/A + * @deprecated since 9 */ export declare interface Want { /** diff --git a/api/application/ExtensionContext.d.ts b/api/application/ExtensionContext.d.ts index c265080057b90ac12fea7b381c2f739a90cfa5af..3e20d41b8e4306a128b5142a89b509a5067cdcb1 100644 --- a/api/application/ExtensionContext.d.ts +++ b/api/application/ExtensionContext.d.ts @@ -16,6 +16,7 @@ import { HapModuleInfo } from "../bundle/hapModuleInfo"; import { Configuration } from '../@ohos.application.Configuration'; import Context from "./Context"; +import { ExtensionAbilityInfo } from "../bundle/extensionAbilityInfo"; /** * The context of an extension. It allows access to extension-specific resources. diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index ee956cba6d1ba2249a270a3d942be694188814e3..87bfcc90b70990855319c1b5a55a34e09cfbaad7 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -18,7 +18,6 @@ import { ConnectOptions } from "../ability/connectOptions"; import ExtensionContext from "./ExtensionContext"; import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.application.StartOptions"; -import { ExtensionAbilityInfo } from "../bundle/extensionAbilityInfo"; /** * The context of service extension. It allows access to diff --git a/api/bundle/dispatchInfo.d.ts b/api/bundle/dispatchInfo.d.ts index 641b8b170d10edf8d3229d74af6b3d7da7c91604..2538eb4c831ea6986e6501eec53294e77820b8ba 100644 --- a/api/bundle/dispatchInfo.d.ts +++ b/api/bundle/dispatchInfo.d.ts @@ -25,7 +25,7 @@ * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ - readonly verison: string; + readonly version: string; /** * @default Indicates the free install interface version number diff --git a/build-tools/delete_systemapi_plugin.js b/build-tools/delete_systemapi_plugin.js index fcf3223a4f6ff5f7dfa3e01d31cb178d5a61c108..47a4ed31dfc9fda44aac25bbec94251a5b27109a 100644 --- a/build-tools/delete_systemapi_plugin.js +++ b/build-tools/delete_systemapi_plugin.js @@ -80,6 +80,115 @@ function writeFile(url, data, option) { } }) } + +function formatImportDeclaration(url) { + return (context) => { + const allIdentifierSet = new Set([]); + let copyrightMessage = ''; + let isCopyrightDeleted = false; + return (node) => { + sourceFile = node; + collectAllIdentifier(node); + node = formatAllNodes(node); + if (!isEmptyFile(node)) { + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + let result = printer.printNode(ts.EmitHint.Unspecified, node, sourceFile); + if (isCopyrightDeleted) { + result = copyrightMessage + '\n' + result; + } + writeFile(url, result); + } + return node; + } + function collectAllIdentifier(node) { + if (ts.isSourceFile(node) && node.statements) { + node.statements.forEach(stat => { + if (!ts.isImportDeclaration(stat)) { + ts.visitEachChild(stat, collectAllNodes, context); + } + }); + } + } + function collectAllNodes(node) { + if (ts.isIdentifier(node)) { + allIdentifierSet.add(node.escapedText.toString()); + } + return ts.visitEachChild(node, collectAllNodes, context); + } + function formatAllNodes(node) { + if (ts.isSourceFile(node) && node.statements) { + const newStatements = []; + node.statements.forEach(statement => { + if (ts.isImportDeclaration(statement)) { + const clauseSet = new Set([]); + if (statement.importClause && ts.isImportClause(statement.importClause)) { + const clauseNode = statement.importClause; + if (!clauseNode.namedBindings && clauseNode.name && ts.isIdentifier(clauseNode.name)) { + clauseSet.add(clauseNode.name.escapedText.toString()); + } else if (clauseNode.namedBindings && clauseNode.namedBindings.elements) { + clauseNode.namedBindings.elements.forEach(ele => { + if (ele.name && ts.isIdentifier(ele.name)) { + clauseSet.add(ele.name.escapedText.toString()); + } + }); + } + } + const importSpecifier = statement.moduleSpecifier.getText(); + const importSpecifierRealPath = path.resolve(url, `../${importSpecifier.replace(/[\'\"]/g, '')}.d.ts`); + if (fs.existsSync(importSpecifierRealPath) && clauseSet.size > 0) { + const clasueCheckList = []; + let exsitClauseSet = new Set([]); + for (const clause of clauseSet) { + if (allIdentifierSet.has(clause)) { + exsitClauseSet.add(clause); + clasueCheckList.push('exist'); + } else { + clasueCheckList.push('non-exist'); + } + } + let hasExsitStatus = false; + let hasNonExsitStatus = false; + clasueCheckList.forEach(ele => { + if (ele === 'exist') { + hasExsitStatus = true; + } else { + hasNonExsitStatus = true; + } + }); + if (hasExsitStatus) { + if (hasNonExsitStatus) { + const newSpecifiers = []; + statement.importClause.namedBindings.elements.forEach(element => { + if (exsitClauseSet.has(element.name.escapedText.toString())) { + newSpecifiers.push(element); + } + }); + statement.importClause.namedBindings = ts.factory.updateNamedImports( + statement.importClause.namedBindings, newSpecifiers); + } + newStatements.push(statement); + } else if (hasCopyright(statement)) { + copyrightMessage = node.getFullText().replace(node.getText(), ''); + isCopyrightDeleted = true; + } + } else if (hasCopyright(statement)) { + copyrightMessage = node.getFullText().replace(node.getText(), ''); + isCopyrightDeleted = true; + } + } else { + newStatements.push(statement); + } + }); + node = ts.factory.updateSourceFile(node, newStatements); + } + return node; + } + function hasCopyright(node) { + return /http\:\/\/www\.apache\.org\/licenses\/LICENSE\-2\.0/g.test(node.getFullText().replace(node.getText(), '')); + } + } +} + function deleteSystemApi(url) { return (context) => { return (node) => { @@ -89,7 +198,15 @@ function deleteSystemApi(url) { if (!isEmptyFile(node)) { const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); const result = printer.printNode(ts.EmitHint.Unspecified, node, sourceFile); - writeFile(url, result); + const fileName = path.basename(url).replace(/.d.ts/g, '.ts'); + ts.transpileModule(result, { + compilerOptions: { + "target": ts.ScriptTarget.ES2017 + }, + fileName: fileName, + transformers: { before: [formatImportDeclaration(url)] } + }); + // writeFile(url, result); } return node; }