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..4105a105f3ad70c3de236c6527084f227e1f0aba 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. 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.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 4638fdf1393334c3b0610c3e3ae6b87082f1de90..109bd803f56e15295baed2d2383c769baac7872f 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -18,7 +18,7 @@ import { Callback } from './basic'; import Want from './@ohos.application.want'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { AbilityResult } from './ability/abilityResult'; -import { Context } from './app/context'; +import { Context as _Context } from './app/context'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; import window from './@ohos.window'; @@ -213,5 +213,17 @@ declare namespace featureAbility { TYPE_DELETE = 3, TYPE_ASSERT = 4, } + + /** + * The context of an ability or an application. It allows access to + * application-specific resources, request and verification permissions. + * Can only be obtained through the ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import abilityManager from 'app/context' + * @FAModelOnly + */ + export type Context = _Context } export default featureAbility; diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index 927274ef63afe443f26b5b6e43646d0bbdadd70e..652bdda1fc2cd4f868fd4233aea773d4963d5f33 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -416,6 +416,7 @@ declare namespace appAccount { /** * Checks whether a paticular account has all specified labels. * + * @since 9 * @param name Indicates the account name. * @param owner Indicates the account owner. * @param labels Indicates an array of labels to check. @@ -500,16 +501,22 @@ declare namespace appAccount { interface OAuthTokenInfo { /** * The authentication type. + * + * @since 8 */ authType: string; /** * The token value. + * + * @since 8 */ token: string; /** * The account to which the token belongs. + * + * @since 9 */ account?: AppAccountInfo; } @@ -608,18 +615,95 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount */ enum Constants { + /** + * Indicates the action for adding account implicitly. + * + * @since 8 + */ ACTION_ADD_ACCOUNT_IMPLICITLY = "addAccountImplicitly", + + /** + * Indicates the action for authenticating. + * + * @since 8 + */ ACTION_AUTHENTICATE = "authenticate", + + /** + * Indicates the key of name. + * + * @since 8 + */ KEY_NAME = "name", + + /** + * Indicates the key of owner. + * + * @since 8 + */ KEY_OWNER = "owner", + + /** + * Indicates the key of token. + * + * @since 8 + */ KEY_TOKEN = "token", + + /** + * Indicates the key of action. + * + * @since 8 + */ KEY_ACTION = "action", + + /** + * Indicates the key of authentiaction type. + * + * @since 8 + */ KEY_AUTH_TYPE = "authType", + + /** + * Indicates the key of session id. + * + * @since 8 + */ KEY_SESSION_ID = "sessionId", + + /** + * Indicates the key of caller pid. + * + * @since 8 + */ KEY_CALLER_PID = "callerPid", + + /** + * Indicates the key of caller uid. + * + * @since 8 + */ KEY_CALLER_UID = "callerUid", + + /** + * Indicates the key of caller bundle name. + * + * @since 8 + */ KEY_CALLER_BUNDLE_NAME = "callerBundleName", + + /** + * Indicates the key of required labels. + * + * @since 9 + */ KEY_REQUIRED_LABELS = "requiredLabels", + + /** + * Indicates the key of boolean result. + * + * @since 9 + */ KEY_BOOLEAN_RESULT = "booleanResult" } diff --git a/api/@ohos.application.WindowExtensionAbility.d.ts b/api/@ohos.application.WindowExtensionAbility.d.ts index 6d24e6bbdf898e4f01b0e1f876acdd2c6d0b2ad4..5714a693ff3818022ee8f5203ce97d050d2ef335 100644 --- a/api/@ohos.application.WindowExtensionAbility.d.ts +++ b/api/@ohos.application.WindowExtensionAbility.d.ts @@ -21,7 +21,7 @@ import Want from './@ohos.application.Want'; * class of window extension ability. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @StageModelOnly */ @@ -30,7 +30,7 @@ export default class WindowExtensionAbility { * Indicates window extension ability context. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @StageModelOnly */ @@ -40,19 +40,18 @@ export default class WindowExtensionAbility { * Called back when a window extension is first connected to an ability. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @param want Indicates connection information about the Window ability. * @systemapi hide for inner use. - * @return Returns the proxy of the Window ability. * @StageModelOnly */ - onConnect(want: Want): rpc.RemoteObject; + onConnect(want: Want): void; /** * Called back when all abilities connected to a window extension are disconnected. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @param want Indicates disconnection information about the window extension. * @systemapi hide for inner use. * @return - @@ -64,7 +63,7 @@ export default class WindowExtensionAbility { * Called back when window is created. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @return - * @StageModelOnly diff --git a/api/@ohos.application.context.d.ts b/api/@ohos.application.context.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..b08a47da8082bf137d20573fee0e2a719f10a49f --- /dev/null +++ b/api/@ohos.application.context.d.ts @@ -0,0 +1,99 @@ +/* + * 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 * as _AbilityContext from './application/AbilityContext'; +import * as _AbilityStageContext from './application/AbilityStageContext'; +import * as _ApplicationContext from './application/ApplicationContext'; +import * as _BaseContext from './application/BaseContext'; +import * as _Context from './application/Context'; +import * as _ExtensionContext from './application/ExtensionContext'; +import * as _FormExtensionContext from './application/FormExtensionContext'; + +/** + * The context of an application. It allows access to application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ +declare namespace context { + + /** + * The context of an ability. It allows access to ability-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export type AbilityContext = _AbilityContext.default + + /** + * The context of an abilityStage. It allows access to abilityStage-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export type AbilityStageContext = _AbilityStageContext.default + + /** + * The context of an application. It allows access to application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export type ApplicationContext = _ApplicationContext.default + + /** + * The base context of 'app.Context' for FA Mode or + * 'application.Context' for Stage Mode. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type BaseContext = _BaseContext.default + + /** + * The base context of an ability or an application. It allows access to + * application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export type Context = _Context.default + + /** + * The context of an extension. It allows access to extension-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export type ExtensionContext = _ExtensionContext.default + + /** + * The context of form extension. It allows access to + * formExtension-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @StageModelOnly + */ + export type FormExtensionContext = _FormExtensionContext.default +} + +export default context; \ No newline at end of file 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.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 71837d5297500dc992c6a6e7b079636e8158d48f..07b0460791fdae4e043d12db87568410b44bfe39 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -14,7 +14,7 @@ */ import {AsyncCallback, Callback} from './basic'; -import { ResultSet } from './data/rdb/resultSet'; +import { ResultSet as _ResultSet } from './data/rdb/resultSet'; import Context from "./application/BaseContext"; import dataSharePredicates from './@ohos.data.dataSharePredicates'; @@ -709,6 +709,8 @@ declare namespace rdb { */ notIn(field: string, value: Array): RdbPredicates; } + + export type ResultSet = _ResultSet } export default rdb; diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts index 1683d8d0fa3340de026067d60b17d179a2c913a6..db9a78797696e8c1c9ec5c45aadc24de1f15225e 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterpriseDeviceManager.d.ts @@ -59,7 +59,8 @@ declare namespace enterpriseDeviceManager { * @return {@code true} if enables administrator success. * @permission ohos.permission.MANAGE_ADMIN */ - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; /** @@ -74,7 +75,8 @@ declare namespace enterpriseDeviceManager { * @return {@code true} if disables administrator success. * @permission ohos.permission.MANAGE_ADMIN */ - function disableAdmin(admin: Want, userId?: number, callback: AsyncCallback): void; + function disableAdmin(admin: Want, callback: AsyncCallback): void; + function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; function disableAdmin(admin: Want, userId?: number): Promise; /** @@ -99,7 +101,8 @@ declare namespace enterpriseDeviceManager { * @param userId Indicates the user ID or do not pass user ID. * @return {@code true} if the administrator is enabled. */ - function isAdminEnabled(admin: Want, userId?: number, callback: AsyncCallback): void; + function isAdminEnabled(admin: Want, callback: AsyncCallback): void; + function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback): void; function isAdminEnabled(admin: Want, userId?: number): Promise; /** 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.i18n.d.ts b/api/@ohos.i18n.d.ts index 3693f83823e3db93ccb2b912b3f5bbe2b561d13b..d7dafe4aed7e6a6544fe56bf9a16bd6c004239e8 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -246,7 +246,7 @@ export class PhoneNumberFormat { * @return Returns a string represents phone number's location. * @since 9 */ - static getLocationName(number: string, locale: string): string; + getLocationName(number: string, locale: string): string; } /** diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 7b44188356ded6439fc192a58a6b6991c4363fcd..18c9ad1114e260e8815a209e9f199aff24ac1b89 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -74,72 +74,6 @@ declare namespace camera { CAMERA_STATUS_UNAVAILABLE } - /** - * Profile for camera streams. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface Profile { - /** - * Camera format. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly format: CameraFormat; - /** - * Picture size. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly size: Size; - } - - /** - * Video profile. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface VideoProfile extends Profile { - /** - * Frame rate in unit fps (frames per second). - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly frameRate: Array; - } - - /** - * Camera output capability. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraOutputCapability { - /** - * Preview profiles. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly previewProfiles: Array; - /** - * Photo profiles. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly photoProfiles: Array; - /** - * Video profiles. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly videoProfiles: Array; - /** - * All the supported metadata Object Types. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly supportedMetadataObjectTypes: Array; - } - /** * Camera manager object. * @since 9 @@ -147,58 +81,40 @@ declare namespace camera { */ interface CameraManager { /** - * Gets supported camera descriptions. + * Gets all camera descriptions. * @param callback Callback used to return the array of supported cameras. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getSupportedCameras(callback: AsyncCallback>): void; + getCameras(callback: AsyncCallback>): void; /** - * Gets supported camera descriptions. + * Gets all camera descriptions. * @return Promise used to return an array of supported cameras. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getSupportedCameras(): Promise>; - - /** - * Gets supported output capability for specific camera. - * @param camera Camera device. - * @param callback Callback used to return the camera output capability. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void; - - /** - * Gets supported output capability for specific camera. - * @param camera Camera device. - * @return Promise used to return the camera output capability. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getSupportedOutputCapability(camera: CameraDevice): Promise; + getCameras(): Promise>; /** - * Creates a CameraInput instance by camera. - * @param camera Camera device used to create the instance. + * Creates a CameraInput instance by camera id. + * @param cameraId Camera ID used to create the instance. * @param callback Callback used to return the CameraInput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core * @permission ohos.permission.CAMERA */ - createCameraInput(camera: CameraDevice, callback: AsyncCallback): void; + createCameraInput(cameraId: string, callback: AsyncCallback): void; /** - * Creates a CameraInput instance by camera. - * @param camera Camera device used to create the instance. + * Creates a CameraInput instance by camera id. + * @param cameraId Camera ID used to create the instance. * @return Promise used to return the CameraInput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core * @permission ohos.permission.CAMERA */ - createCameraInput(camera: CameraDevice): Promise; + createCameraInput(cameraId: string): Promise; /** * Creates a CameraInput instance by camera position and type. @@ -222,118 +138,6 @@ declare namespace camera { */ createCameraInput(position: CameraPosition, type: CameraType): Promise; - /** - * Creates a PreviewOutput instance. - * @param profile Preview output profile. - * @param surfaceId Surface object id used in camera photo output. - * @param callback Callback used to return the PreviewOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void; - - /** - * Creates a PreviewOutput instance. - * @param profile Preview output profile. - * @param surfaceId Surface object id used in camera photo output. - * @return Promise used to return the PreviewOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createPreviewOutput(profile: Profile, surfaceId: string): Promise; - - /** - * Creates a deferred PreviewOutput instance. - * @param profile Preview output profile. - * @param callback Callback used to return the PreviewOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createDeferredPreviewOutput(profile: Profile, callback: AsyncCallback): void; - - /** - * Creates a deferred PreviewOutput instance. - * @param profile Preview output profile. - * @return Promise used to return the PreviewOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createDeferredPreviewOutput(profile: Profile): Promise; - - /** - * Creates a PhotoOutput instance. - * @param profile Photo output profile. - * @param surfaceId Surface object id used in camera photo output. - * @param callback Callback used to return the PhotoOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void; - - /** - * Creates a PhotoOutput instance. - * @param profile Photo output profile. - * @param surfaceId Surface object id used in camera photo output. - * @return Promise used to return the PhotoOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createPhotoOutput(profile: Profile, surfaceId: string): Promise; - - /** - * Creates a VideoOutput instance. - * @param profile Video profile. - * @param surfaceId Surface object id used in camera video output. - * @param callback Callback used to return the VideoOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void; - - /** - * Creates a VideoOutput instance. - * @param profile Video profile. - * @param surfaceId Surface object id used in camera video output. - * @return Promise used to return the VideoOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createVideoOutput(profile: VideoProfile, surfaceId: string): Promise; - - /** - * Creates a MetadataOutput instance. - * @param metadataObjectTypes Array of MetadataObjectType. - * @param callback Callback used to return the MetadataOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void; - - /** - * Creates a MetadataOutput instance. - * @param metadataObjectTypes Array of MetadataObjectType. - * @return Promise used to return the MetadataOutput instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createMetadataOutput(metadataObjectTypes: Array): Promise; - - /** - * Gets a CaptureSession instance. - * @param callback Callback used to return the CaptureSession instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createCaptureSession(callback: AsyncCallback): void; - - /** - * Gets a CaptureSession instance. - * @return Promise used to return the CaptureSession instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createCaptureSession(): Promise; - /** * Subscribes camera status change event callback. * @param type Event type. @@ -355,7 +159,7 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - camera: CameraDevice; + camera: Camera; /** * Current camera status. * @since 9 @@ -461,11 +265,11 @@ declare namespace camera { } /** - * Camera device object. + * Camera object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface CameraDevice { + interface Camera { /** * Camera id attribute. * @since 9 @@ -513,210 +317,284 @@ declare namespace camera { } /** - * Point parameter. + * Camera input object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface Point { + interface CameraInput { /** - * x co-ordinate + * Gets camera id. + * @param callback Callback used to return the camera ID. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - x: number; + getCameraId(callback: AsyncCallback): void; + /** - * y co-ordinate + * Gets camera id. + * @return Promise used to return the camera ID. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - y: number; - } + getCameraId(): Promise; - /** - * Camera input object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraInput { /** - * Open camera. - * @param callback Callback used to return the result. + * Check if device has flash light. + * @param callback Callback used to return the flash light support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - open(callback: AsyncCallback): void; + hasFlash(callback: AsyncCallback): void; /** - * Open camera. - * @return Promise used to return the result. + * Check if device has flash light. + * @return Promise used to return the flash light support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - open(): Promise; + hasFlash(): Promise; /** - * Close camera. - * @param callback Callback used to return the result. + * Checks whether a specified flash mode is supported. + * @param flashMode Flash mode. + * @param callback Callback used to return the flash light support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - close(callback: AsyncCallback): void; + isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void; /** - * Close camera. - * @return Promise used to return the result. + * Checks whether a specified flash mode is supported. + * @param flashMode Flash mode + * @return Promise used to return flash mode support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - close(): Promise; + isFlashModeSupported(flashMode: FlashMode): Promise; /** - * Releases instance. - * @param callback Callback used to return the result. + * Gets current flash mode. + * @param callback Callback used to return the current flash mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(callback: AsyncCallback): void; + getFlashMode(callback: AsyncCallback): void; /** - * Releases instance. - * @return Promise used to return the result. + * Gets current flash mode. + * @return Promise used to return the flash mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(): Promise; + getFlashMode(): Promise; /** - * Subscribes error event callback. - * @param type Event type. - * @param camera Camera device. - * @param callback Callback used to get the camera input errors. + * Sets flash mode. + * @param flashMode Target flash mode. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; - } + setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void; - /** - * Enum for CameraInput error code. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraInputErrorCode { /** - * Unknown error. + * Sets flash mode. + * @param flashMode Target flash mode. + * @return Promise used to return the result. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_UNKNOWN = -1, + setFlashMode(flashMode: FlashMode): Promise; + /** - * No permission. + * Checks whether a specified focus mode is supported. + * @param afMode Focus mode. + * @param callback Callback used to return the device focus support status. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_NO_PERMISSION, + isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void; + /** - * Camera device preempted. + * Checks whether a specified focus mode is supported. + * @param afMode Focus mode. + * @return Promise used to return the focus mode support status. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_DEVICE_PREEMPTED, + isFocusModeSupported(afMode: FocusMode): Promise; + /** - * Camera device disconnected. + * Gets current focus mode. + * @param callback Callback used to return the current focus mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_DEVICE_DISCONNECTED, + getFocusMode(callback: AsyncCallback): void; + /** - * Camera device in use. + * Gets current focus mode. + * @return Promise used to return the focus mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_DEVICE_IN_USE, + getFocusMode(): Promise; + /** - * Driver error. + * Sets focus mode. + * @param afMode Target focus mode. + * @param callback Callback used to return the result. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - ERROR_DRIVER_ERROR, - } - - /** - * Camera input error object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraInputError extends Error { - code: CameraInputErrorCode; - } + setFocusMode(afMode: FocusMode, callback: AsyncCallback): void; - /** - * Enum for camera format type. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraFormat { /** - * YUV 420 Format. + * Sets focus mode. + * @param afMode Target focus mode. + * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_FORMAT_YUV_420_SP = 1003, + setFocusMode(afMode: FocusMode): Promise; /** - * JPEG Format. + * Gets all supported zoom ratio range. + * @param callback Callback used to return the zoom ratio range. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_FORMAT_JPEG = 2000 - } + getZoomRatioRange(callback: AsyncCallback>): void; - /** - * Enum for flash mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum FlashMode { /** - * Close mode. + * Gets all supported zoom ratio range. + * @return Promise used to return the zoom ratio range. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_CLOSE = 0, + getZoomRatioRange(): Promise>; + /** - * Open mode. + * Gets zoom ratio. + * @param callback Callback used to return the current zoom ratio value. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_OPEN, + getZoomRatio(callback: AsyncCallback): void; + /** - * Auto mode. + * Gets zoom ratio. + * @return Promise used to return the zoom ratio value. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_AUTO, + getZoomRatio(): Promise; + /** - * Always open mode. + * Sets zoom ratio. + * @param zoomRatio Target zoom ratio. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_ALWAYS_OPEN - } + setZoomRatio(zoomRatio: number, callback: AsyncCallback): void; + + /** + * Sets zoom ratio. + * @param zoomRatio Target zoom ratio. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + setZoomRatio(zoomRatio: number): Promise; + + /** + * Releases instance. + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + release(callback: AsyncCallback): void; + + /** + * Releases instance. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + release(): Promise; + + /** + * Subscribes focus status change event callback. + * @param type Event type. + * @param callback Callback used to get the focus state change. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Subscribes error event callback. + * @param type Event type. + * @param callback Callback used to get the camera input errors. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + on(type: 'error', callback: ErrorCallback): void; + } + + /** + * Enum for CameraInput error code. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + enum CameraInputErrorCode { + /** + * Unknown error. + * @since 9 + */ + ERROR_UNKNOWN = -1 + } + + /** + * Camera input error object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface CameraInputError extends Error { + code: CameraInputErrorCode; + } /** - * Enum for exposure mode. + * Enum for flash mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - enum ExposureMode { + enum FlashMode { + /** + * Close mode. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + FLASH_MODE_CLOSE = 0, /** - * Lock exposure mode. + * Open mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - EXPOSURE_MODE_LOCKED = 0, + FLASH_MODE_OPEN, /** - * Auto exposure mode. + * Auto mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - EXPOSURE_MODE_AUTO, - /** - * Continuous automatic exposure. + FLASH_MODE_AUTO, + /** + * Always open mode. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - EXPOSURE_MODE_CONTINUOUS_AUTO + FLASH_MODE_ALWAYS_OPEN } /** @@ -778,59 +656,22 @@ declare namespace camera { } /** - * Enum for exposure state. + * Gets a CaptureSession instance. + * @param context Current application context. + * @param callback Callback used to return the CaptureSession instance. * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core */ - enum ExposureState { - /** - * Scan state. - * @since 8 - */ - EXPOSURE_STATE_SCAN = 0, - /** - * Converged state. - * @since 8 - */ - EXPOSURE_STATE_CONVERGED - } + function createCaptureSession(context: Context, callback: AsyncCallback): void; /** - * Enum for video stabilization mode. + * Gets a CaptureSession instance. + * @param context Current application context. + * @return Promise used to return the CaptureSession instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - enum VideoStabilizationMode { - /** - * Turn off video stablization. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - OFF = 0, - /** - * LOW mode provides basic stabilization effect. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - LOW, - /** - * MIDDLE mode means algorithms can achieve better effects than LOW mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - MIDDLE, - /** - * HIGH mode means algorithms can achieve better effects than MIDDLE mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - HIGH, - /** - * Camera HDF can select mode automatically. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - AUTO - } + function createCaptureSession(context: Context): Promise; /** * Capture session object. @@ -871,176 +712,180 @@ declare namespace camera { commitConfig(): Promise; /** - * Check whether the camera input can be added. + * Adds a camera input. * @param cameraInput Target camera input to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - canAddInput(cameraInput: CameraInput, callback: AsyncCallback): void; + addInput(cameraInput: CameraInput, callback: AsyncCallback): void; /** - * Check whether the camera input can be added. + * Adds a camera input. * @param cameraInput Target camera input to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - canAddInput(cameraInput: CameraInput): Promise; + addInput(cameraInput: CameraInput): Promise; /** - * Adds a camera input. - * @param cameraInput Target camera input to add. + * Adds a camera preview output. + * @param previewOutput Target camera preview output to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addInput(cameraInput: CameraInput, callback: AsyncCallback): void; + addOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void; /** - * Adds a camera input. - * @param cameraInput Target camera input to add. + * Adds a camera preview output. + * @param previewOutput Target camera preview output to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addInput(cameraInput: CameraInput): Promise; + addOutput(previewOutput: PreviewOutput): Promise; /** - * Removes a camera input. - * @param cameraInput Target camera input to remove. + * Adds a camera photo output. + * @param photoOutput Target camera photo output to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeInput(cameraInput: CameraInput, callback: AsyncCallback): void; + addOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void; /** - * Removes a camera input. - * @param cameraInput Target camera input to remove. + * Adds a camera photo output. + * @param photoOutput Target camera photo output to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeInput(cameraInput: CameraInput): Promise; + addOutput(photoOutput: PhotoOutput): Promise; /** - * Check whether the camera output can be added. - * @param cameraOutput Target camera output to add. + * Adds a camera video output. + * @param videoOutput Target camera video output to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - canAddOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; + addOutput(videoOutput: VideoOutput, callback: AsyncCallback): void; /** - * Check whether the camera output can be added. - * @param cameraInput Target camera output to add. + * Adds a camera video output. + * @param videoOutput Target camera video output to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - canAddOutput(cameraOutput: CameraOutput): Promise; + addOutput(videoOutput: VideoOutput): Promise; /** - * Adds a camera output. - * @param cameraOutput Target camera output to add. + * Removes a camera input. + * @param cameraInput Target camera input to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; + removeInput(cameraInput: CameraInput, callback: AsyncCallback): void; /** - * Adds a camera output. - * @param cameraOutput Target camera output to add. + * Removes a camera input. + * @param cameraInput Target camera input to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addOutput(cameraOutput: CameraOutput): Promise; + removeInput(cameraInput: CameraInput): Promise; /** - * Removes a camera output. - * @param previewOutput Target camera output to remove. + * Removes a camera preview output. + * @param previewOutput Target camera preview output to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; + removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void; /** - * Removes a camera output. - * @param previewOutput Target camera output to remove. + * Removes a camera preview output. + * @param previewOutput Target camera preview output to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(cameraOutput: CameraOutput): Promise; + removeOutput(previewOutput: PreviewOutput): Promise; /** - * Starts capture session. + * Removes a camera photo output. + * @param photoOutput Target camera photo output to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - start(callback: AsyncCallback): void; + removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void; /** - * Starts capture session. + * Removes a camera photo output. + * @param photoOutput Target camera photo output to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - start(): Promise; + removeOutput(photoOutput: PhotoOutput): Promise; /** - * Stops capture session. + * Removes a camera video output. + * @param videoOutput Target camera video output to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(callback: AsyncCallback): void; + removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void; /** - * Stops capture session. + * Removes a camera video output. + * @param videoOutput Target camera video output to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(): Promise; + removeOutput(videoOutput: VideoOutput): Promise; /** - * Lock the session for exclusive control. + * Starts capture session. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - lockForControl(callback: AsyncCallback): void; + start(callback: AsyncCallback): void; /** - * Lock the session for exclusive control. + * Starts capture session. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - lockForControl(): Promise; + start(): Promise; /** - * Unlock the session after exclusive control. + * Stops capture session. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - unlockForControl(callback: AsyncCallback): void; + stop(callback: AsyncCallback): void; /** - * Unlock the session after exclusive control. + * Stops capture session. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - unlockForControl(): Promise; + stop(): Promise; /** * Release capture session instance. @@ -1059,551 +904,72 @@ declare namespace camera { release(): Promise; /** - * Check if device has flash light. - * @param callback Callback used to return the flash light support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - hasFlash(callback: AsyncCallback): void; - - /** - * Check if device has flash light. - * @return Promise used to return the flash light support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - hasFlash(): Promise; - - /** - * Checks whether a specified flash mode is supported. - * @param flashMode Flash mode. - * @param callback Callback used to return the flash light support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void; - - /** - * Checks whether a specified flash mode is supported. - * @param flashMode Flash mode - * @return Promise used to return flash mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFlashModeSupported(flashMode: FlashMode): Promise; - - /** - * Gets current flash mode. - * @param callback Callback used to return the current flash mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFlashMode(callback: AsyncCallback): void; - - /** - * Gets current flash mode. - * @return Promise used to return the flash mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFlashMode(): Promise; - - /** - * Sets flash mode. - * @param flashMode Target flash mode. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void; - - /** - * Sets flash mode. - * @param flashMode Target flash mode. - * @return Promise used to return the result. + * Subscribes error event callback. + * @param type Event type. + * @param callback Callback used to get the capture session errors. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - setFlashMode(flashMode: FlashMode): Promise; + on(type: 'error', callback: ErrorCallback): void; + } - /** - * Checks whether a specified exposure mode is supported. - * @param aeMode Exposure mode. - * @param callback Callback used to return the exposure mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void; + /** + * Enum for CaptureSession error code. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + enum CaptureSessionErrorCode { + ERROR_UNKNOWN = -1 + } - /** - * Checks whether a specified exposure mode is supported. - * @param aeMode Exposure mode - * @return Promise used to return exposure mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isExposureModeSupported(aeMode: ExposureMode): Promise; - - /** - * Gets current exposure mode. - * @param callback Callback used to return the current exposure mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureMode(callback: AsyncCallback): void; + /** + * Capture session error object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface CaptureSessionError extends Error { + code: CaptureSessionErrorCode; + } - /** - * Gets current exposure mode. - * @return Promise used to return the current exposure mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureMode(): Promise; - - /** - * Sets exposure mode. - * @param aeMode Exposure mode - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void; - - /** - * Sets Exposure mode. - * @param aeMode Exposure mode - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setExposureMode(aeMode: ExposureMode): Promise; - - /** - * Gets current metering point. - * @param callback Callback used to return the current metering point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getMeteringPoint(callback: AsyncCallback): void; - - /** - * Gets current metering point. - * @return Promise used to return the current metering point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getMeteringPoint(): Promise; - - /** - * Set the center point of the metering area. - * @param point Metering point - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setMeteringPoint(point: Point, callback: AsyncCallback): void; - - /** - * Set the center point of the metering area. - * @param point metering point - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setMeteringPoint(point: Point): Promise; - - /** - * Query the exposure compensation range. - * @param callback Callback used to return the array of compenstation range. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureBiasRange(callback: AsyncCallback>): void; - - /** - * Query the exposure compensation range. - * @return Promise used to return the array of compenstation range. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureBiasRange(): Promise>; - - /** - * Set exposure compensation. - * @param exposureBias Exposure compensation - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setExposureBias(exposureBias: number, callback: AsyncCallback): void; - - /** - * Set exposure compensation. - * @param exposureBias Exposure compensation - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setExposureBias(exposureBias: number): Promise; - - /** - * Query the exposure value. - * @param callback Callback used to return the exposure value. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureValue(callback: AsyncCallback): void; - - /** - * Query the exposure value. - * @return Promise used to return the exposure value. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getExposureValue(): Promise; - - /** - * Checks whether a specified focus mode is supported. - * @param afMode Focus mode. - * @param callback Callback used to return the device focus support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void; - - /** - * Checks whether a specified focus mode is supported. - * @param afMode Focus mode. - * @return Promise used to return the focus mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFocusModeSupported(afMode: FocusMode): Promise; - - /** - * Gets current focus mode. - * @param callback Callback used to return the current focus mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusMode(callback: AsyncCallback): void; - - /** - * Gets current focus mode. - * @return Promise used to return the focus mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusMode(): Promise; - - /** - * Sets focus mode. - * @param afMode Target focus mode. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusMode(afMode: FocusMode, callback: AsyncCallback): void; - - /** - * Sets focus mode. - * @param afMode Target focus mode. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusMode(afMode: FocusMode): Promise; - - /** - * Sets focus point. - * @param point Target focus point. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusPoint(point: Point, callback: AsyncCallback): void; - - /** - * Sets focus point. - * @param afMode Target focus point. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusPoint(point: Point): Promise; - - /** - * Gets current focus point. - * @param callback Callback used to return the current focus point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusPoint(callback: AsyncCallback): void; - - /** - * Gets current focus point. - * @return Promise used to return the current focus point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusPoint(): Promise; - - /** - * Gets current focal length. - * @param callback Callback used to return the current focal point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocalLength(callback: AsyncCallback): void; - - /** - * Gets current focal length. - * @return Promise used to return the current focal point. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocalLength(): Promise; - - /** - * Gets all supported zoom ratio range. - * @param callback Callback used to return the zoom ratio range. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatioRange(callback: AsyncCallback>): void; - - /** - * Gets all supported zoom ratio range. - * @return Promise used to return the zoom ratio range. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatioRange(): Promise>; - - /** - * Gets zoom ratio. - * @param callback Callback used to return the current zoom ratio value. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatio(callback: AsyncCallback): void; - - /** - * Gets zoom ratio. - * @return Promise used to return the zoom ratio value. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatio(): Promise; - - /** - * Sets zoom ratio. - * @param zoomRatio Target zoom ratio. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setZoomRatio(zoomRatio: number, callback: AsyncCallback): void; - - /** - * Sets zoom ratio. - * @param zoomRatio Target zoom ratio. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setZoomRatio(zoomRatio: number): Promise; - - /** - * Check whether the specified video stabilization mode is supported. - * @param vsMode Video Stabilization mode. - * @param callback Callback used to return if video stablization mode is supported. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isVideoStablizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void; - - /** - * Check whether the specified video stabilization mode is supported. - * @param callback Callback used to return if video stablization mode is supported. - * @return Promise used to return flash mode support status. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isVideoStablizationModeSupported(vsMode: VideoStabilizationMode): Promise; - - /** - * Query the video stabilization mode currently in use. - * @param callback Callback used to return the current video stabilization mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getActiveVideoStabilizationMode(callback: AsyncCallback): void; - - /** - * Query the video stabilization mode currently in use. - * @return Promise used to return the current video stabilization mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getActiveVideoStabilizationMode(): Promise; - - /** - * Set video stabilization mode. - * @param mode video stabilization mode to set. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void; - - /** - * Set video stabilization mode. - * @param mode video stabilization mode to set. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setVideoStabilizationMode(mode: VideoStabilizationMode): Promise; - - /** - * Subscribes focus status change event callback. - * @param type Event type. - * @param callback Callback used to get the focus state change. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'focusStateChange', callback: AsyncCallback): void; - - /** - * Subscribes exposure status change event callback. - * @param type Event type. - * @param callback Callback used to get the exposure state change. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'exposureStateChange', callback: AsyncCallback): void; - - /** - * Subscribes error event callback. - * @param type Event type. - * @param callback Callback used to get the capture session errors. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'error', callback: ErrorCallback): void; - } - - /** - * Enum for CaptureSession error code. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CaptureSessionErrorCode { - /** - * Unknown error. - * @since 9 - */ - ERROR_UNKNOWN = -1, - /** - * Insufficient resources. - * @since 9 - */ - ERROR_INSUFFICIENT_RESOURCES, - /** - * Timeout error. - * @since 9 - */ - ERROR_TIMEOUT, - } - - /** - * Capture session error object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CaptureSessionError extends Error { - code: CaptureSessionErrorCode; - } - - /** - * Camera output object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraOutput { - /** - * Release output instance. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(callback: AsyncCallback): void; - - /** - * Release output instance. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(): Promise; - } + /** + * Creates a PreviewOutput instance. + * @param surfaceId Surface object id used in camera preview output. + * @param callback Callback used to return the PreviewOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createPreviewOutput(surfaceId: string, callback: AsyncCallback): void; /** - * Preview output object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface PreviewOutput extends CameraOutput { - /** - * Add surface id for output instance. - * @param surfaceId Surface object id used in camera preview output. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - addDeferredSurface(surfaceId: string, callback: AsyncCallback): void; - - /** - * Add surface id for output instance. - * @param surfaceId Surface object id used in camera preview output. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - addDeferredSurface(surfaceId: string): Promise; - - /** - * Start output instance. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - start(callback: AsyncCallback): void; - - /** - * Start output instance. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - start(): Promise; + * Creates a PreviewOutput instance. + * @param surfaceId Surface object id used in camera preview output. + * @return Promise used to return the PreviewOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createPreviewOutput(surfaceId: string): Promise; + /** + * Preview output object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface PreviewOutput { /** - * Stop output instance. + * Release output instance. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(callback: AsyncCallback): void; + release(callback: AsyncCallback): void; /** - * Stop output instance. + * Release output instance. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(): Promise; + release(): Promise; /** * Subscribes frame start event callback. @@ -1639,11 +1005,7 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum PreviewOutputErrorCode { - /** - * Unknown error. - * @since 9 - */ - ERROR_UNKNOWN = -1, + ERROR_UNKNOWN = -1 } /** @@ -1655,6 +1017,24 @@ declare namespace camera { code: PreviewOutputErrorCode; } + /** + * Creates a PhotoOutput instance. + * @param surfaceId Surface object id used in camera photo output. + * @param callback Callback used to return the PhotoOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createPhotoOutput(surfaceId: string, callback: AsyncCallback): void; + + /** + * Creates a PhotoOutput instance. + * @param surfaceId Surface object id used in camera photo output. + * @return Promise used to return the PhotoOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createPhotoOutput(surfaceId: string): Promise; + /** * Enumerates the image rotation angles. * @since 9 @@ -1690,26 +1070,6 @@ declare namespace camera { ROTATION_270 = 270 } - interface Location { - /** - * Latitude. - * @since 9 - */ - latitude: number; - - /** - * Longitude. - * @since 9 - */ - longitude: number; - - /** - * Altitude. - * @since 9 - */ - altitude: number; - } - /** * Enumerates the image quality levels. * @since 9 @@ -1749,27 +1109,12 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ quality?: QualityLevel; - /** * Photo rotation. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ rotation?: ImageRotation; - - /** - * Photo location. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - location?: Location; - - /** - * Set the mirror photo function switch, default to false. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - mirror?: boolean; } /** @@ -1777,23 +1122,7 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface PhotoOutput extends CameraOutput { - /** - * Get default capture setting. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getDefaultCaptureSetting(callback: AsyncCallback): void; - - /** - * Get default capture setting. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getDefaultCaptureSetting(): Promise; - + interface PhotoOutput { /** * Start capture output. * @param callback Callback used to return the result. @@ -1821,20 +1150,20 @@ declare namespace camera { capture(setting?: PhotoCaptureSetting): Promise; /** - * Check whether to support mirror photo. - * @param callback Callback used to return the mirror support status. + * Release output instance. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - isMirrorSupported(callback: AsyncCallback): void; + release(callback: AsyncCallback): void; /** - * Check whether to support mirror photo. - * @return Promise used to return the mirror support status. + * Release output instance. + * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - isMirrorSupported(): Promise; + release(): Promise; /** * Subscribes capture start event callback. @@ -1919,26 +1248,7 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum PhotoOutputErrorCode { - /** - * Unknown error. - * @since 9 - */ - ERROR_UNKNOWN = -1, - /** - * Driver error. - * @since 9 - */ - ERROR_DRIVER_ERROR, - /** - * Insufficient resources. - * @since 9 - */ - ERROR_INSUFFICIENT_RESOURCES, - /** - * Timeout error. - * @since 9 - */ - ERROR_TIMEOUT, + ERROR_UNKNOWN = -1 } /** @@ -1950,12 +1260,30 @@ declare namespace camera { code: PhotoOutputErrorCode; } + /** + * Creates a VideoOutput instance. + * @param surfaceId Surface object id used in camera video output. + * @param callback Callback used to return the VideoOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createVideoOutput(surfaceId: string, callback: AsyncCallback): void; + + /** + * Creates a VideoOutput instance. + * @param surfaceId Surface object id used in camera video output. + * @return Promise used to return the VideoOutput instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + function createVideoOutput(surfaceId: string): Promise; + /** * Video output object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface VideoOutput extends CameraOutput { + interface VideoOutput { /** * Start video output. * @param callback Callback used to return the result. @@ -1964,7 +1292,7 @@ declare namespace camera { */ start(callback: AsyncCallback): void; - /** + /** * Start video output. * @return Promise used to return the result. * @since 9 @@ -1989,212 +1317,38 @@ declare namespace camera { stop(): Promise; /** - * Subscribes frame start event callback. - * @param type Event type. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'frameStart', callback: AsyncCallback): void; - - /** - * Subscribes frame end event callback. - * @param type Event type. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'frameEnd', callback: AsyncCallback): void; - - /** - * Subscribes error event callback. - * @param type Event type. - * @param callback Callback used to get the video output errors. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: 'error', callback: ErrorCallback): void; - } - - /** - * Enum for video output error code. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum VideoOutputErrorCode { - /** - * Unknown error. - * @since 9 - */ - ERROR_UNKNOWN = -1, - /** - * Driver error. - * @since 9 - */ - ERROR_DRIVER_ERROR, - } - - /** - * Video output error object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface VideoOutputError extends Error { - code: VideoOutputErrorCode; - } - - /** - * Metadata object type. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum MetadataObjectType { - FACE_DETECTION = 0 - } - - /** - * Rectangle definition. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface Rect { - /** - * X coordinator of top left point. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - topLeftX: number; - /** - * Y coordinator of top left point. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - topLeftY: number; - /** - * Width of this rectangle. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - width: number; - /** - * Height of this rectangle. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - height: number; - } - - /** - * Metadata object basis. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface MetadataObject { - /** - * Get current metadata object type. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getType(callback: AsyncCallback): void; - - /** - * Get current metadata object type. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getType(): Promise; - - /** - * Get current metadata object timestamp in milliseconds. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getTimestamp(callback: AsyncCallback): void; - - /** - * Get current metadata object timestamp in milliseconds. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getTimestamp(): Promise; - - /** - * Get the axis-aligned bounding box of detected metadata object. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getBoundingBox(callback: AsyncCallback): void; - - /** - * Get the axis-aligned bounding box of detected metadata object. - * @param Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getBoundingBox(): Promise; - } - - /** - * Metadata face object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface MetadataFaceObject extends MetadataObject { - } - - /** - * Metadata Output object - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface MetadataOutput extends CameraOutput { - /** - * Start output metadata + * Release output instance. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - start(callback: AsyncCallback): void; + release(callback: AsyncCallback): void; /** - * Start output metadata + * Release output instance. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - start(): Promise; + release(): Promise; /** - * Stop output metadata + * Subscribes frame start event callback. + * @param type Event type. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(callback: AsyncCallback): void; - - /** - * Stop output metadata - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - stop(): Promise; + on(type: 'frameStart', callback: AsyncCallback): void; /** - * Subscribes to metadata objects available event callback. + * Subscribes frame end event callback. * @param type Event type. - * @param callback Callback used to get the available metadata objects. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - on(type: 'metadataObjectsAvailable', callback: AsyncCallback>): void; + on(type: 'frameEnd', callback: AsyncCallback): void; /** * Subscribes error event callback. @@ -2203,34 +1357,25 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - on(type: 'error', callback: ErrorCallback): void; + on(type: 'error', callback: ErrorCallback): void; } /** - * Enum for metadata output error code. + * Enum for video output error code. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - enum MetadataOutputErrorCode { - /** - * Unknown errors. - * @since 9 - */ - ERROR_UNKNOWN = -1, - /** - * Insufficient resources. - * @since 9 - */ - ERROR_INSUFFICIENT_RESOURCES, + enum VideoOutputErrorCode { + ERROR_UNKNOWN = -1 } /** - * Metadata output error object. + * Video output error object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface MetadataOutputError extends Error { - code: MetadataOutputErrorCode; + interface VideoOutputError extends Error { + code: VideoOutputErrorCode; } } diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 88bcc1ce3556f662e0a29548a4b01e653b1c3d50..2f2119fc3a54bb9dacae874dfda3f8afc01f8d7e 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -825,6 +825,24 @@ declare namespace rpc { */ queryLocalInterface(descriptor: string): IRemoteBroker; + /** + * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. + * + *

If options indicates the asynchronous mode, a promise will be fulfilled immediately + * and the reply message does not contain any content. If options indicates the synchronous mode, + * a promise will be fulfilled when the response to sendRequest is returned, + * and the reply message contains the returned information. + * param code Message code called by the request, which is determined by the client and server. + * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. + * param data {@link MessageParcel} object holding the data to send. + * param reply {@link MessageParcel} object that receives the response. + * param operations Indicates the synchronous or asynchronous mode to send messages. + * @returns Promise used to return the {@link SendRequestResult} instance. + * @throws Throws an exception if the method fails to be called. + * @since 8 + */ + sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise; + /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -845,24 +863,6 @@ declare namespace rpc { */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; - /** - * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. - * - *

If options indicates the asynchronous mode, a promise will be fulfilled immediately - * and the reply message does not contain any content. If options indicates the synchronous mode, - * a promise will be fulfilled when the response to sendRequest is returned, - * and the reply message contains the returned information. - * param code Message code called by the request, which is determined by the client and server. - * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. - * param data {@link MessageParcel} object holding the data to send. - * param reply {@link MessageParcel} object that receives the response. - * param operations Indicates the synchronous or asynchronous mode to send messages. - * @returns Promise used to return the {@link SendRequestResult} instance. - * @throws Throws an exception if the method fails to be called. - * @since 8 - */ - sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise; - /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -1070,22 +1070,6 @@ declare namespace rpc { */ onRemoteRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; - /** - * Sends a request to the peer object. - * - *

If the peer object and {@code RemoteObject} are on the same device, the request is sent by the IPC driver. - * If they are on different devices, the request is sent by the socket driver. - * - * @param code Indicates the message code of the request. - * @param data Indicates the {@link MessageParcel} object storing the data to be sent. - * @param reply Indicates the {@link MessageParcel} object receiving the response data. - * @param options Indicates a synchronous (default) or asynchronous request. - * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. - * @deprecated since 8 - * @since 7 - */ - sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; - /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -1104,6 +1088,22 @@ declare namespace rpc { */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise; + /** + * Sends a request to the peer object. + * + *

If the peer object and {@code RemoteObject} are on the same device, the request is sent by the IPC driver. + * If they are on different devices, the request is sent by the socket driver. + * + * @param code Indicates the message code of the request. + * @param data Indicates the {@link MessageParcel} object storing the data to be sent. + * @param reply Indicates the {@link MessageParcel} object receiving the response data. + * @param options Indicates a synchronous (default) or asynchronous request. + * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @deprecated since 8 + * @since 7 + */ + sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; + /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -1226,23 +1226,6 @@ declare namespace rpc { */ getInterfaceDescriptor(): string; - /** - * Sends a request to the peer object. - * - *

If the peer object and {@code RemoteProxy} are on the same device, the request is sent by the IPC driver. - * If they are on different devices, the request is sent by the socket driver. - * - * @param code Indicates the message code of the request. - * @param data Indicates the {@link MessageParcel} object storing the data to be sent. - * @param reply Indicates the {@link MessageParcel} object receiving the response data. - * @param options Indicates a synchronous (default) or asynchronous request. - * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. - * @throws RemoteException Throws this exception if a remote object exception occurs. - * @deprecated since 8 - * @since 7 - */ - sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; - /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * @@ -1261,6 +1244,23 @@ declare namespace rpc { */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise; + /** + * Sends a request to the peer object. + * + *

If the peer object and {@code RemoteProxy} are on the same device, the request is sent by the IPC driver. + * If they are on different devices, the request is sent by the socket driver. + * + * @param code Indicates the message code of the request. + * @param data Indicates the {@link MessageParcel} object storing the data to be sent. + * @param reply Indicates the {@link MessageParcel} object receiving the response data. + * @param options Indicates a synchronous (default) or asynchronous request. + * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @throws RemoteException Throws this exception if a remote object exception occurs. + * @deprecated since 8 + * @since 7 + */ + sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; + /** * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. * 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.wifi.d.ts b/api/@ohos.wifi.d.ts index 21ad360b0075b96d9e2d898de7b3d453a4eb83c9..ceba8186e977ef15f7605a703899e2ac5b6584b2 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -1070,8 +1070,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 +1154,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 +1204,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 +1288,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/application/BaseContext.d.ts b/api/application/BaseContext.d.ts index 50ab781d4c89f84d667680aae1b0ba251b025c70..9ddd20b757457b310e5712a1719397f19146c53d 100644 --- a/api/application/BaseContext.d.ts +++ b/api/application/BaseContext.d.ts @@ -21,7 +21,7 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A */ -export default interface BaseContext { +export default abstract class BaseContext { /** * Indicates the context is FA Mode or Stage Mode. * @@ -29,4 +29,4 @@ export default interface BaseContext { * @syscap SystemCapability.Ability.AbilityRuntime.Core */ stageMode: boolean; -} \ No newline at end of file +} diff --git a/api/application/FormExtensionContext.d.ts b/api/application/FormExtensionContext.d.ts index 0f5c012e1902f4ebb93138573b5a3386addf62a3..db22ad84756c52349481e2fd5d507d34a6d8c711 100644 --- a/api/application/FormExtensionContext.d.ts +++ b/api/application/FormExtensionContext.d.ts @@ -29,21 +29,6 @@ import Want from '../@ohos.application.Want'; */ export default class FormExtensionContext extends ExtensionContext { - /** - * update the given form. - * - *

You can use this method to update the given form

- * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @param formId Indicates the given form. - * @param formBindingData Indicates the form data. - * @return - - * @StageModelOnly - */ - updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void; - updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; - /** * start an ability within the same bundle. * 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/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index 4c8065184d5fc01b8f2e50c51a0ce2750d1ebb56..79d07883d2e7434d599544542dbc9239c79de9e9 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -22,7 +22,7 @@ import { AsyncCallback } from '../../basic' * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; */ -interface ResultSet { +export default interface ResultSet { /** * Obtains the names of all columns in a result set. *